+var pagebody;
+
+function editorcontents() {
+ return document.getElementsByClassName('static')[0];
+}
+
function editorsetup() {
CKEDITOR.disableAutoInline = true;
{ name: 'Attributie', element: 'em', attributes: { 'class': 'right' } },
{ name: 'Quote', element: 'q' },
{ name: 'Gemarkeerd', element: 'span', styles: { 'background-color': 'Yellow' } },
+ { name: 'Ingelogd', element: 'span', attributes: { 'class': 'login' } },
+ { name: 'Uitgelogd', element: 'span', attributes: { 'class': 'logout' } },
{ name: 'Kadertekst', element: 'aside' },
{ name: 'Uitgelijnd', element: 'div', attributes: { 'class': 'right' } },
};
});
-var pagebody = document.getElementsByClassName('static')[0];
if (pagebody) {
// add edit link to menu
var editlink = document.querySelector('a[href="#edit"]');
editlink.style.fontWeight = 'bold';
editlink.href = '';
editlink.onclick = undefined;
+ document.body.replaceChild(pagebody, editorcontents());
pagebody.setAttribute('contenteditable', true);
pagebody.querySelectorAll('[data-dyn]').forEach(function (el) {
let blockname = el.getAttribute('data-dyn');
}
document.addEventListener('DOMContentLoaded', function (e) {
+ pagebody = editorcontents().cloneNode(true);
var editorinc = document.createElement('script');
editorinc.addEventListener('load', editorsetup);
editorinc.src = ckesrc;