BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show findreplace.htm Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download findreplace.htm Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.htm
  1. <HTML>
  2. <HEAD>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <script language=javascript src="dialog.js"></script>
  5. <link href='dialog.css' type='text/css' rel='stylesheet'>
  6. <TITLE>查找 / 替换</TITLE>
  7.  
  8. <script language="JavaScript">
  9.  
  10. var oSelection;
  11. oSelection = dialogArguments.document.selection.createRange();
  12.  
  13. function searchtype(){
  14.     var retval = 0;
  15.     var matchcase = 0;
  16.     var matchword = 0;
  17.     if (document.frmSearch.blnMatchCase.checked) matchcase = 4;
  18.     if (document.frmSearch.blnMatchWord.checked) matchword = 2;
  19.     retval = matchcase + matchword;
  20.     return(retval);
  21. }
  22.  
  23. function checkInput(){
  24.     if (document.frmSearch.strSearch.value.length < 1) {
  25.        alert("请输入查找内容");
  26.        return false;
  27.    } else {
  28.        return true;
  29.    }
  30. }
  31.  
  32. function findtext(){
  33.    if (checkInput()) {
  34.        var searchval = document.frmSearch.strSearch.value;
  35.        oSelection.collapse(false);
  36.        if (oSelection.findText(searchval, 1000000000, searchtype())) {
  37.            oSelection.select();
  38.        } else {
  39.            var startfromtop = confirm("搜索完成,是否要从顶部开始重新搜索?");
  40.            if (startfromtop) {
  41.                oSelection.expand("textedit");
  42.                oSelection.collapse();
  43.                oSelection.select();
  44.                findtext();
  45.            }
  46.        }
  47.    }
  48. }
  49.  
  50. function replacetext(){
  51.    if (checkInput()) {
  52.        if (document.frmSearch.blnMatchCase.checked){
  53.            if (oSelection.text == document.frmSearch.strSearch.value) oSelection.text = document.frmSearch.strReplace.value
  54.        } else {
  55.            if (oSelection.text.toLowerCase() == document.frmSearch.strSearch.value.toLowerCase()) oSelection.text = document.frmSearch.strReplace.value
  56.        }
  57.        findtext();
  58.    }
  59. }
  60.  
  61. function replacealltext(){
  62.    if (checkInput()) {
  63.        var searchval = document.frmSearch.strSearch.value;
  64.        var wordcount = 0;
  65.        var msg = "";
  66.        oSelection.expand("textedit");
  67.        oSelection.collapse();
  68.        oSelection.select();
  69.        while (oSelection.findText(searchval, 1000000000, searchtype())){
  70.            oSelection.select();
  71.            oSelection.text = document.frmSearch.strReplace.value;
  72.            wordcount++;
  73.        }
  74.        if (wordcount == 0) msg = "要查找的内容没有找到"
  75.        else msg = wordcount + " " + "处文本被替换成功";
  76.        alert(msg);
  77.    }
  78. }
  79.  
  80. function InitDocument(){
  81.         adjustDialog();
  82. }
  83.  
  84. </script>
  85.  
  86. </HEAD>
  87. <BODY onload="InitDocument()">
  88. <table border=0 cellpadding=0 cellspacing=5 id=tabDialogSize><tr><td>
  89.  
  90.  
  91. <TABLE CELLSPACING="0" cellpadding="0" border="0" align=center>
  92. <FORM NAME="frmSearch" method="post" action="">
  93. <TR>
  94.         <TD VALIGN="top" align="left" nowrap width="60%">
  95.                 <label for="strSearch">查询内容</label><br>
  96.                 <INPUT TYPE=TEXT SIZE=25 NAME=strSearch id="strSearch"><br>
  97.                 <label for="strReplace">替换内容</label><br>
  98.                 <INPUT TYPE=TEXT SIZE=25 NAME=strReplace id="strReplace"><br>
  99.                 <INPUT TYPE=Checkbox NAME=blnMatchCase ID="blnMatchCase"><label for="blnMatchCase">区分大小写</label><br>
  100.                 <INPUT TYPE=Checkbox NAME=blnMatchWord ID="blnMatchWord"><label for="blnMatchWord">全部匹配</label>
  101.         </td>
  102.         <td width="5%">
  103.         <td rowspan="2" valign="bottom" width="35%">
  104.                 <table border=0 cellpadding=0 cellspacing=5 width="100%" align=center>
  105.                 <tr><td><input type=button style="width:100%" name="btnFind" onClick="findtext();" value="查找下一个"></td></tr>
  106.                 <tr><td><input type=button style="width:100%" name="btnCancel" onClick="window.close();" value="关闭"></td></tr>
  107.                 <tr><td><input type=button style="width:100%" name="btnReplace" onClick="replacetext();" value="替换"></td></tr>
  108.                 <tr><td><input type=button style="width:100%" name="btnReplaceall" onClick="replacealltext();" value="全部替换"></td></tr>
  109.                 </table>
  110.         </td>
  111. </tr>
  112. </FORM>
  113. </table>
  114.  
  115.  
  116. </td></tr></table>
  117. </BODY>
  118. </HTML>
  119.  
downloadfindreplace.htm Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code
Related Source Codes/Software:
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top