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


TypeScript octiconLabel.renderOcticons函数代码示例

本文整理汇总了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;
	}
开发者ID:PKRoma,项目名称:vscode,代码行数:34,代码来源:highlightedLabel.ts

示例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;
	}
开发者ID:DonJayamanne,项目名称:vscode,代码行数:34,代码来源:highlightedLabel.ts

示例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;
	}
开发者ID:kumarharsh,项目名称:vscode,代码行数:35,代码来源:highlightedLabel.ts


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