本文整理汇总了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();
});
};
示例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 });
});
});
});
}
示例3: setTimeout
updater: value => {
value = _.unescape(value);
setTimeout(() => {
inputBlur.call($input[0], paramIndex);
}, 0);
return value;
},
示例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');
});
示例5: clearTimeout
updater: (value: string) => {
value = _.unescape(value);
if (value === part.params[paramIndex]) {
clearTimeout(cancelBlur);
$input.focus();
return value;
}
return value;
},
示例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}`);
},
示例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;
};
示例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}`);
}
示例9: htmlUnescapeEscapedUserInput
export function htmlUnescapeEscapedUserInput( value: string ): string {
return encodeURIComponent( _.unescape( value ) );
}
示例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;
}