Viewing File: /home/fshjisk/myqueen/wp-content/plugins/string-locator/build/string-locator-replace.js
!function(){"use strict";document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("string-locator-replace-new-string"),t=document.getElementById("string-locator-replace-loopback-check"),n=document.getElementById("string-locator-toggle-replace-controls"),r=document.getElementById("string-locator-replace-form"),c=document.getElementById("string-locator-replace-form"),o=document.getElementById("string-locator-search-results-table"),a=document.getElementById("string-locator-search-notices"),l=document.getElementById("string-locator-progress-wrapper"),s=document.getElementById("string-locator-search-progress"),i=document.getElementById("string-locator-feedback-text"),d=document.getElementById("string-locator-string"),g=document.getElementById("string-locator-regex"),p=document.getElementById("string-locator-replace-button-all"),u=document.getElementById("string-locator-replace-button-selected"),m=wp.template("string-locator-replace-error");let y,E,f=!1,h=!1;function b(n){const r=new FormData,c={...y[n].dataset};if(s.value=n,h||y[n].getElementsByClassName("check-column-box")[0].checked){r.append("_wpnonce",stringLocatorReplace.rest_nonce),r.append("replace_nonce",stringLocatorReplace.replace_nonce),r.append("replace_string",e.value),r.append("search_string",d.value),r.append("search_regex",g.checked),r.append("replace_loopback",t.checked);for(const e in c)r.append(e,c[e]);fetch(stringLocatorReplace.url.replace,{method:"POST",body:r}).then((e=>e.json())).then((function(e){null!=e&&e.success?(E=y[n].getElementsByTagName("td")[0],!0!==e.data.replace_string&&(E.innerHTML=e.data.replace_string),n<y.length-1?b(n+1):(l.style.display="none",h=!1)):B(e)})).catch((function(e){B(e)}))}else n<y.length-1?b(n+1):(l.style.display="none",h=!1)}function B(e){a.style.display="block",l.style.display="none",h=!1,a.innerHTML+=m(e)}function L(){if(!f)return p.dispatchEvent(new Event("click")),!1;y=o.getElementsByTagName("tbody")[0].getElementsByTagName("tr"),l.style.display="block",i.innerText=stringLocatorReplace.string.replace_started,a.innerHTML="",s.value=0,s.setAttribute("max",y.length),f=!1,b(0)}c.addEventListener("submit",(function(e){return e.preventDefault(),L(),!1})),p.addEventListener("click",(function(){if(!confirm(stringLocatorReplace.string.confirm_all))return!1;h=!0,f=!0,L()})),u.addEventListener("click",(function(){h=!1,f=!0,L()})),n.addEventListener("click",(function(){r.classList.toggle("visible"),r.classList.contains("visible")?(n.setAttribute("aria-expanded","true"),n.innerText=stringLocatorReplace.string.button_hide):(n.setAttribute("aria-expanded","false"),n.innerText=stringLocatorReplace.string.button_show)}))}))}();
Back to Directory
File Manager