X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/0d35ad089db9ae6b1cd619be28ddda2b2314895b..2013f7a1c3ef61a66f5b158823d19c8e6ade8886:/edit/page.js diff --git a/edit/page.js b/edit/page.js index c3ece3c..34abe36 100644 --- a/edit/page.js +++ b/edit/page.js @@ -57,7 +57,7 @@ CKEDITOR.plugins.add('inlinesave', { ajaxpost.send(data); }, }); - editor.setKeystroke(CKEDITOR.CTRL + 83 /*S*/, 'inlinesave'); + editor.setKeystroke(CKEDITOR.CTRL + 'S'.charCodeAt(0), 'inlinesave'); editor.ui.addButton( 'Inlinesave', { command: 'inlinesave', label: editor.lang.save.toolbar, @@ -217,7 +217,9 @@ if (pagebody) { var ckesrc = document.currentScript.getAttribute('data-ckesrc'); document.addEventListener('DOMContentLoaded', function (e) { - pagebody = editorcontents().cloneNode(true); + pagebody = editorcontents(); + if (!pagebody) return; + pagebody = pagebody.cloneNode(true); var editorinc = document.createElement('script'); editorinc.addEventListener('load', editorsetup); editorinc.src = ckesrc;