MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / load_codemirror_theme

Method load_codemirror_theme

webiojs/src/models/input/textarea.ts:139–151  ·  view source on GitHub ↗
(theme: string, url_tpl = appConfig.codeMirrorThemeURL)

Source from the content-addressed store, hash-verified

137 };
138
139 static load_codemirror_theme(theme: string, url_tpl = appConfig.codeMirrorThemeURL) {
140 let cssId = 'codemirror_theme_' + theme; // you could encode the css path itself to generate id..
141 if (!document.getElementById(cssId)) {
142 let head = document.getElementsByTagName('head')[0];
143 let link = document.createElement('link');
144 link.id = cssId;
145 link.rel = 'stylesheet';
146 link.type = 'text/css';
147 link.href = url_tpl.replace('%N', theme);
148 link.media = 'all';
149 head.appendChild(link);
150 }
151 }
152}
153
154

Callers 1

create_elementMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected