aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-01-23 22:26:38 +0100
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commitbee33239ed444f9724422fe5234cd79997500519 (patch)
tree67e8a675d4151ea8561f7f89cf92f8009c2a0f07 /assets
parentb8e3630f2ecd142d397b1b062a346a667bb78595 (diff)
downloadShaarli-bee33239ed444f9724422fe5234cd79997500519.tar.gz
Shaarli-bee33239ed444f9724422fe5234cd79997500519.tar.zst
Shaarli-bee33239ed444f9724422fe5234cd79997500519.zip
Fix all relative link to work with new URL
Diffstat (limited to 'assets')
-rw-r--r--assets/common/js/thumbnails-update.js2
-rw-r--r--assets/default/js/base.js10
2 files changed, 6 insertions, 6 deletions
diff --git a/assets/common/js/thumbnails-update.js b/assets/common/js/thumbnails-update.js
index b66ca3ae..060a730e 100644
--- a/assets/common/js/thumbnails-update.js
+++ b/assets/common/js/thumbnails-update.js
@@ -16,7 +16,7 @@
16 */ 16 */
17function updateThumb(ids, i, elements) { 17function updateThumb(ids, i, elements) {
18 const xhr = new XMLHttpRequest(); 18 const xhr = new XMLHttpRequest();
19 xhr.open('POST', '?do=ajax_thumb_update'); 19 xhr.open('POST', './?do=ajax_thumb_update');
20 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 20 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
21 xhr.responseType = 'json'; 21 xhr.responseType = 'json';
22 xhr.onload = () => { 22 xhr.onload = () => {
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index d5c29c69..f61cfa92 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -27,7 +27,7 @@ function findParent(element, tagName, attributes) {
27 */ 27 */
28function refreshToken() { 28function refreshToken() {
29 const xhr = new XMLHttpRequest(); 29 const xhr = new XMLHttpRequest();
30 xhr.open('GET', '?do=token'); 30 xhr.open('GET', './?do=token');
31 xhr.onload = () => { 31 xhr.onload = () => {
32 const token = document.getElementById('token'); 32 const token = document.getElementById('token');
33 token.setAttribute('value', xhr.responseText); 33 token.setAttribute('value', xhr.responseText);
@@ -546,7 +546,7 @@ function init(description) {
546 const refreshedToken = document.getElementById('token').value; 546 const refreshedToken = document.getElementById('token').value;
547 const fromtag = block.getAttribute('data-tag'); 547 const fromtag = block.getAttribute('data-tag');
548 const xhr = new XMLHttpRequest(); 548 const xhr = new XMLHttpRequest();
549 xhr.open('POST', '?do=changetag'); 549 xhr.open('POST', './?do=changetag');
550 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 550 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
551 xhr.onload = () => { 551 xhr.onload = () => {
552 if (xhr.status !== 200) { 552 if (xhr.status !== 200) {
@@ -558,8 +558,8 @@ function init(description) {
558 input.setAttribute('value', totag); 558 input.setAttribute('value', totag);
559 findParent(input, 'div', { class: 'rename-tag-form' }).style.display = 'none'; 559 findParent(input, 'div', { class: 'rename-tag-form' }).style.display = 'none';
560 block.querySelector('a.tag-link').innerHTML = htmlEntities(totag); 560 block.querySelector('a.tag-link').innerHTML = htmlEntities(totag);
561 block.querySelector('a.tag-link').setAttribute('href', `?searchtags=${encodeURIComponent(totag)}`); 561 block.querySelector('a.tag-link').setAttribute('href', `./?searchtags=${encodeURIComponent(totag)}`);
562 block.querySelector('a.rename-tag').setAttribute('href', `?do=changetag&fromtag=${encodeURIComponent(totag)}`); 562 block.querySelector('a.rename-tag').setAttribute('href', `./?do=changetag&fromtag=${encodeURIComponent(totag)}`);
563 563
564 // Refresh awesomplete values 564 // Refresh awesomplete values
565 existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag)); 565 existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag));
@@ -593,7 +593,7 @@ function init(description) {
593 593
594 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) { 594 if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
595 const xhr = new XMLHttpRequest(); 595 const xhr = new XMLHttpRequest();
596 xhr.open('POST', '?do=changetag'); 596 xhr.open('POST', './?do=changetag');
597 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 597 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
598 xhr.onload = () => { 598 xhr.onload = () => {
599 block.remove(); 599 block.remove();