init: function(editor) {
editor.addCommand( 'inlinesave', {
exec: function (editor) {
init: function(editor) {
editor.addCommand( 'inlinesave', {
exec: function (editor) {
- var pagename = window.location.pathname.replace(/^\/(?:\.html)?/, '') || 'index';
- var data = 'page='+encodeURIComponent(pagename)+'&body='+encodeURIComponent(editor.getData());
+ var pagename = window.location.pathname.replace(/\.html$/, '').replace(/\/$/, '/index');
+ var data = 'body='+encodeURIComponent(editor.getData());
ajaxpost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxpost.onreadystatechange = function () {
if (ajaxpost.readyState != 4)
return; // not done yet
if (ajaxpost.status != 200)
alert('Foutcode '+ajaxpost.status+' bij opslaan: '+ajaxpost.responseText);
ajaxpost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxpost.onreadystatechange = function () {
if (ajaxpost.readyState != 4)
return; // not done yet
if (ajaxpost.status != 200)
alert('Foutcode '+ajaxpost.status+' bij opslaan: '+ajaxpost.responseText);
editor.ui.addButton( 'Inlinesave', {
command: 'inlinesave',
label: editor.lang.save.toolbar,
editor.ui.addButton( 'Inlinesave', {
command: 'inlinesave',
label: editor.lang.save.toolbar,