freedowsRoO Posted March 2, 2020 Share Posted March 2, 2020 Hello! I am trying to use a text editor in my application but I am not getting it, i don't know what the best place to declare the scripts because they need to be before my DIV. My HTML code is this: <!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://cdn.quilljs.com/1.3.6/quill.snow.css'> <link rel="stylesheet" href="./style.css"> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script> </head> <body> <div id="editor-container"> </div> <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script> <script src="./script.js"></script> </body> </html> I need to make the HTML above works in UNIGUI, I'm putting the following lines inside: ServerModule> Custom Files <link rel='stylesheet' href='https://cdn.quilljs.com/1.3.6/quill.snow.css'> files/style.css And the following lines inside: HTMLFrame > HTML <div id="editor-container"> </div> <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script> <script src="files/script.js"></script> I'm trying a lot of things and nothing works. I guess the problem is in the HTMLFrame because when i look the code by pressing F12 the scripts: <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script> <script src="files/script.js"></script> Doesn't appears in the code. Thanks in advance. The HTML project with the editor: .editor.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 2, 2020 Share Posted March 2, 2020 3 minutes ago, freedowsRoO said: I'm putting the following lines inside: ServerModule> Custom Files <link rel='stylesheet' href='https://cdn.quilljs.com/1.3.6/quill.snow.css'> <link rel="stylesheet" href="./style.css"> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script> Hi, In CustomFiles: https://cdn.quilljs.com/1.3.6/quill.snow.css files/style.css 1 Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted March 2, 2020 Author Share Posted March 2, 2020 6 minutes ago, Sherzod said: Hi, In CustomFiles: https://cdn.quilljs.com/1.3.6/quill.snow.css files/style.css Thanks sherzod but not work yet. My CustomFiles: https://cdn.quilljs.com/1.3.6/quill.snow.css files/style.css My HTML: <div id="editor-container"> </div> <script src='https://cdn.quilljs.com/1.3.6/quill.js'></script> <script src="files/script.js"></script> My unigui test project: EmailBI.rar Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted March 2, 2020 Author Share Posted March 2, 2020 The <script> tag need's to below the DIV and UNIGUI put the tag after the <HEAD> tag. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 2, 2020 Share Posted March 2, 2020 8 minutes ago, freedowsRoO said: The <script> tag need's to below the DIV and UNIGUI put the tag after the <HEAD> tag. OK, try this: 1. CustomFiles: https://cdn.quilljs.com/1.3.6/quill.snow.css files/style.css https://cdn.quilljs.com/1.3.6/quill.js 2. UniHTMLFrame1.HTML = <div id="editor-container"> </div> 3. UniHTMLFrame1.AfterScript = var Delta = Quill.import('delta'); var quill = new Quill('#editor-container', { modules: { toolbar: true }, placeholder: 'Compose an epic...', theme: 'snow' }); // Store accumulated changes var change = new Delta(); quill.on('text-change', function(delta) { change = change.compose(delta); }); // Save periodically setInterval(function() { if (change.length() > 0) { console.log('Saving changes', change); /* Send partial changes $.post('/your-endpoint', { partial: JSON.stringify(change) }); Send entire document $.post('/your-endpoint', { doc: JSON.stringify(quill.getContents()) }); */ change = new Delta(); } }, 5*1000); // Check for unsaved data window.onbeforeunload = function() { if (change.length() > 0) { return 'There are unsaved changes. Are you sure you want to leave?'; } } 2 Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted March 2, 2020 Author Share Posted March 2, 2020 It work's! Thank you so much, again.... 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.