本文整理匯總了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;
}