-var pagebody = document.getElementsByClassName('article')[0];
-pagebody.setAttribute('contenteditable', 'true');
+ CKEDITOR.disableAutoInline = true;
+
+// add edit link to menu
+var pagebody = document.getElementsByClassName('static')[0];
+if (pagebody) {
+ var editlink = document.querySelector('a[href="#edit"]');
+ editlink.onclick = function (e) {
+ editlink.style.fontWeight = 'bold';
+ editlink.href = '';
+ editlink.onclick = undefined;
+ pagebody.setAttribute('contenteditable', true);
+ pagebody.innerHTML = pagebody.innerHTML
+ .replace(/<!--BLOCK:([^-]*)-->[^]*?<!--\/-->/g, '$1');
+ CKEDITOR.inline(pagebody);
+ document.body.className = 'edit';
+ return false;
+ };
+ if (window.location.hash == '#edit') {
+ editlink.onclick();
+ }
+}