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);
var pagebody = document.getElementsByClassName('article')[0];
pagebody.setAttribute('contenteditable', 'true');
+document.body.className = 'edit';
+