mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
War on TODOs
Improved mermaid and photoswipe extensions, handled control-s on the edit page.
This commit is contained in:
parent
ac433c3afa
commit
c19580a23e
10 changed files with 142 additions and 61 deletions
|
|
@ -13,7 +13,7 @@ That's all there is to it - a sequence of image links just as you'd write them a
|
|||
|
||||
## The Gallery
|
||||
|
||||
This page holds another example Photoswipe gallery, this time using a simpler, Markdown-based specification. Processing this specification takes more work than the full syntax used in the other [[Example gallery]], so the gallery may be slower to load; but it's much easier to configure.
|
||||
This page holds another example Photoswipe gallery, this time using a simpler, Markdown-based specification. Processing this specification takes more work than the full syntax used in the other [[Example gallery]], so the gallery may be slower to load; but it's much easier to configure. To see it, <a href="edit?page=Simplified%20example%20gallery">edit this page.</a>
|
||||
|
||||
```pswp
|
||||

|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
{% block content %}
|
||||
<div id="content" class="edit">
|
||||
<form action="{{servlet-context}}/edit" method="POST">
|
||||
<form id="edit-form" action="{{servlet-context}}/edit" method="POST">
|
||||
{% csrf-field %}
|
||||
<input type="hidden" name="page" value="{{page}}"/>
|
||||
<textarea name="src" id="src" rows="25" cols="80">{{content}}</textarea>
|
||||
|
|
@ -21,12 +21,20 @@
|
|||
value="{%if exists%}{%else%}New file {{page}}{%endif%}" required/>
|
||||
</p>
|
||||
<p class="widget">
|
||||
<label for="submit">{% i18n save-prompt %}</label>
|
||||
<input name="submit" id="submit" type="submit" class="action" value="{% i18n save-label %}"/>
|
||||
<label for="submit-button">{% i18n save-prompt %}</label>
|
||||
<input name="submit-button" id="submit-button" type="submit" class="action" value="{% i18n save-label %}"/>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
// intercept control-S (or on Mac meta-S) and submit the form. Saves much annoyance.
|
||||
document.addEventListener("keydown", function(e) {
|
||||
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
|
||||
e.preventDefault();
|
||||
document.getElementById('edit-form').submit();
|
||||
}
|
||||
}, false);
|
||||
// initialise the editor
|
||||
var simplemde = new SimpleMDE({
|
||||
autosave: {
|
||||
enabled: true,
|
||||
|
|
|
|||
|
|
@ -17,14 +17,4 @@
|
|||
{% endif %}
|
||||
{{content|safe}}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//<![CDATA[
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
mermaid.initialize({startOnLoad:true});
|
||||
});
|
||||
}
|
||||
//]]
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue