aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-04-10 13:33:26 +0100
committerGravatar Gareth Coles <[email protected]>2018-04-10 13:33:26 +0100
commit36f6d3a53906ba233aedc35a11a6891f00a02547 (patch)
treef2600dfa829037375e770161dd5497c7faf1e81f /templates
parent[Wiki] Prevent page saving if there's an error (diff)
[Wiki] Improve editor preview
Also, Flake8.
Diffstat (limited to 'templates')
-rw-r--r--templates/wiki/page_edit.html14
1 files changed, 10 insertions, 4 deletions
diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html
index 661e6b36..b797577d 100644
--- a/templates/wiki/page_edit.html
+++ b/templates/wiki/page_edit.html
@@ -24,10 +24,12 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
</form>
- <h2>Preview</h2>
+ <div class="uk-container uk-container-small" style="padding: 1rem 1rem 0.1rem;">
+ <h2 id="preview-title">{{ title }}</h2>
- <div class="uk-alert" id="preview-div" style="padding: 1rem 1rem 0.1rem;">
- {{ preview | safe }}
+ <div id="preview-div">
+ {{ preview | safe }}
+ </div>
</div>
<script type="application/javascript">
@@ -85,6 +87,10 @@
clearTimeout(timer);
}
timer = setTimeout(function() {document.getElementById("preview").click()}, 1000);
- })
+ });
+
+ document.getElementById("title").oninput = function() {
+ document.getElementById("preview-title").textContent = document.getElementById("title").value;
+ }
</script>
{% endblock %} \ No newline at end of file