本文整理汇总了TypeScript中vs/base/browser/ui/octiconLabel/octiconLabel.renderOcticons函数的典型用法代码示例。如果您正苦于以下问题:TypeScript renderOcticons函数的具体用法?TypeScript renderOcticons怎么用?TypeScript renderOcticons使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了renderOcticons函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: render
private render(): void {
let htmlContent = '';
let pos = 0;
for (const highlight of this.highlights) {
if (highlight.end === highlight.start) {
continue;
}
if (pos < highlight.start) {
htmlContent += '<span>';
const substring = this.text.substring(pos, highlight.start);
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
htmlContent += '</span>';
pos = highlight.end;
}
htmlContent += '<span class="highlight">';
const substring = this.text.substring(highlight.start, highlight.end);
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
htmlContent += '</span>';
pos = highlight.end;
}
if (pos < this.text.length) {
htmlContent += '<span>';
const substring = this.text.substring(pos);
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
htmlContent += '</span>';
}
this.domNode.innerHTML = htmlContent;
this.domNode.title = this.title;
this.didEverRender = true;
}
示例2: render
private render() {
dom.clearNode(this.domNode);
let htmlContent: string[] = [],
highlight: IHighlight,
pos = 0;
for (let i = 0; i < this.highlights.length; i++) {
highlight = this.highlights[i];
if (highlight.end === highlight.start) {
continue;
}
if (pos < highlight.start) {
htmlContent.push('<span>');
htmlContent.push(renderOcticons(this.text.substring(pos, highlight.start)));
htmlContent.push('</span>');
pos = highlight.end;
}
htmlContent.push('<span class="highlight">');
htmlContent.push(renderOcticons(this.text.substring(highlight.start, highlight.end)));
htmlContent.push('</span>');
pos = highlight.end;
}
if (pos < this.text.length) {
htmlContent.push('<span>');
htmlContent.push(renderOcticons(this.text.substring(pos)));
htmlContent.push('</span>');
}
this.domNode.innerHTML = htmlContent.join('');
this.domNode.title = this.title;
this.didEverRender = true;
}
示例3: render
private render() {
dom.clearNode(this.domNode);
let htmlContent: string[] = [];
let pos = 0;
for (const highlight of this.highlights) {
if (highlight.end === highlight.start) {
continue;
}
if (pos < highlight.start) {
htmlContent.push('<span>');
const substring = this.text.substring(pos, highlight.start);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
pos = highlight.end;
}
htmlContent.push('<span class="highlight">');
const substring = this.text.substring(highlight.start, highlight.end);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
pos = highlight.end;
}
if (pos < this.text.length) {
htmlContent.push('<span>');
const substring = this.text.substring(pos);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
}
this.domNode.innerHTML = htmlContent.join('');
this.domNode.title = this.title;
this.didEverRender = true;
}