feat: Some refinements
This commit is contained in:
+56
@@ -0,0 +1,56 @@
|
||||
(function() {
|
||||
if (typeof Handlebars === 'undefined') {
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js';
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
const tempDefine = window.define;
|
||||
window.define = undefined;
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js';
|
||||
|
||||
script.onload = function() {
|
||||
window.define = tempDefine;
|
||||
|
||||
if (eval("(function() {\n return window.location.pathname === \"\";\n})()\n")) {
|
||||
(function() {
|
||||
|
||||
|
||||
const parsedData = eval("" || "(() => ({}))");
|
||||
const template = Handlebars.compile("");
|
||||
const rendered = template(parsedData);
|
||||
const targetElement = document.querySelector(".foo { color: red; }");
|
||||
|
||||
const temp = document.createElement('template');
|
||||
temp.innerHTML = rendered;
|
||||
|
||||
const newElement = temp.content.firstElementChild;
|
||||
|
||||
targetElement.replaceWith(newElement);
|
||||
|
||||
newElement.classList.add("template-style-762112231");
|
||||
|
||||
(function() {
|
||||
|
||||
})();
|
||||
})();
|
||||
|
||||
}
|
||||
if (eval("(function() {\n return window.location.pathname === \"\";\n})()\n")) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
const domReadyEvent = new Event('DOMContentLoaded', {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
});
|
||||
|
||||
document.dispatchEvent(domReadyEvent);
|
||||
window.dispatchEvent(domReadyEvent);
|
||||
};
|
||||
|
||||
document.head.appendChild(script);
|
||||
})()
|
||||
Reference in New Issue
Block a user