Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:let searchID="searchbox",filteredTableContainerSelector="#table_1",inputParentSelector="#search";filteredTableContainerSelector="#savedFilters",inputParentSelector="td.wizardInstruction";let iframe=document.querySelector("#main-workspace")||null;const FrameWorkSpaceID="#frameWorkspace";main=iframe?(iiframe=(main=iframe.contentDocument||iframe.contentWindow.document).querySelector(FrameWorkSpaceID)).contentDocument||iiframe.contentWindow.document:document.querySelector(FrameWorkSpaceID).contentDocument;let filter_list_iframe=main.querySelector("#filterList"),fli=filter_list_iframe.contentDocument||filter_list_iframe.contentWindow.document,searchInput=main.createElement("input");searchInput.setAttribute("id",searchID);let boxContainer=main.querySelector(inputParentSelector);boxContainer.appendChild(searchInput);let filteredTableContainers=fli.querySelectorAll("table"),box=main.querySelector("#"+searchID);function highlight(e,t){e.querySelectorAll("tbody tr").forEach(e=>{e.textContent.toLowerCase().includes(t.toLowerCase())?(e.style.display="",e.style.backgroundColor="yellow"):e.style.display="none"})}box.addEventListener("keyup",function(e){[...filteredTableContainers].forEach(e=>{highlight(e,this.value)})}),[...filteredTableContainers].forEach(e=>{[...e.querySelectorAll("img")].forEach(e=>{e.click()})});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement