Last active
August 3, 2025 16:29
-
-
Save knbknb/fe6a6403abf4b9e7c1960dd14d20a69a to your computer and use it in GitHub Desktop.
Revisions
-
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ // this works in the browser console, // when the modal dialog is visible // after clicking on the "i" button for a frontendusergroup function filterTableRows(tableDiv) { if (!tableDiv) { console.error(`selector 'div.table-fit' not found!`); return; } const table = tableDiv.querySelector('table'); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // this works in the browser console, // when the modal dialog is visible // after clicking on the "i" button for a frontendusergroup function filterTableRows(tableDiv) { if (!tableDiv) { console.error(`selector 'div.table-fit' not found!`); return; } const table = tableDiv.querySelector('table'); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ // this works in the browser console, // when the modal dialog is visible // function filterTableRows(tableDiv) { if (!tableDiv) { console.error(`selector 'div.table-fit' not found!`); return; } const table = tableDiv.querySelector('table'); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 43 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,43 @@ function filterTableRows(tableDiv) { if (!tableDiv) { console.error(`selector 'div.table-fit' not found!`); return; } const table = tableDiv.querySelector('table'); if (!table) { console.error(`table contains no data`); return; } const headers = table.querySelectorAll('thead th'); let fieldColIndex = -1; if (!headers) { console.error(`table contains no headers`); return; } headers.forEach((th, index) => { if (th.textContent.trim() === 'Field') { fieldColIndex = index; } }); if (fieldColIndex === -1) { console.error(`table contains no 'Field' column`); return; } const rows = table.querySelectorAll('tbody tr'); rows.forEach(row => { const cells = row.querySelectorAll('td'); if (cells.length > fieldColIndex) { const fieldValue = cells[fieldColIndex].textContent.trim(); if (fieldValue !== 'Groups') { row.remove(); } } }); } function selectIFrame(sel) { // Access the iframe and apply the function const iframe = document.querySelector(sel); if (iframe) { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; const tableDivs = iframeDocument.querySelectorAll('div.table-fit'); if (tableDivs && tableDivs.length > 0) { filterTableRows(tableDivs[1]); } } } selectIFrame('iframe[name="modal_frame"]'); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ function filterTableRows(selector = 'div.table-fit table.table-striped') { //const table = tableDiv.querySelector('table.table-striped'); //if (!table) { console.error(`table contains no data`); return; } const headers = tableDiv.querySelectorAll('thead th'); let fieldColIndex = -1; if (!headers) { console.error(`table contains no headers`); return; } headers.forEach((th, index) => { -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ // Define the filterTableRows function function filterTableRows(selector = 'div.table-fit table.table-striped') { const tableDiv = document.querySelector(selector); if (!tableDiv) { console.error(`selector '${selector}' not found!`); return; } //const table = tableDiv.querySelector('table.table-striped'); //if (!table) { console.error(`table contains no data`); return; } const headers = table.querySelectorAll('thead th'); let fieldColIndex = -1; -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ function filterTableRows(selector = 'div.table-fit') { const tableDiv = document.querySelector(selector); if (!tableDiv) { console.error(`selector '${selector}' not found!`); return; } const table = tableDiv.querySelector('table.table-striped'); if (!table) { console.error(`table contains no data`); return; } const headers = table.querySelectorAll('thead th'); @@ -33,7 +33,7 @@ function selectIFrame(){ if (iframe) { //iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; filterTableRows.call(iframeDocument, 'div.table-fit'); //}; } else { console.error('Iframe not found!'); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function selectIFrame(){ if (iframe) { //iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; filterTableRows.call(iframeDocument, 'div.table-striped.table-fit'); //}; } else { console.error('Iframe not found!'); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function selectIFrame(){ if (iframe) { //iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; filterTableRows.call(iframeDocument, 'div.table-stripedtable-fit'); //}; } else { console.error('Iframe not found!'); -
knbknb revised this gist
Jan 16, 2025 . No changes.There are no files selected for viewing
-
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,10 +31,10 @@ function selectIFrame(){ // Access the iframe and apply the function const iframe = document.querySelector('iframe[name="modal_frame"]'); if (iframe) { //iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; filterTableRows.call(iframeDocument, 'div.table-fit'); //}; } else { console.error('Iframe not found!'); } -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 14 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,13 +27,17 @@ function filterTableRows(selector = 'div.table-fit') { }); } function selectIFrame(){ // Access the iframe and apply the function const iframe = document.querySelector('iframe[name="modal_frame"]'); if (iframe) { iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; filterTableRows.call(iframeDocument, 'div.table-fit'); }; } else { console.error('Iframe not found!'); } } selectIFrame(); -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function filterTableRows(selector = 'div.table-fit') { } // Access the iframe and apply the function let iframe = document.querySelector('iframe[name="modal_frame"]'); if (iframe) { iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; -
knbknb revised this gist
Jan 16, 2025 . 1 changed file with 39 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,39 @@ // Define the filterTableRows function function filterTableRows(selector = 'div.table-fit') { const tableDiv = document.querySelector(selector); if (!tableDiv) { console.error(`selector '${selector}' not found!`); return; } const table = tableDiv.querySelector('table'); if (!table) { console.error(`table contains no data`); return; } const headers = table.querySelectorAll('thead th'); let fieldColIndex = -1; if (!headers) { console.error(`table contains no headers`); return; } headers.forEach((th, index) => { if (th.textContent.trim() === 'Field') { fieldColIndex = index; } }); if (fieldColIndex === -1) { console.error(`table contains no 'Field' column`); return; } const rows = table.querySelectorAll('tbody tr'); rows.forEach(row => { const cells = row.querySelectorAll('td'); if (cells.length > fieldColIndex) { const fieldValue = cells[fieldColIndex].textContent.trim(); if (fieldValue !== 'Groups') { row.remove(); } } }); } // Access the iframe and apply the function const iframe = document.querySelector('iframe[name="modal_frame"]'); if (iframe) { iframe.onload = function() { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; filterTableRows.call(iframeDocument, 'div.table-fit'); }; } else { console.error('Iframe not found!'); } -
knbknb created this gist
Jan 16, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@