nieuws: create new articles relative to page root
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 5 Aug 2018 00:28:01 +0000 (02:28 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 10 Aug 2018 23:27:44 +0000 (01:27 +0200)
Support different categories, assuming link is run from index.

nieuws/edit.js

index 3155ac0afc1ccbf344d71679c85b6b366c5462b7..6f3f54fa7856e7dc3a93072bd4c8208da0f45621 100644 (file)
@@ -8,7 +8,7 @@ editlink.onclick = function () {
        var url = today[0] + '/' + today[1] + '-' + today[2] + '-' +
                input.toLowerCase().replace(/[^a-z0-9]+/g, '-').trim();
        var title = encodeURIComponent(input.trim());
        var url = today[0] + '/' + today[1] + '-' + today[2] + '-' +
                input.toLowerCase().replace(/[^a-z0-9]+/g, '-').trim();
        var title = encodeURIComponent(input.trim());
-       window.location = '/nieuws/'+url+'?edit='+title+'#edit';
+       window.location = window.location.pathname+'/'+url+'?edit='+title+'#edit';
        return false;
 };
 document.getElementById('news').appendChild(editlink);
        return false;
 };
 document.getElementById('news').appendChild(editlink);