当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript lodash.unescape函数代码示例

本文整理汇总了TypeScript中lodash.unescape函数的典型用法代码示例。如果您正苦于以下问题:TypeScript unescape函数的具体用法?TypeScript unescape怎么用?TypeScript unescape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了unescape函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

      $scope.updateVariableValue = function(value) {
        if (value === '' || segment.value === value) {
          return;
        }

        value = _.unescape(value);

        $scope.$apply(function() {
          const selected = _.find($scope.altSegments, { value: value });
          if (selected) {
            segment.value = selected.value;
            segment.html = selected.html || selected.value;
            segment.fake = false;
            segment.expandable = selected.expandable;

            if (selected.type) {
              segment.type = selected.type;
            }
          } else if (segment.custom !== 'false') {
            segment.value = value;
            segment.html = $sce.trustAsHtml(value);
            segment.expandable = true;
            segment.fake = false;
          }

          $scope.onChange();
        });
      };
开发者ID:gzq0616,项目名称:grafana,代码行数:28,代码来源:metric_segment.ts

示例2: updateValue

  updateValue(text) {
    text = _.unescape(text);

    if (text === '' || this.text === text) {
      return;
    }

    this.$scope.$apply(() => {
      var option = _.find(this.optionCache, { text: text });

      if (option) {
        if (_.isObject(this.model)) {
          this.model = option;
        } else {
          this.model = option.value;
        }
        this.text = option.text;
      } else if (this.allowCustom) {
        if (_.isObject(this.model)) {
          this.model.text = this.model.value = text;
        } else {
          this.model = text;
        }
        this.text = text;
      }

      // needs to call this after digest so
      // property is synced with outerscope
      this.$scope.$$postDigest(() => {
        this.$scope.$apply(() => {
          this.onChange({ $option: option });
        });
      });
    });
  }
开发者ID:InvariantIO,项目名称:grafana,代码行数:35,代码来源:form_dropdown.ts

示例3: setTimeout

 updater: value => {
   value = _.unescape(value);
   setTimeout(() => {
     inputBlur.call($input[0], paramIndex);
   }, 0);
   return value;
 },
开发者ID:CorpGlory,项目名称:grafana,代码行数:7,代码来源:query_part_editor.ts

示例4: it

  it('addDollyToScene works', () => {
    let newScript = service.addDollyToScene(simpleScriptText);
    // newScript = utils.escapeText(newScript);
    // console.log(`ut.parser.service.spec.ts: newScript=${newScript}`);
    // let re = /scene = new THREE.Scene\(\);
    // let line1 = 'scene = new THREE.Scene\\(\\);\n';
    let line1 = 'scene = new THREE.Scene\\(\\);\n';
    let line2 = base.jsMarkupCommentBegin + "\n";
    // let line2 = _.unescape(base.jsMarkupCommentBegin) + "\n";
    // line2 = _.unescape(line2);
    // console.log(`line2=${line2}`);
    let line3 = 'scene.add\\(dolly\\);';

//     let expectedText = `scene = new THREE.Scene();
//     .*
// scene.add(dolly);
// `

    let re = new RegExp(_.unescape(line1 + line2 + line3), 'm');
    // let re = new RegExp(expectedText, 'm');

    expect(newScript).toMatch(re);

    // expect(newScript).toMatch(/dolly\.position\.set\(0, 0, 400\)/, 'm');
  });
开发者ID:vt5491,项目名称:threejs-vr-gallery,代码行数:25,代码来源:parser.service.spec.ts

示例5: clearTimeout

 updater: (value: string) => {
   value = _.unescape(value);
   if (value === part.params[paramIndex]) {
     clearTimeout(cancelBlur);
     $input.focus();
     return value;
   }
   return value;
 },
开发者ID:grafana,项目名称:grafana,代码行数:9,代码来源:sql_part_editor.ts

