X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/4c23deb380856076ebe30ab8f5f2e8916c9f7096..d3ed59c2753c2babd5aa9a1c5e0109c644904ba8:/edit/page.js diff --git a/edit/page.js b/edit/page.js index 5e38383..3071844 100644 --- a/edit/page.js +++ b/edit/page.js @@ -2,7 +2,7 @@ CKEDITOR.plugins.add('inlinesave', { init: function(editor) { editor.addCommand( 'inlinesave', { exec: function (editor) { - var pagename = window.location.pathname.replace(/\/$/, '/index'); + var pagename = window.location.pathname; var body = editor.getData(); // empty line is equivalent to a paragraph break body = body.replace(/
\s*
/g, '

'); @@ -39,6 +39,7 @@ CKEDITOR.plugins.add('inlinesave', { ajaxpost.send(data); }, }); + editor.setKeystroke(CKEDITOR.CTRL + 83 /*S*/, 'inlinesave'); editor.ui.addButton( 'Inlinesave', { command: 'inlinesave', label: editor.lang.save.toolbar, @@ -160,8 +161,9 @@ if (pagebody) { editlink.href = ''; editlink.onclick = undefined; pagebody.setAttribute('contenteditable', true); - pagebody.innerHTML = pagebody.innerHTML - .replace(/[^]*?/g, '$1'); + pagebody.querySelectorAll('[data-dyn]').forEach(function (el) { + el.outerHTML = '[[' + el.getAttribute('data-dyn') + ']]'; + }); CKEDITOR.inline(pagebody, { customConfig: '' }); document.body.className = 'edit'; return false;