📄 search-page.html
字号:
putItem(a[fileNumber][i], ++itemNumber);
}
}
} else {
if (wildcard == -4) {
html += "<P><B>ERROR:</B> The wildcard chararcter (*) must be at the beginning or end of the text.";
}
}
}
function putHeader() {
html += "<html><head><title>Search results for \"" + origSearchString + "\"</title>"
html += getStyles();
html += "</head><body>";
html += "<table CELLPADDING=\"3\" CELLSPACING=\"0\" CLASS=\"listing\">"
html += "<tr><td CLASS=\"title\">Search Results</td></tr>"
html += "</table>"
html += "<p>You searched for <b>" + origSearchString +".</b>";
}
function putFooter() {
var nMatches = 0;
if (!(invalidSearchString)) {
for (var fileNumber = 1; fileNumber < a.length; fileNumber++) {
if (a[fileNumber][N_MATCHES] > 0) {
nMatches++;
}
}
}
if (nMatches == 0) {
html += "<P>No pages matched your search. ";
} else {
var G = nMatches == 1 ? "" : "s";
html += "<P><FONT CLASS=\"list_tagline\">" + nMatches + " page" + G + " listed.</FONT> ";
}
html += footer;
html += "</p></body></html>";
}
function launchBrowser() {
var htmlCode = html;
iu = open("", "Object", "resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,width=475,height=600");
if ((navigator.appName.indexOf("Microsoft")!=-1) && (navigator.appVersion.indexOf("3.0") != -1)) {
alert("Click to see results");
}
iu.document.open();
iu.document.write(htmlCode);
iu.document.close();
}
function replaceSpecialChars(str) {
var returnStr = "";
for (var index = 0; index < str.length; index++) {
if (str.charAt(index) == "<") {
returnStr += "<";
} else if (str.charAt(index) == ">") {
returnStr += ">";
} else if (str.charAt(index) == "\"") {
returnStr += """;
} else {
returnStr += str.charAt(index);
}
}
return(returnStr);
}
function checkSearchString() {
wildcard = searchString.indexOf("*");
if (wildcard == 0) {
wildcard = -2;
invalidSearchString = false;
} else if (wildcard == searchString.length -1) {
wildcard = -3;
invalidSearchString = false;
} else if (wildcard > 0 ) {
wildcard = -4;
invalidSearchString = true;
} else {
invalidSearchString = false;
}
if (searchString.indexOf("*") != searchString.lastIndexOf("*")) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -