mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
228 lines
10 KiB
Plaintext
228 lines
10 KiB
Plaintext
# Query: .innerHTML =
|
|
# Flags: CaseSensitive WordMatch
|
|
# Including: src/vs/**/*.{t,j}s
|
|
# Excluding: *.test.ts
|
|
# ContextLines: 3
|
|
|
|
26 results - 15 files
|
|
|
|
src/vs/base/browser/markdownRenderer.ts:
|
|
156 const strValue = values[0];
|
|
157 const span = element.querySelector(`div[data-code="${id}"]`);
|
|
158 if (span) {
|
|
159: span.innerHTML = strValue;
|
|
160 }
|
|
161 }).catch(err => {
|
|
162 // ignore
|
|
|
|
238 return true;
|
|
239 }
|
|
240
|
|
241: element.innerHTML = insane(renderedMarkdown, {
|
|
242 allowedSchemes,
|
|
243 // allowedTags should included everything that markdown renders to.
|
|
244 // Since we have our own sanitize function for marked, it's possible we missed some tag so let insane make sure.
|
|
|
|
src/vs/base/browser/ui/contextview/contextview.ts:
|
|
157 this.shadowRootHostElement = DOM.$('.shadow-root-host');
|
|
158 this.container.appendChild(this.shadowRootHostElement);
|
|
159 this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });
|
|
160: this.shadowRoot.innerHTML = `
|
|
161 <style>
|
|
162 ${SHADOW_ROOT_CSS}
|
|
163 </style>
|
|
|
|
src/vs/code/electron-browser/workbench/workbench.js:
|
|
124 const style = document.createElement('style');
|
|
125 style.className = 'initialShellColors';
|
|
126 document.head.appendChild(style);
|
|
127: style.innerHTML = `body { background-color: ${shellBackground}; color: ${shellForeground}; margin: 0; padding: 0; }`;
|
|
128
|
|
129 if (data && data.layoutInfo) {
|
|
130 // restore parts if possible (we might not always store layout info)
|
|
|
|
150
|
|
151 if (configuration.folderUri || configuration.workspace) {
|
|
152 // folder or workspace -> status bar color, sidebar
|
|
153: splash.innerHTML = `
|
|
154 <div style="position: absolute; width: 100%; left: 0; top: 0; height: ${layoutInfo.titleBarHeight}px; background-color: ${colorInfo.titleBarBackground}; -webkit-app-region: drag;"></div>
|
|
155 <div style="position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: 0; width: ${layoutInfo.activityBarWidth}px; background-color: ${colorInfo.activityBarBackground};"></div>
|
|
156 <div style="position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: ${layoutInfo.activityBarWidth}px; width: ${layoutInfo.sideBarWidth}px; background-color: ${colorInfo.sideBarBackground};"></div>
|
|
|
|
158 `;
|
|
159 } else {
|
|
160 // empty -> speical status bar color, no sidebar
|
|
161: splash.innerHTML = `
|
|
162 <div style="position: absolute; width: 100%; left: 0; top: 0; height: ${layoutInfo.titleBarHeight}px; background-color: ${colorInfo.titleBarBackground}; -webkit-app-region: drag;"></div>
|
|
163 <div style="position: absolute; height: calc(100% - ${layoutInfo.titleBarHeight}px); top: ${layoutInfo.titleBarHeight}px; ${layoutInfo.sideBarSide}: 0; width: ${layoutInfo.activityBarWidth}px; background-color: ${colorInfo.activityBarBackground};"></div>
|
|
164 <div style="position: absolute; width: 100%; bottom: 0; left: 0; height: ${layoutInfo.statusBarHeight}px; background-color: ${colorInfo.statusBarNoFolderBackground};"></div>
|
|
|
|
src/vs/code/electron-sandbox/issue/issueReporterMain.ts:
|
|
57 const platformClass = platform.isWindows ? 'windows' : platform.isLinux ? 'linux' : 'mac';
|
|
58 addClass(document.body, platformClass); // used by our fonts
|
|
59
|
|
60: document.body.innerHTML = BaseHtml();
|
|
61 const issueReporter = new IssueReporter(configuration);
|
|
62 issueReporter.render();
|
|
63 document.body.style.display = 'block';
|
|
|
|
244 content.push(`.monaco-text-button:not(.disabled):hover, .monaco-text-button:focus { background-color: ${styles.buttonHoverBackground} !important; }`);
|
|
245 }
|
|
246
|
|
247: styleTag.innerHTML = content.join('\n');
|
|
248 document.head.appendChild(styleTag);
|
|
249 document.body.style.color = styles.color || '';
|
|
250 }
|
|
|
|
src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts:
|
|
320 content.push(`.highest { color: ${styles.highlightForeground}; }`);
|
|
321 }
|
|
322
|
|
323: styleTag.innerHTML = content.join('\n');
|
|
324 if (document.head) {
|
|
325 document.head.appendChild(styleTag);
|
|
326 }
|
|
|
|
src/vs/editor/browser/view/domLineBreaksComputer.ts:
|
|
107 allCharOffsets[i] = tmp[0];
|
|
108 allVisibleColumns[i] = tmp[1];
|
|
109 }
|
|
110: containerDomNode.innerHTML = sb.build();
|
|
111
|
|
112 containerDomNode.style.position = 'absolute';
|
|
113 containerDomNode.style.top = '10000';
|
|
|
|
src/vs/editor/browser/view/viewLayer.ts:
|
|
507 private _finishRenderingNewLines(ctx: IRendererContext<T>, domNodeIsEmpty: boolean, newLinesHTML: string, wasNew: boolean[]): void {
|
|
508 const lastChild = <HTMLElement>this.domNode.lastChild;
|
|
509 if (domNodeIsEmpty || !lastChild) {
|
|
510: this.domNode.innerHTML = newLinesHTML;
|
|
511 } else {
|
|
512 lastChild.insertAdjacentHTML('afterend', newLinesHTML);
|
|
513 }
|
|
|
|
525 private _finishRenderingInvalidLines(ctx: IRendererContext<T>, invalidLinesHTML: string, wasInvalid: boolean[]): void {
|
|
526 const hugeDomNode = document.createElement('div');
|
|
527
|
|
528: hugeDomNode.innerHTML = invalidLinesHTML;
|
|
529
|
|
530 for (let i = 0; i < ctx.linesLength; i++) {
|
|
531 const line = ctx.lines[i];
|
|
|
|
src/vs/editor/browser/widget/diffEditorWidget.ts:
|
|
2157
|
|
2158 let domNode = document.createElement('div');
|
|
2159 domNode.className = `view-lines line-delete ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`;
|
|
2160: domNode.innerHTML = sb.build();
|
|
2161 Configuration.applyFontInfoSlow(domNode, fontInfo);
|
|
2162
|
|
2163 let marginDomNode = document.createElement('div');
|
|
2164 marginDomNode.className = 'inline-deleted-margin-view-zone';
|
|
2165: marginDomNode.innerHTML = marginHTML.join('');
|
|
2166 Configuration.applyFontInfoSlow(marginDomNode, fontInfo);
|
|
2167
|
|
2168 return {
|
|
|
|
src/vs/editor/standalone/browser/colorizer.ts:
|
|
40 let text = domNode.firstChild ? domNode.firstChild.nodeValue : '';
|
|
41 domNode.className += ' ' + theme;
|
|
42 let render = (str: string) => {
|
|
43: domNode.innerHTML = str;
|
|
44 };
|
|
45 return this.colorize(modeService, text || '', mimeType, options).then(render, (err) => console.error(err));
|
|
46 }
|
|
|
|
src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts:
|
|
212 if (!this._globalStyleElement) {
|
|
213 this._globalStyleElement = dom.createStyleSheet();
|
|
214 this._globalStyleElement.className = 'monaco-colors';
|
|
215: this._globalStyleElement.innerHTML = this._css;
|
|
216 this._styleElements.push(this._globalStyleElement);
|
|
217 }
|
|
218 return Disposable.None;
|
|
|
|
221 private _registerShadowDomContainer(domNode: HTMLElement): IDisposable {
|
|
222 const styleElement = dom.createStyleSheet(domNode);
|
|
223 styleElement.className = 'monaco-colors';
|
|
224: styleElement.innerHTML = this._css;
|
|
225 this._styleElements.push(styleElement);
|
|
226 return {
|
|
227 dispose: () => {
|
|
|
|
291 ruleCollector.addRule(generateTokensCSSForColorMap(colorMap));
|
|
292
|
|
293 this._css = cssRules.join('\n');
|
|
294: this._styleElements.forEach(styleElement => styleElement.innerHTML = this._css);
|
|
295
|
|
296 TokenizationRegistry.setColorMap(colorMap);
|
|
297 this._onColorThemeChange.fire(theme);
|
|
|
|
src/vs/editor/test/browser/controller/imeTester.ts:
|
|
55 let content = this._model.getModelLineContent(i);
|
|
56 r += content + '<br/>';
|
|
57 }
|
|
58: output.innerHTML = r;
|
|
59 }
|
|
60 }
|
|
61
|
|
|
|
69 let title = document.createElement('div');
|
|
70 title.className = 'title';
|
|
71
|
|
72: title.innerHTML = description + '. Type <strong>' + inputStr + '</strong>';
|
|
73 container.appendChild(title);
|
|
74
|
|
75 let startBtn = document.createElement('button');
|
|
|
|
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts:
|
|
454
|
|
455 private getMarkdownDragImage(templateData: MarkdownCellRenderTemplate): HTMLElement {
|
|
456 const dragImageContainer = DOM.$('.cell-drag-image.monaco-list-row.focused.markdown-cell-row');
|
|
457: dragImageContainer.innerHTML = templateData.container.outerHTML;
|
|
458
|
|
459 // Remove all rendered content nodes after the
|
|
460 const markdownContent = dragImageContainer.querySelector('.cell.markdown')!;
|
|
|
|
611 return null;
|
|
612 }
|
|
613
|
|
614: editorContainer.innerHTML = richEditorText;
|
|
615
|
|
616 return dragImageContainer;
|
|
617 }
|
|
|
|
src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts:
|
|
375 addMouseoverListeners(outputNode, outputId);
|
|
376 const content = data.content;
|
|
377 if (content.type === RenderOutputType.Html) {
|
|
378: outputNode.innerHTML = content.htmlContent;
|
|
379 cellOutputContainer.appendChild(outputNode);
|
|
380 domEval(outputNode);
|
|
381 } else {
|
|
|
|
src/vs/workbench/contrib/webview/browser/pre/main.js:
|
|
386 // apply default styles
|
|
387 const defaultStyles = newDocument.createElement('style');
|
|
388 defaultStyles.id = '_defaultStyles';
|
|
389: defaultStyles.innerHTML = defaultCssRules;
|
|
390 newDocument.head.prepend(defaultStyles);
|
|
391
|
|
392 applyStyles(newDocument, newDocument.body);
|
|
|
|
src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts:
|
|
281
|
|
282 const content = model.main.textEditorModel.getValue(EndOfLinePreference.LF);
|
|
283 if (!strings.endsWith(input.resource.path, '.md')) {
|
|
284: this.content.innerHTML = content;
|
|
285 this.updateSizeClasses();
|
|
286 this.decorateContent();
|
|
287 this.contentDisposables.push(this.keybindingService.onDidUpdateKeybindings(() => this.decorateContent()));
|
|
|
|
303 const innerContent = document.createElement('div');
|
|
304 innerContent.classList.add('walkThroughContent'); // only for markdown files
|
|
305 const markdown = this.expandMacros(content);
|
|
306: innerContent.innerHTML = marked(markdown, { renderer });
|
|
307 this.content.appendChild(innerContent);
|
|
308
|
|
309 model.snippets.forEach((snippet, i) => {
|