aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/default/js
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-06-13 13:08:01 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit9c75f877935fa6adec951a4d8d32b328aaab314f (patch)
tree1cdd09ddfc00c6cebb92bb2b90381a06fd31246d /assets/default/js
parent818b3193ffabec57501e3bdfa997206e3c0671ef (diff)
downloadShaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.gz
Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.zst
Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.zip
Use multi-level routes for existing controllers instead of 1 level everywhere
Also prefix most admin routes with /admin/
Diffstat (limited to 'assets/default/js')
-rw-r--r--assets/default/js/base.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index b428a420..9f67d980 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -463,7 +463,7 @@ function init(description) {
463 }); 463 });
464 464
465 if (window.confirm(message)) { 465 if (window.confirm(message)) {
466 window.location = `${basePath}/?delete_link&lf_linkdate=${ids.join('+')}&token=${token.value}`; 466 window.location = `${basePath}/admin/shaare/delete?id=${ids.join('+')}&token=${token.value}`;
467 } 467 }
468 }); 468 });
469 } 469 }
@@ -549,7 +549,7 @@ function init(description) {
549 const refreshedToken = document.getElementById('token').value; 549 const refreshedToken = document.getElementById('token').value;
550 const fromtag = block.getAttribute('data-tag'); 550 const fromtag = block.getAttribute('data-tag');
551 const xhr = new XMLHttpRequest(); 551 const xhr = new XMLHttpRequest();
552 xhr.open('POST', `${basePath}/manage-tags`); 552 xhr.open('POST', `${basePath}/admin/tags`);
553 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 553 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
554 xhr.onload = () => { 554 xhr.onload = () => {
555 if (xhr.status !== 200) { 555 if (xhr.status !== 200) {
@@ -566,7 +566,7 @@ function init(description) {
566 .setAttribute('href', `${basePath}/?searchtags=${encodeURIComponent(totag)}`); 566 .setAttribute('href', `${basePath}/?searchtags=${encodeURIComponent(totag)}`);
567 block 567 block
568 .querySelector('a.rename-tag') 568 .querySelector('a.rename-tag')
569 .setAttribute('href', `${basePath}/manage-tags?fromtag=${encodeURIComponent(totag)}`); 569 .setAttribute('href', `${basePath}/admin/tags?fromtag=${encodeURIComponent(totag)}`);
570 570
571 // Refresh awesomplete values 571 // Refresh awesomplete values
572 existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag)); 572 existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag));
@@ -600,7 +600,7 @@ function init(description) {
600 600
601 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) { 601 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
602 const xhr = new XMLHttpRequest(); 602 const xhr = new XMLHttpRequest();
603 xhr.open('POST', `${basePath}/manage-tags`); 603 xhr.open('POST', `${basePath}/admin/tags`);
604 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 604 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
605 xhr.onload = () => { 605 xhr.onload = () => {
606 block.remove(); 606 block.remove();