code cosmetics: convert to a lintable template string
This commit is contained in:
parent
6fdc01201b
commit
e128498518
|
@ -330,9 +330,9 @@
|
||||||
|
|
||||||
function setContentsInPageContext() {
|
function setContentsInPageContext() {
|
||||||
try {
|
try {
|
||||||
(document.head || ROOT).appendChild(document.createElement('script')).text = `
|
(document.head || ROOT).appendChild(document.createElement('script')).text = `(${queue => {
|
||||||
document.currentScript.remove();
|
document.currentScript.remove();
|
||||||
for (const {id, code} of ${JSON.stringify(pageContextQueue)}) {
|
for (const {id, code} of queue) {
|
||||||
const el = document.getElementById(id) ||
|
const el = document.getElementById(id) ||
|
||||||
document.querySelector('style.stylus[id="' + id + '"]');
|
document.querySelector('style.stylus[id="' + id + '"]');
|
||||||
if (!el) continue;
|
if (!el) continue;
|
||||||
|
@ -340,7 +340,7 @@
|
||||||
el.textContent = code;
|
el.textContent = code;
|
||||||
el.sheet.disabled = disabled;
|
el.sheet.disabled = disabled;
|
||||||
}
|
}
|
||||||
`;
|
}})(${JSON.stringify(pageContextQueue)})`;
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
let failedSome;
|
let failedSome;
|
||||||
for (const {el, code} of pageContextQueue) {
|
for (const {el, code} of pageContextQueue) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user