['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', '-', 'Anchor', 'Link'],
['HorizontalRule', 'Table', 'Image'],
];
+ config.toolbarCanCollapse = true;
+ config.floatSpacePreferRight = true;
+ config.floatSpaceDockedOffsetY = 0;
+ config.startupFocus = true;
config.disableObjectResizing = true;
document.execCommand('enableObjectResizing', false, false); // workaround in inline mode; ff bug?
});
});
-var pagebody = document.getElementsByClassName('article')[0];
-pagebody.setAttribute('contenteditable', 'true');
+ CKEDITOR.disableAutoInline = true;
-document.body.className = 'edit';
+// add edit link to menu
+var pagebody = document.getElementsByClassName('static')[0];
+if (pagebody) {
+ var editlink = document.createElement('a');
+ editlink.style.cursor = 'pointer';
+ editlink.appendChild(document.createTextNode('Wijzig'));
+ editlink.onclick = function (e) {
+ var toggled = editlink.style.fontWeight;
+ editlink.style.fontWeight = toggled ? '' : 'bold';
+ pagebody.setAttribute('contenteditable', !toggled);
+ if (toggled) {
+ for (name in CKEDITOR.instances) {
+ CKEDITOR.instances[name].destroy()
+ }
+ }
+ else {
+ CKEDITOR.inline(pagebody);
+ }
+ document.body.className = toggled ? '' : 'edit';
+ return false;
+ };
+ if (window.location.hash == '#edit') {
+ editlink.onclick();
+ }
+ document.querySelector('header ul').appendChild(editlink);
+}