當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。