📄 findreplace.php
字号:
<?php
include( "../../config.inc.php" );
include( "../language/".$aLan."_".$charset.".php" );
include( "../../includes/version.php" );
include( "../../includes/pro.php" );
echo "<html>\r\n<head >\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
echo $charset;
echo "\">\r\n<link rel=stylesheet type=text/css href=style.css>\r\n<title>";
echo $strHtmlFind;
echo "</title>\r\n\r\n\r\n";
echo "<s";
echo "cript language=\"JavaScript\">\r\n\r\nvar oSelection;\r\noSelection = dialogArguments.document.selection.createRange();\r\n\r\n\r\nfunction searchtype(){\r\n var retval = 0;\r\n var matchcase = 0;\r\n var matchword = 0;\r\n if (document.frmSearch.blnMatchCase.checked) matchcase = 4;\r\n if (document.frmSearch.blnMatchWord.checked) matchword = 2;\r\n retval = matchcase + matchword;\r\n return(retval);\r\n}\r";
echo "\n\r\n\r\nfunction checkInput(){\r\n if (document.frmSearch.strSearch.value.length < 1) {\r\n alert(\"请输入查找内容\");\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}\r\n\r\n\r\nfunction findtext(){\r\n if (checkInput()) {\r\n var searchval = document.frmSearch.strSearch.value;\r\n oSelection.collapse(false);\r\n if (oSelection.findText(searchval, 1000000000, searcht";
echo "ype())) {\r\n oSelection.select();\r\n } else {\r\n var startfromtop = confirm(\"";
echo $strHtmlFindAsk;
echo "\");\r\n if (startfromtop) {\r\n oSelection.expand(\"textedit\");\r\n oSelection.collapse();\r\n oSelection.select();\r\n findtext();\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction replacetext(){\r\n if (checkInput()) {\r\n if (document.frmSearch.blnMatchCase.checked){\r\n if (oSelection.text == document.frmSearch.strSearch.";
echo "value) oSelection.text = document.frmSearch.strReplace.value\r\n } else {\r\n if (oSelection.text.toLowerCase() == document.frmSearch.strSearch.value.toLowerCase()) oSelection.text = document.frmSearch.strReplace.value\r\n }\r\n findtext();\r\n }\r\n}\r\n\r\nfunction replacealltext(){\r\n if (checkInput()) {\r\n var searchval = document.frmSearch.strSearch.value;\r\n ";
echo "var wordcount = 0;\r\n var msg = \"\";\r\n oSelection.expand(\"textedit\");\r\n oSelection.collapse();\r\n oSelection.select();\r\n while (oSelection.findText(searchval, 1000000000, searchtype())){\r\n oSelection.select();\r\n oSelection.text = document.frmSearch.strReplace.value;\r\n wordcount++;\r\n }\r\n if (wordcount == 0) msg = \"";
echo $strHtmlFindNotFind;
echo "\"\r\n else msg = wordcount + \" ";
echo $strHtmlFindReplaceNum;
echo "\";\r\n alert(msg);\r\n }\r\n}\r\n</script>\r\n\r\n</HEAD>\r\n<BODY bgcolor=\"menu\">\r\n<FORM NAME=\"frmSearch\" method=\"post\" action=\"\">\r\n<TABLE CELLSPACING=\"0\" cellpadding=\"5\" border=\"0\">\r\n<TR><TD VALIGN=\"top\" align=\"left\" nowrap>\r\n <label for=\"strSearch\">";
echo $strHtmlFindWord;
echo "</label><br>\r\n <INPUT TYPE=TEXT SIZE=40 NAME=strSearch id=\"strSearch\" style=\"width : 200px;\"><br>\r\n <label for=\"strReplace\">";
echo $strHtmlReplaceWord;
echo "</label><br>\r\n <INPUT TYPE=TEXT SIZE=40 NAME=strReplace id=\"strReplace\" style=\"width : 200px;\"><br>\r\n <INPUT TYPE=Checkbox SIZE=40 NAME=blnMatchCase ID=\"blnMatchCase\"><label for=\"blnMatchCase\">";
echo $strHtmlFindDx;
echo "</label><br>\r\n <INPUT TYPE=Checkbox SIZE=40 NAME=blnMatchWord ID=\"blnMatchWord\"><label for=\"blnMatchWord\">";
echo $strHtmlFindAll;
echo "</label>\r\n</td>\r\n<td rowspan=\"2\" valign=\"top\">\r\n <input type=button style=\"width:80px;margin-top:15px\" name=\"btnFind\" onClick=\"findtext();\" value=\"";
echo $strHtmlFindNext;
echo "\"><br>\r\n <input type=button style=\"width:80px;margin-top:5px\" name=\"btnReplace\" onClick=\"replacetext();\" value=\"";
echo $strHtmlReplace;
echo "\"><br>\r\n <input type=button style=\"width:80px;margin-top:5px\" name=\"btnReplaceall\" onClick=\"replacealltext();\" value=\"";
echo $strHtmlReplaceAll;
echo "\"><br>\r\n <input type=button style=\"width:80px;margin-top:5px\" name=\"btnCancel\" onClick=\"window.close();\" value=\"";
echo $strWindowClose;
echo "\"><br>\r\n</td>\r\n</tr>\r\n</table>\r\n</FORM>\r\n</BODY>\r\n</HTML>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -