init: function(editor) {
editor.addCommand( 'inlinesave', {
exec: function (editor) {
- var pagename = window.location.pathname.replace(/^\//, '') || 'index';
+ var pagename = window.location.pathname.replace(/^\/(?:\.html)?/, '') || 'index';
var data = 'page='+encodeURIComponent(pagename)+'&body='+encodeURIComponent(editor.getData());
ajaxpost = new XMLHttpRequest();
ajaxpost.open('POST', '/edit.php', true);
config.allowedContent = true;
config.entities = false; // keep unicode
config.filebrowserImageUploadUrl = '/edit.php?type=img';
+ config.forcePasteAsPlainText = true;
config.toolbar = [
['Inlinesave', '-', 'ShowBlocks', 'Sourcedialog', '-', 'Undo', 'Redo'],
['Format'],
var pagebody = document.getElementsByClassName('article')[0];
pagebody.setAttribute('contenteditable', 'true');
+document.body.className = 'edit';
+