forked from DND5eChm/5echm_web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebhelpbookmark.htm
166 lines (146 loc) · 5.62 KB
/
webhelpbookmark.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<title>5E 不全书</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
var currentUrl;
function getCookie(cookie_name)
{
var allcookies = document.cookie;
var cookie_pos = allcookies.indexOf(cookie_name + "=");
if (cookie_pos != -1)
{
cookie_pos += cookie_name.length + 1;
var cookie_end = allcookies.indexOf(";", cookie_pos);
if (cookie_end == -1)
{
cookie_end = allcookies.length;
}
var value = unescape(allcookies.substring(cookie_pos, cookie_end));
}else{
var value = "";
}
return value;
}
function window_resize(){
if(navigator.userAgent.indexOf("iPad")>-1||navigator.userAgent.indexOf("iPhone")>-1||navigator.userAgent.indexOf("iPod")>-1||navigator.userAgent.indexOf("Android")>-1){
document.getElementById("Index").style.cssText = "height: auto;width: " + (window.innerWidth-20);
document.getElementById("currentTopic").style.cssText = "width: " + (window.innerWidth-20);
}else if(window.innerHeight){
document.getElementById("Index").style.cssText = "height: " + (window.innerHeight- 140) + "; width: " + (window.innerWidth-20);
document.getElementById("currentTopic").style.cssText = "width: " + (window.innerWidth-20);
}else{
document.getElementById("Index").style.cssText = "height: " + (document.body.offsetHeight - 130) + "; width: " + (document.body.offsetWidth - 20);
document.getElementById("currentTopic").style.cssText = "width: " + (document.body.offsetWidth - 20);
}
}
function window_load(){
var i;
var c = getCookie("Bookmarks");
if(c!=''){
var a = c.split("\n");
for(i=0;i<=(a.length-1)/2;i++){
document.getElementById("Index").options[document.getElementById("Index").options.length] = new Option(a[i*2],a[i*2+1]);
if(i==0){
document.getElementById("Index").selectedIndex = 0;
}
}
}
window_resize();
window.setTimeout("syn();",300);
}
function keyword_change(k){
var i;
var str;
var found = false;
for(i=0;i<document.getElementById("Index").options.length;i++){
str = document.getElementById("Index").options[i].text;
if(str.indexOf(k.value) == 0 && found == false){
document.getElementById("Index").options[i].selected = true;
found = true;
}
}
}
function display_click(){
var i;
for(i=0;i<document.getElementById("Index").options.length;i++){
if(document.getElementById("Index").options[i].selected){
parent.content.document.location.href = document.getElementById("Index").options[i].value;
break;
}
}
}
function savetocookie(){
var i;
var v = "";
for(i=0;i<document.getElementById("Index").options.length;i++){
if(v!=""){v = v + "\n"};
v = v + document.getElementById("Index").options[i].text + "\n" + document.getElementById("Index").options[i].value;
}
var expires = new Date();
expires.setTime(expires.getTime() + 24 * 3600 * 365 * 10000);
document.cookie = "Bookmarks=" + escape(v) + ";expires=" + expires.toGMTString();
}
function add_click(){
document.getElementById("Index").options[document.getElementById("Index").options.length] = new Option(document.getElementById("currentTopic").value,currentUrl);
document.getElementById("Index").selectedIndex = document.getElementById("Index").options.length - 1;
savetocookie();
}
function remove_click(){
var i;
for(i=0;i<document.getElementById("Index").options.length;i++){
if(document.getElementById("Index").options[i].selected){
document.getElementById("Index").options[i] = null;
if(document.getElementById("Index").options.length>0){
if(i<=document.getElementById("Index").options.length -1){
document.getElementById("Index").options[i].selected = true;
}else{
document.getElementById("Index").options[document.getElementById("Index").options.length -1].selected = true;
}
}
break;
}
}
savetocookie();
}
function syn(){
if(parent.content.document.location.href!=currentUrl){
document.getElementById("currentTopic").value = parent.content.document.title;
currentUrl = parent.content.document.location.href;
}
window.setTimeout("syn();",300);
}
</script>
<script language="JavaScript" src="languages.js"></script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#DCDBD6" leftmargin="5" topmargin="5" marginwidth="5" marginheight="5" onload="window_load();" onresize="window_resize();">
<form name="form1" method="post" action="">
<table width="100%" border="0">
<tr>
<td><span class="label"><script>document.write(strings['Topics:']);</script></span><br>
<select name="Index" size="20" class="label" id="Index" ondblclick="display_click();">
</select>
</td>
</tr>
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><script>document.write('<input name="Submit" type="submit" class="label" onClick="remove_click(); return false;" value="' + strings['Remove'] + '">');</script></td>
<td align="right"><script>document.write('<input name="display" type="submit" class="label" id="display" onClick="display_click(); return false;" value="' + strings['Display'] + '">');</script></td>
</tr>
</table> </td>
</tr>
<tr>
<td> <span class="label"><script>document.write(strings['Current topic:']);</script></span><br>
<input name="currentTopic" type="text" class="label" id="currentTopic"></td>
</tr>
<tr>
<td align="right"><script>document.write('<input name="add" type="submit" class="label" id="add" onClick="add_click(); return false;" value="' + strings['Add'] + '">');</script></td>
</tr>
</table>
</form>
</body>
</html>