示例6: XMLSerializer

 data => {
   this.inputString = data;
   // console.log(`inputString=${this.inputString}`);
   this.userConvert(this.inputString);
   // this.outputText = new XMLSerializer().serializeToString(this.inputDoc);
   // Note: we have to call decodeURI to get rid of things like '<' in the
   // javascript (XMLSerializer will escape all the javascript)
   // debugger;
   this.outputText = _.unescape(
   new XMLSerializer().serializeToString(this.inputDoc));
   console.log(`outputText=${this.outputText}`);
 },
开发者ID:vt5491,项目名称:threejs-vr-gallery,代码行数:12,代码来源:convert.component.ts

示例7: clearTimeout

      $scope.updater = (value: string) => {
        value = _.unescape(value);
        if (value === segment.value) {
          clearTimeout(cancelBlur);
          $input.focus();
          return value;
        }

        $input.val(value);
        $scope.switchToLink(true);

        return value;
      };
开发者ID:grafana,项目名称:grafana,代码行数:13,代码来源:metric_segment.ts

示例8: onSubmit

  onSubmit(f: NgForm) {
    console.log(`Convert.onSubmit: entered, f.value=${f.controls.inputText.value}`);
    console.log(`f.value=${f.value}`);
    // console.log(`testFile.value=${testFile.value}`);
    // debugger;
    let inputText = f.controls.inputText.value;
    if (inputText) {
      this.userConvert(inputText);

      this.outputText = _.unescape(
        new XMLSerializer().serializeToString(this.inputDoc));
    }
    else {
      this.http.get(this.fn, {responseType: 'text'})
      .subscribe(
        data => {
          this.inputString = data;
          // console.log(`inputString=${this.inputString}`);
          this.userConvert(this.inputString);
          // this.outputText = new XMLSerializer().serializeToString(this.inputDoc);
          // Note: we have to call decodeURI to get rid of things like '<' in the
          // javascript (XMLSerializer will escape all the javascript)
          // debugger;
          this.outputText = _.unescape(
          new XMLSerializer().serializeToString(this.inputDoc));
          console.log(`outputText=${this.outputText}`);
        },
        (err: HttpErrorResponse) => {
          console.log('parseHtml: err=' + err, 'httperror=' + err.error);
        },
        () => {
          //TODO: put calls for other files here and put the 'done()' call in the last of the chain
          console.log('webgl_geometries loaded');
        }
      );

    }

    // let fn = '../../assets/test/examples/unix_style/webgl_geometry_cube.html';
    // let fn = '../../assets/test/examples/unix_style/webgl_geometries.html';
    // let fn = '../../assets/test/examples/unix_style/webgl_shaders_ocean.html';

    // this.userConvert(this.inputString);
    // this.outputText = new XMLSerializer().serializeToString(this.inputDoc);
    // console.log(`outputText=${this.outputText}`);
  }
开发者ID:vt5491,项目名称:threejs-vr-gallery,代码行数:46,代码来源:convert.component.ts

示例9: htmlUnescapeEscapedUserInput

export function htmlUnescapeEscapedUserInput( value: string ): string {
    return encodeURIComponent( _.unescape( value ) );
}
开发者ID:Novaleaf,项目名称:xlib,代码行数:3,代码来源:stringhelper.ts

示例10: formatRow

function formatRow(row, addEndRowDelimiter = true) {
  let text = '';
  for (let i = 0; i < row.length; i += 1) {
    if (isBoolean(row[i]) || isNumber(row[i]) || isNullOrUndefined(row[i])) {
      text += row[i];
    } else {
      text += `${QUOTE}${csvEscaped(htmlUnescaped(htmlDecoded(row[i])))}${QUOTE}`;
    }

    if (i < row.length - 1) {
      text += END_COLUMN;
    }
  }
  return addEndRowDelimiter ? text + END_ROW : text;
}
开发者ID:johntdyer,项目名称:grafana,代码行数:15,代码来源:file_export.ts


注:本文中的lodash.unescape函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。