- 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';
+ editlink.style.fontWeight = 'bold';
+ editlink.href = '';
+ editlink.onclick = undefined;
+ pagebody.setAttribute('contenteditable', true);
+ pagebody.innerHTML = pagebody.innerHTML
+ .replace(/<!--BLOCK ([a-z]*)-->[^]*?<!--\/-->/g, '[[$1]]');
+ CKEDITOR.inline(pagebody);
+ document.body.className = 'edit';