Dialog_Find.js
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:4k
源码类别:

OA系统

开发平台:

C#

  1. var OxOddac=["stringSearch","stringReplace","MatchWholeWord","MatchCase","type","selection","document","Control","body","checked","length","value","Nothing to search.x0APlease enter some text in the field labeled Find what:","Finished Searching the document. Would you like to start again from the top?","textedit","text","","[[WordNotFound]]","[[WordReplaced]] : ","insertimage","#temp_url#","images","src","parentNode"];var editwin=Window_GetDialogArguments(window);var stringSearch=Window_GetElement(window,OxOddac[0x0],true);var stringReplace=Window_GetElement(window,OxOddac[0x1],true);var MatchWholeWord=Window_GetElement(window,OxOddac[0x2],true);var MatchCase=Window_GetElement(window,OxOddac[0x3],true);var range;if(Browser_UseIESelection()){if(editwin[OxOddac[0x6]][OxOddac[0x5]][OxOddac[0x4]]==OxOddac[0x7]){ range=editwin[OxOddac[0x6]][OxOddac[0x8]].createTextRange() ; range.moveToElementText(editwin[OxOddac[0x6]].body) ; range.collapse(true) ; range.select() ;} else { range=editwin[OxOddac[0x6]][OxOddac[0x5]].createRange() ;} ;} else { range=editwin.getSelection().getRangeAt(0x0) ;} ; function get_ie_matchtype(){var Ox21f=0x0;var Ox220=0x0;var Ox221=0x0;if(MatchCase[OxOddac[0x9]]){ Ox220=0x4 ;} ;if(MatchWholeWord[OxOddac[0x9]]){ Ox221=0x2 ;} ; Ox21f=Ox220+Ox221 ;return (Ox21f);}  ; function checkInputString(){if(stringSearch[OxOddac[0xb]][OxOddac[0xa]]<0x1){ alert(OxOddac[0xc]) ;return false;} else {return true;} ;}  ; function FindTxt(){if(!checkInputString()){return ;} ;if(Browser_UseIESelection()){var Ox224=stringSearch[OxOddac[0xb]]; range.collapse(false) ;if(range.findText(Ox224,0x3b9aca00,get_ie_matchtype())){ range.select() ;} else {var Ox225=confirm(OxOddac[0xd]);if(Ox225){ range.expand(OxOddac[0xe]) ; range.collapse() ; range.select() ; FindTxt() ;} ;} ;} else { range.collapse(false) ; editwin.find(stringSearch[OxOddac[0xb]],MatchCase[OxOddac[0x9]],false,false,MatchWholeWord.checked,false,false) ;} ;}  ; function ReplaceTxt(){if(!checkInputString()){return ;} ;if(Browser_UseIESelection()){if(MatchCase[OxOddac[0x9]]){if(range[OxOddac[0xf]]==stringSearch[OxOddac[0xb]]){ range[OxOddac[0xf]]=stringReplace[OxOddac[0xb]] ;} ;} else {if(range[OxOddac[0xf]].toLowerCase()==stringSearch[OxOddac[0xb]].toLowerCase()){ range[OxOddac[0xf]]=stringReplace[OxOddac[0xb]] ;} ;} ; FindTxt() ;} else {if(MatchCase[OxOddac[0x9]]){ Gecko_replaceSel(stringSearch[OxOddac[0xb]],stringReplace.value) ;} else { Gecko_replaceSel(stringSearch[OxOddac[0xb]],stringReplace.value) ;} ; FindTxt() ;} ;}  ; function ReplaceAllTxt(){if(!checkInputString()){return ;} ;if(Browser_UseIESelection()){var Ox224=stringSearch[OxOddac[0xb]];var Ox228=0x0;var Ox1b9=OxOddac[0x10]; range.expand(OxOddac[0xe]) ; range.collapse() ; range.select() ;var Ox229=get_ie_matchtype();while(range.findText(Ox224,0x3b9aca00,Ox229)){ range.select() ; range[OxOddac[0xf]]=stringReplace[OxOddac[0xb]] ; Ox228++ ;} ;if(Ox228==0x0){ Ox1b9=OxOddac[0x11] ;} else { Ox1b9=OxOddac[0x12]+Ox228 ;} ; alert(Ox1b9) ;} else {var Ox22a=editwin.getSelection(); range=Ox22a.getRangeAt(0x0) ; FindTxt() ; range.collapse(false) ;while(editwin.find(stringSearch[OxOddac[0xb]],MatchCase[OxOddac[0x9]],false,false,MatchWholeWord.checked,false,false)){ Gecko_replaceSel(Ox224,stringReplace.value) ;} ;} ;}  ; function Gecko_replaceSel(Ox22c,Ox24){var editdoc=editwin[OxOddac[0x6]];var Ox22a=editwin.getSelection(); range=Ox22a.getRangeAt(0x0) ;if(Ox24.indexOf(Ox22c)==-0x1){ range.deleteContents() ; range.insertNode(range.createContextualFragment(Ox24)) ; range.collapse(false) ;} else { editdoc.execCommand(OxOddac[0x13],false,OxOddac[0x14]) ;var Ox119=null;var Ox22e=editdoc[OxOddac[0x15]];for(var j=0x0;j<Ox22e[OxOddac[0xa]];j++){if(Ox22e[j].getAttribute(OxOddac[0x16])==OxOddac[0x14]){ Ox119=Ox22e[j] ;break ;} ;} ;if(Ox119){ Ox119[OxOddac[0x17]].replaceChild(editdoc.createTextNode(Ox24),Ox119) ; range.collapse(false) ;} ;} ;}  ;