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

From version 6.1
edited by XWikiGuest
on 2026/03/11 20:30
Change comment: There is no comment for this version
To version 7.1
edited by XWikiGuest
on 2026/03/11 20:31
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -134,17 +134,36 @@
134 134   var total = data.count || 0;
135 135   var archiveCount = 0;
136 136   var container = document.getElementById('ldsf-bookmarks');
137 - var html = '<ul>';
138 - (data.results || []).forEach(function(bm, idx) {
137 + var ul = document.createElement('ul');
138 +
139 + (data.results || []).forEach(function(bm) {
139 139   var title = bm.title || bm.website_title || bm.url;
140 140   var fname = ldsfFindArchive(bm.url);
141 - if (fname) { archiveCount++; ldsf_archiveMap[idx] = fname; }
142 - html += '<li>';
143 - if (fname) html += '<button class="sf-btn" onclick="ldsfOpen(' + idx + ')" title="Archief bekijken">&#128196;</button>';
144 - html += '<a href="' + bm.url + '" target="_blank">' + title + '</a></li>';
142 + if (fname) archiveCount++;
143 +
144 + var li = document.createElement('li');
145 +
146 + if (fname) {
147 + var btn = document.createElement('button');
148 + btn.className = 'sf-btn';
149 + btn.title = 'Archief bekijken';
150 + btn.textContent = '\uD83D\uDCC4';
151 + btn.addEventListener('click', (function(f) {
152 + return function() { ldsfShowArchive(f); };
153 + })(fname));
154 + li.appendChild(btn);
155 + }
156 +
157 + var a = document.createElement('a');
158 + a.href = bm.url;
159 + a.target = '_blank';
160 + a.textContent = title;
161 + li.appendChild(a);
162 + ul.appendChild(li);
145 145   });
146 - html += '</ul>';
147 - container.innerHTML = html;
164 +
165 + container.innerHTML = '';
166 + container.appendChild(ul);
148 148   document.getElementById('ldsf-status').textContent = total + ' bookmarks, ' + archiveCount + ' met archief';
149 149   })
150 150   .catch(function(err) { document.getElementById('ldsf-status').textContent = 'Fout: ' + err.message; });