Last modified by XWikiGuest on 2026/03/11 21:04

From version 2.1
edited by XWikiGuest
on 2026/03/11 20:04
Change comment: There is no comment for this version
To version 4.1
edited by XWikiGuest
on 2026/03/11 20:22
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -96,9 +96,10 @@
96 96   var LINKDING_TAG = 'Nuclear-&-Energy';
97 97   var LINKDING_COUNT = 20;
98 98  
99 - var WEBDAV_BASE = 'https://cloud.rhebergen.org/remote.php/dav/files/jan_rhebergen/SingleFile-Archives/';
99 + var SHARE_TOKEN = 'eT2X9ttBHK5GoEY';
100 + var WEBDAV_BASE = 'https://cloud.rhebergen.org/public.php/webdav/';
100 100   var INDEX_URL = WEBDAV_BASE + 'index.json';
101 - var NC_AUTH = 'Basic amFuX3JoZWJlcmdlbjpAWnMzUUwkJmZ4TVE=';
102 + var NC_AUTH = 'Basic ' + btoa(SHARE_TOKEN + ':');
102 102  
103 103   var urlToFile = {}; // reverse map: URL -> filename
104 104   var archiveMap = {}; // button index -> filename
... ... @@ -154,15 +154,20 @@
154 154   container.innerHTML = html;
155 155   document.getElementById('ldsf-status').textContent = total + ' bookmarks, ' + archiveCount + ' met archief';
156 156  
157 - // Event delegation for archive buttons
158 - container.addEventListener('click', function(e) {
159 - var btn = e.target.closest('.sf-btn');
160 - if (!btn) return;
161 - var idx = btn.getAttribute('data-idx');
162 - if (idx !== null && archiveMap[idx]) {
163 - ldsfShowArchive(archiveMap[idx], btn);
164 - }
165 - });
158 + // Bind click handlers directly to buttons
159 + var buttons = container.querySelectorAll('.sf-btn');
160 + for (var b = 0; b < buttons.length; b++) {
161 + (function(btn) {
162 + var idx = btn.getAttribute('data-idx');
163 + btn.addEventListener('click', function(ev) {
164 + ev.preventDefault();
165 + ev.stopPropagation();
166 + if (archiveMap[idx]) {
167 + ldsfShowArchive(archiveMap[idx], btn);
168 + }
169 + });
170 + })(buttons[b]);
171 + }
166 166   })
167 167   .catch(function(err) {
168 168   document.getElementById('ldsf-status').textContent = 'Fout: ' + err.message;