User:AHRtbA==/quikreplace.js

/*########################## Note: Do not edit anything below this line! if(window.location.href.indexOf("action=edit")!=-1&&document.title.indexOf("Editing")!=-1){setOnQPress;}

function setOnQPress { if (typeof(addEventListener)=="function"){ document.getElementById("wpTextbox1").addEventListener('keyup', function(event){registerKeyUp(event);}, false); document.getElementById("wpTextbox1").addEventListener('keydown', function(event){registerKeyDown(event);}, false); } else if (typeof(attachEvent)=="function"){ document.getElementById("wpTextbox1").attachEvent('onkeyup', function(event){registerKeyUp(event);}) document.getElementById("wpTextbox1").attachEvent('onkeydown', function(event){registerKeyDown(event);}); } } var ctrlDwn=false; var qDwn=false; var qROpen=false; var qRIgnoreCase=false; var qRIndex=0; var inTheMake=false; var qRCurrentFind=0; var qRFindIsUp=false; function registerKeyDown(e) {if(e.keyCode==17){ctrlDwn=true;} if(e.keyCode==81){qDwn=true;} if(ctrlDwn==true&&qDwn==true&&qROpen==false){activateQuikR;} else if(ctrlDwn==true&&qDwn==true){closeQuikR;}} function registerKeyUp(e) {if(e.keyCode==17){ctrlDwn=false;} if(e.keyCode==81){qDwn=false;} } function activateQuikR { var qRDiv=makeqRDiv; document.getElementById("editform").insertBefore(qRDiv, document.getElementById("editpage-copywarn")); document.getElementById("qFindText").focus; qROpen=true; } function makeqRSearchDiv { var tempqRSearchDiv=document.createElement("div"); tempqRSearchDiv.id="qRSearchDiv"; tempqRSearchDiv.style.overflow="scroll"; tempqRSearchDiv.style.position="absolute"; tempqRSearchDiv.style.border="1px solid #000000"; tempqRSearchDiv.style.zIndex="1"; tempqRSearchDiv.style.backgroundColor="#ffffff"; tempqRSearchDiv.style.height=document.getElementById("wpTextbox1").offsetHeight+"px"; tempqRSearchDiv.style.width=document.getElementById("wpTextbox1").offsetWidth+"px"; try{tempqRSearchDiv.style.opacity=0.7;}catch(e){} try{tempqRSearchDiv.filters.alpha.opacity=70;}catch(e){} tempqRSearchDiv.innerHTML=" Searching... Please wait... This may take up to 30 seconds to complete "; return tempqRSearchDiv; } function qRSearching { document.getElementById("qRStatus").innerHTML="Status: Searching..."; var qRSearchDiv=makeqRSearchDiv; document.getElementById("editform").insertBefore(qRSearchDiv, document.getElementById("wpTextbox1")); } function makeqRDiv { var tempqRDiv=document.createElement("div"); tempqRDiv.id="qRDiv"; tempqRDiv.style.border="1px solid #000000"; tempqRDiv.style.padding="10px"; tempqRDiv.style.backgroundColor="#66CD00"; tempqRDiv.innerHTML=" Find:  Replace:      Ignore Case Status: Idle "; return tempqRDiv; } function makeqRDoneDiv { var tempqRDoneDiv=document.createElement("div"); tempqRDoneDiv.id="qRDoneDiv"; tempqRDoneDiv.style.position="relative"; tempqRDoneDiv.style.border="1px solid #000000"; tempqRDoneDiv.style.zIndex="2"; tempqRDoneDiv.style.width=(document.getElementById("wpTextbox1").offsetWidth-10)+"px"; tempqRDoneDiv.style.top=document.getElementById("wpTextbox1").offsetHeight+"px"; tempqRDoneDiv.style.padding="5px"; tempqRDoneDiv.style.backgroundColor="#ffffff"; tempqRDoneDiv.innerHTML="I'm Done! Now quickly finish!"; return tempqRDoneDiv; } function quikReplaceAll { if(qRIgnoreCase==true){whereSearch="gi";}else{whereSearch="g";} var replaceText=new RegExp(document.getElementById("qFindText").value,whereSearch); document.getElementById("wpTextbox1").value=document.getElementById("wpTextbox1").value.replace(replaceText, document.getElementById("qReplaceText").value); } function openQuikFindNext { var qFindReplaceDiv=makeQFindReplace; var qRDoneDiv=makeqRDoneDiv; document.getElementById("editform").removeChild(document.getElementById("qRSearchDiv")); document.getElementById("editform").insertBefore(qFindReplaceDiv, document.getElementById("wpTextbox1")); document.getElementById("editform").insertBefore(qRDoneDiv, document.getElementById("wpTextbox1")); if(document.getElementsByName("qRSpan")=="undefined"){document.getElementById("qRStatus").innerHTML="Status: No results found. Idle";} else if(qRIndex>0){document.getElementsByName("qRSpan")[0].style.backgroundColor="#4F94CD";document.getElementsByName("qRSpan")[0].style.color="#ffffff";qRCurrentFind++;document.getElementById("qRStatus").innerHTML="Status: Done! "+qRIndex+" results found";qRFindIsUp=true;} } function quikFindNext { try{if(document.getElementById("qFindReplaceDiv").innerHTML){}}catch(e){openQuikFindNext;return false;} if(qRCurrentFind<(document.getElementsByName("qRSpan").length-1)) { try{document.getElementsByName("qRSpan")[(qRCurrentFind-1)].style.backgroundColor="#ffffff";document.getElementsByName("qRSpan")[(qRCurrentFind-1)].style.color="#000000";}catch(e){var lastNum=document.getElementsByName("qRSpan").length;document.getElementsByName("qRSpan")[lastNum-1].style.backgroundColor="#ffffff";document.getElementsByName("qRSpan")[lastNum-1].style.color="#000000";} document.getElementsByName("qRSpan")[qRCurrentFind].style.backgroundColor="#4682B4";document.getElementsByName("qRSpan")[qRCurrentFind].style.color="#ffffff";document.getElementsByName("qRScrollBox")[qRCurrentFind].focus;if(qRCurrentFind==0){document.getElementById("qFindReplaceDiv").scrollTop-=20;}qRCurrentFind++; } else { qRCurrentFind=0;quikFindNext; } } function makeQFindReplace { inTheMake=true; var whereSearch="g"; if(qRIgnoreCase==true){var whereSearch="gi";} var replaceText=new RegExp(document.getElementById("qFindText").value,whereSearch); qRIndex=0; var tempqFindReplaceDiv=document.createElement("div"); tempqFindReplaceDiv.id="qFindReplaceDiv"; tempqFindReplaceDiv.style.overflow="scroll"; tempqFindReplaceDiv.style.position="absolute"; tempqFindReplaceDiv.style.border="1px solid #000000"; tempqFindReplaceDiv.style.zIndex="1"; tempqFindReplaceDiv.style.backgroundColor="#ffffff"; tempqFindReplaceDiv.style.height=document.getElementById("wpTextbox1").offsetHeight+"px"; tempqFindReplaceDiv.style.width=document.getElementById("wpTextbox1").offsetWidth+"px"; var tempqFindReplaceDivHTML=" "+tempqRLine+"  ";qRIndex++; } tempqFindReplaceDivHTML+=" "; tempqFindReplaceDiv.innerHTML=tempqFindReplaceDivHTML; inTheMake=false; return tempqFindReplaceDiv; } function quikReplace {

} function closeQRFindR { try{var editform=document.getElementById("editform");document.getElementById("qFindReplaceDiv").removeChild(document.getElementsByName("qRSpan"));editform.removeChild(document.getElementById("qFindReplaceDiv"));editform.removeChild(document.getElementById("qRDoneDiv"));document.getElementById("qRStatus").innerHTML="Status: Idle";}catch(e){} qRFindIsUp=false; } function closeQuikR { try{document.getElementById("editform").removeChild(document.getElementById("qRDiv"));qROpen=false;}catch(e){} }