X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/04e89a24082f7c2516001f947c47481cb0b56055..a7cf507fa0aa8b275979dbe98d3d0ef34fa7f05a:/edit/page.js diff --git a/edit/page.js b/edit/page.js index 21ec6b4..3101ea1 100644 --- a/edit/page.js +++ b/edit/page.js @@ -19,7 +19,7 @@ CKEDITOR.plugins.add('inlinesave', { // empty line is equivalent to a paragraph break body = body.replace(/
\s*
/g, '

'); // keep names and preceding abbreviations together - body = body.replace(/\b((?:dhr|mw|me?vr|mr?s?)\.)\s+(?=[A-Z])/ig, '$1 '); + body = body.replace(/\b((?:[Dd]hr|[Mm](?:w|e?vr|r|r?ss?)|[A-Z])\.)\s+(?=[A-Zdtv])/g, '$1 '); // wrap long line after each sentence body = body.replace(/^(\t*).{73,}/mg, function (line, indent) { var dots = '(?:.{24,72}|.{73,}?)'; // chars before punctuation @@ -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, @@ -119,7 +119,7 @@ CKEDITOR.on('instanceCreated', function (event) { var config = editor.config; config.language = 'nl'; config.extraPlugins = 'inlinesave,placeholder,image2,uploadimage'; - config.removePlugins = 'image'; // conflicts with image2 + config.removePlugins = 'image,exportpdf'; // conflicts with imag2 config.allowedContent = { $1: { elements: CKEDITOR.dtd, @@ -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;