diff --git a/verse/start.py b/verse/start.py index 6c5e62f..1430bf6 100644 --- a/verse/start.py +++ b/verse/start.py @@ -201,6 +201,15 @@ def editor(): editorform = EditorForm() current_distribusi = CurrentDistribusi() files_uploaded = IsZipUploaded(current_distribusi) + cssplaceholder = "Try out your CSS here" + with open('themes/editor/placeholder.css') as f: + cssplaceholder = f.read() + editorform.css.data = cssplaceholder + + htmlplaceholder = "Write some test HTML here" + with open('themes/editor/placeholder.html') as f: + htmlplaceholder = f.read() + print(htmlplaceholder) if editorform.validate_on_submit(): userfolder = os.path.join("stash", current_distribusi) cssfilename = "{}.css".format(editorform.cssname.data) @@ -212,6 +221,7 @@ def editor(): "editor.html", files_uploaded=files_uploaded, editorform=editorform, + htmlplaceholder=htmlplaceholder, ) return template diff --git a/verse/static/js/editorupdate.js b/verse/static/js/editorupdate.js index 5573d72..a6cdca1 100644 --- a/verse/static/js/editorupdate.js +++ b/verse/static/js/editorupdate.js @@ -9,6 +9,11 @@ document.body.onkeyup = function(){ code.writeln(html.value+""); code.close(); }; +document.addEventListener("DOMContentLoaded", function(){ + code.open(); + code.writeln(html.value+""); + code.close(); +}); }; update(); diff --git a/verse/templates/editor.html b/verse/templates/editor.html index 4346feb..c41da2d 100644 --- a/verse/templates/editor.html +++ b/verse/templates/editor.html @@ -4,7 +4,9 @@
Write some test HTML here+ +