page: route requests through global php handler
[minimedit.git] / edit.js
diff --git a/edit.js b/edit.js
index dee103855135dca7f4ddd251a02cb1f9355eb820..6f9211eea2f18f8863436634ddf18d35cb172516 100644 (file)
--- a/edit.js
+++ b/edit.js
@@ -2,10 +2,10 @@ CKEDITOR.plugins.add('inlinesave', {
        init: function(editor) {
                editor.addCommand( 'inlinesave', {
                        exec: function (editor) {
-                               var pagename = window.location.pathname.replace(/\.php$/, '').replace(/\/$/, '/index');
+                               var pagename = window.location.pathname.replace(/\/$/, '/index');
                                var data = 'body='+encodeURIComponent(editor.getData());
                                ajaxpost = new XMLHttpRequest();
-                               ajaxpost.open('POST', '/edit.php'+pagename, true);
+                               ajaxpost.open('POST', '/edit'+pagename, true);
                                ajaxpost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                                ajaxpost.onreadystatechange = function () {
                                        if (ajaxpost.readyState != 4)
@@ -46,7 +46,7 @@ CKEDITOR.on('instanceCreated', function (event) {
                config.format_tags = 'h2;h3;h4;p';
                config.allowedContent = true;
                config.entities = false; // keep unicode
-               config.filebrowserImageUploadUrl = '/edit.php?type=img';
+               config.filebrowserImageUploadUrl = '/edit?type=img';
                config.forcePasteAsPlainText = true;
                config.contentsCss = '/excelsior.css';
                config.toolbar = [