diff options
-rw-r--r-- | help3/xhpeditor/menu.php | 2 | ||||
-rw-r--r-- | help3/xhpeditor/xhp2html.js | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/help3/xhpeditor/menu.php b/help3/xhpeditor/menu.php index f9153849..ecfb4d80 100644 --- a/help3/xhpeditor/menu.php +++ b/help3/xhpeditor/menu.php @@ -118,7 +118,7 @@ <div class="dropdown"> <button class="dropbtn">Tools</button> <div class="dropdown-content"> - <input type="submit" form="CMtextarea" name="render_page" value="Render page"/> + <input type="submit" form="CMtextarea" id="render_page" name="render_page" value="Render page"/> <input type="submit" form="CMtextarea" name="get_patch" value="Generate patch"/> <input type="submit" form="CMtextarea" name="check_xhp" value="Check XHP"/> <input type="submit" form="CMtextarea" name="open_master" value="Open Master"/> diff --git a/help3/xhpeditor/xhp2html.js b/help3/xhpeditor/xhp2html.js index d92fb14c..930b451b 100644 --- a/help3/xhpeditor/xhp2html.js +++ b/help3/xhpeditor/xhp2html.js @@ -37,6 +37,9 @@ var editor = CodeMirror.fromTextArea(document.getElementById("xhpeditor"), { hintOptions: {schemaInfo: this.xhptags} }); +const height = window.innerHeight - document.getElementById('editorpageheader').offsetHeight - 16; +editor.setSize(null, height); + function readSingleFile(e) { var file = e.target.files[0]; @@ -48,6 +51,12 @@ function readSingleFile(e) { var contents = e.target.result; editor.doc.setValue(contents); }; + + // Refresh preview when load hasd ended + reader.onloadend = function(e) { + document.getElementById("render_page").click(); + } + reader.readAsText(file); } |