edit: move contents editor to subdirectory
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 12 Jul 2018 19:46:01 +0000 (21:46 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 16 Jul 2018 05:40:12 +0000 (07:40 +0200)
Clear /edit root to allow for other pages without path conflicts.

edit/page.js [moved from edit.js with 95% similarity]
edit/page/index.php [moved from edit/index.php with 100% similarity]
page.inc.php

similarity index 95%
rename from edit.js
rename to edit/page.js
index 5384f2c9eea1039ad6109f95236b85fa78dd45a0..e40b376ac89a8f34e7fb16071fcba569662e9319 100644 (file)
--- a/edit.js
@@ -16,8 +16,8 @@ CKEDITOR.plugins.add('inlinesave', {
                                body = body.replace(/<p>(\[\[.*\]\])<\/p>/g, '$1');
 
                                var data = 'body='+encodeURIComponent(body);
-                               ajaxpost = new XMLHttpRequest();
-                               ajaxpost.open('POST', '/edit'+pagename, true);
+                               var ajaxpost = new XMLHttpRequest();
+                               ajaxpost.open('POST', '/edit/page'+pagename, true);
                                ajaxpost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                                ajaxpost.onreadystatechange = function () {
                                        if (ajaxpost.readyState != 4)
@@ -80,8 +80,8 @@ CKEDITOR.on('instanceCreated', function (event) {
                config.format_tags = 'h2;h3;h4;p';
                config.allowedContent = true;
                config.entities = false; // keep unicode
-               config.filebrowserImageUploadUrl = '/edit?output=ckescript';
-               config.uploadUrl = '/edit?output=ckjson';
+               config.filebrowserImageUploadUrl = '/edit/page?output=ckescript';
+               config.uploadUrl = '/edit/page?output=ckjson';
                config.image2_alignClasses = ['left', 'center', 'right'];
                config.image2_disableResizer = true;
                config.stylesSet = [
similarity index 100%
rename from edit/index.php
rename to edit/page/index.php
index 7d93a222818511c2113342e0355e181e87ad1d72..1253338db4707fe6f56e4f6ff424c628242ad678 100644 (file)
@@ -56,7 +56,7 @@ register_shutdown_function(function () {
                        $ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback
                }
                printf('<script src="%s"></script>'."\n", "$ckesrc/ckeditor.js");
-               print '<script src="/edit.js"></script>'."\n";
+               print '<script src="/edit/page.js"></script>'."\n";
        }
 
        print "</body></html>\n";