diff --git a/amanuensis/lexicon/gameloop.py b/amanuensis/lexicon/gameloop.py index 9c2feda..15b4972 100644 --- a/amanuensis/lexicon/gameloop.py +++ b/amanuensis/lexicon/gameloop.py @@ -46,7 +46,9 @@ def get_player_drafts( return drafts -def get_draft(lexicon: LexiconModel, aid: str) -> Optional[ReadOnlyOrderedDict]: +def get_draft( + lexicon: LexiconModel, + aid: str) -> Optional[ReadOnlyOrderedDict]: """ Loads an article from its id """ diff --git a/amanuensis/resources/editor.js b/amanuensis/resources/editor.js index 4862d8a..2205561 100644 --- a/amanuensis/resources/editor.js +++ b/amanuensis/resources/editor.js @@ -18,7 +18,9 @@ window.onload = function() { // Kill noscript message first document.getElementById("preview").innerHTML = "
"; - onContentChange(0); + if (document.body.contains(document.getElementById("editor-content"))) { + onContentChange(0); + } }; function buildArticleObject() { @@ -77,7 +79,8 @@ function updatePreview(response) { } var warning = ""; for (var i = 0; i < response.warning.length; i++) { - warning += "