edit: rooted links to support subdirectories
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 15 Jul 2014 20:47:51 +0000 (22:47 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 16 Jul 2014 12:07:25 +0000 (14:07 +0200)
edit.js
edit.php

diff --git a/edit.js b/edit.js
index 95a512efb776fca604edacf4dd986493f8e1b2c8..784e370913d1a24d9547d08bb6d7bb0cec367dd5 100644 (file)
--- a/edit.js
+++ b/edit.js
@@ -5,7 +5,7 @@ CKEDITOR.plugins.add('inlinesave', {
                                var pagename = window.location.pathname.replace(/^\//, '') || 'index';
                                var data = 'page='+encodeURIComponent(pagename)+'&body='+encodeURIComponent(editor.getData());
                                ajaxpost = new XMLHttpRequest();
-                               ajaxpost.open('POST', 'edit.php', true);
+                               ajaxpost.open('POST', '/edit.php', true);
                                ajaxpost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                                ajaxpost.onreadystatechange = function () {
                                        if (ajaxpost.readyState != 4)
@@ -50,7 +50,7 @@ CKEDITOR.on('instanceCreated', function (event) {
                        ['Inlinesave', '-', 'ShowBlocks', 'Sourcedialog', '-', 'Undo', 'Redo'],
                        ['Format'],
                        ['BulletedList', 'NumberedList', '-', 'Blockquote'],
-                       ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Link'],
+                       ['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', '-', 'Link'],
                        ['HorizontalRule', 'Table', 'Image'],
                ];
 
index 398581e1e7c6ffbf3578e6b0296f63aa1b844af8..657c2790e570a841011790204097be7170ab2e4d 100644 (file)
--- a/edit.php
+++ b/edit.php
@@ -14,8 +14,8 @@ $filename = preg_replace('/(?:\.html)?$/', '.html', ltrim($_POST['page'], '/'),
 if (file_exists($filename) and !is_writable($filename))
        abort('403 input error', "ongeldige bestandsnaam: $filename");
 
-$prepend = '<!--#include virtual="common.html" -->'."\n\n";
-$append  = "\n".'<!--#include virtual="footer.html" -->'."\n";
+$prepend = '<!--#include virtual="/common.html" -->'."\n\n";
+$append  = "\n".'<!--#include virtual="/footer.html" -->'."\n";
 $upload = $_POST['body'];
 
 if (!$upload)