plutopluto

git clone https://git.ce9e.org/plutopluto.git

commit
3179d1db47afea85b3ee7d9837b6008607611704
parent
71ab6ac0f664c0f73306cc787ee00a80abf55d2b
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-12-21 10:54
allow to overwrite config with URL parameters

Diffstat

M plutopluto/static/plutopluto.js 12 +++++++++++-

1 files changed, 11 insertions, 1 deletions


diff --git a/plutopluto/static/plutopluto.js b/plutopluto/static/plutopluto.js

@@ -66,7 +66,17 @@ var fetchJSON = function(url) {
   66    66 	});
   67    67 };
   68    68 
   69    -1 fetchJSON('/config').then(config => {
   -1    69 var getConfig = function() {
   -1    70 	var q = new URLSearchParams(location.search);
   -1    71 	var urls = q.getAll('url');
   -1    72 	if (urls.length) {
   -1    73 		return Promise.resolve({'urls': urls});
   -1    74 	} else {
   -1    75 		return fetchJSON('/config');
   -1    76 	}
   -1    77 }
   -1    78 
   -1    79 getConfig().then(config => {
   70    80 	var entries = [];
   71    81 	var page = 0;
   72    82