Replies: 1 comment
-
Hello! I have made a plugin to manage it, i think this two commands can help you.: Commands.add("dina:get-styles",(editor,sender,opts={}) => {
var head = editor.Canvas.getDocument().head;
var link = head.querySelectorAll("link");
var files = []
link.forEach(el=>{
files.push(el.outerHTML);
});
return files.join("");
});
Commands.add("dina:get-scripts",(editor,sender,opts={}) => {
var head = editor.Canvas.getDocument().head;
var script = head.querySelectorAll("script");
var files = []
script.forEach(el=>{
files.push(el.outerHTML);
});
return files.join("");
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Does anybody have ideas on how to manage script tags on a page?
Say for instance I create a block that requires jQuery, and maybe another block that requires jQuery and a carousel plugin. How can I maintain the proper order of the script tags as I add blocks to a page? How could I inject a library script (like jQuery) that needs to be the first script tag of the page (which would come after all of the HTML on the page)?
Beta Was this translation helpful? Give feedback.
All reactions