|
Tags: Blanking Manual revert |
| (21 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| <htmltag tagname="script" type="text/javascript">
| |
| document.addEventListener('DOMContentLoaded', function() {
| |
| console.log('Debug: JS script is running!'); // This confirms the JS is executing
| |
|
| |
|
| // Optional visible confirmation on the page
| |
| var debugNotice = document.createElement('div');
| |
| debugNotice.innerText = 'Debug: JS script is running!';
| |
| debugNotice.style.color = 'red';
| |
| debugNotice.style.fontWeight = 'bold';
| |
| debugNotice.style.margin = '10px 0';
| |
| document.body.appendChild(debugNotice);
| |
|
| |
| (function() {
| |
| var ids = ['Sandbox1','Sandbox2','Sandbox3'];
| |
|
| |
| // Create table
| |
| var table = document.createElement('table');
| |
| table.style.borderCollapse = 'collapse';
| |
| table.style.margin = '10px 0';
| |
| table.style.width = '300px';
| |
|
| |
| // Table header
| |
| var header = table.insertRow();
| |
| ['ID','Checkbox State','Timestamp'].forEach(function(text) {
| |
| var th = document.createElement('th');
| |
| th.innerText = text;
| |
| th.style.border = '1px solid black';
| |
| th.style.padding = '4px';
| |
| th.style.textAlign = 'center';
| |
| th.style.fontWeight = 'bold';
| |
| header.appendChild(th);
| |
| });
| |
|
| |
| // Fill rows
| |
| ids.forEach(function(id) {
| |
| var row = table.insertRow();
| |
|
| |
| // ID
| |
| var cellId = row.insertCell();
| |
| cellId.innerText = id;
| |
| cellId.style.border = '1px solid black';
| |
| cellId.style.padding = '4px';
| |
|
| |
| // Checkbox state
| |
| var cellCheckbox = row.insertCell();
| |
| cellCheckbox.innerText = localStorage.getItem(id) || '(none)';
| |
| cellCheckbox.style.border = '1px solid black';
| |
| cellCheckbox.style.padding = '4px';
| |
| cellCheckbox.style.textAlign = 'center';
| |
|
| |
| // Timestamp
| |
| var cellTs = row.insertCell();
| |
| cellTs.innerText = localStorage.getItem(id + '-ts') || '(none)';
| |
| cellTs.style.border = '1px solid black';
| |
| cellTs.style.padding = '4px';
| |
| cellTs.style.textAlign = 'center';
| |
| });
| |
|
| |
| // Append table to the end of the page content
| |
| document.body.appendChild(table);
| |
| })();
| |
| });
| |
| </htmltag>
| |