-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·301 lines (265 loc) · 10.2 KB
/
index.html
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>宣讲会 | 关键词</title>
<style type="text/css">
* { padding:0; margin:0;}
body { font-size: 14px; font-family: "微软雅黑"; padding:20px;}
h2 { font-size: 22px; line-height: 30px;}
h3 { font-size: 16px; line-height: 28px;}
cl { clear:both;}
#article, #keywords, #kinds { line-height: 20px;}
#article { padding:0 20px; padding-right:450px; min-width:300px;}
#article h2 { text-align: center; line-height: 40px; position:relative;}
#article p { line-height: 28px; margin-top: 20px; text-indent: 2em}
#keywords { width:230px; border:1px solid #000; margin-left:30px; margin-right:10px; min-height: 500px; position:fixed; right:190px;}
#keywords h3, #kinds h3 { background:#EEE; text-align: center; }
#kinds { width:160px; border:1px solid #000;position:fixed; right:20px; }
#kinds div { padding:20px;}
#kinds input { margin-right: 5px; }
.place_got{ padding:20px;}
.place_got span{ display:inline-block; height:20px; margin-right:10px; background-image:url(./images/place_tag.gif); background-repeat:repeat-x; background-position:0px 0px; margin:3px;}
.place_got span font{ display:inline-block; float:left; line-height:20px; padding-left:5px; padding-right:5px; background-image:url(./images/place_tag.gif); background-repeat:no-repeat; background-position:left -40px; cursor:default; font-size: 14px;}
.place_got span:hover{ cursor:pointer;background-position:0 -20px;}
.place_got span:hover font{ background-position:left -60px;}
.place_got span a{ width:18px; height:20px; background:url(./images/place_x.gif) no-repeat 0px bottom; display:inline-block;}
.place_got span:hover a{ background-position:0 -20px;}
.place_got span a:hover{ background-position:left top;}
.pages { width:50px; position:fixed; right:430px;}
.pages a { display:block; height:80px; line-height: 80px; font-size: 50px; text-align: center; font-weight: bold; margin-bottom: 20px; text-decoration: none;}
</style>
</head>
<body>
<div id="wp" data-page="">
<div id="kinds" style="display:none;">
<h3>分类列表</h3>
<div>
<input type="radio" name="kinds" value="1" id="r1" /><label for="r1">技术/研发</label><br />
<input type="radio" name="kinds" value="2" id="r2" /><label for="r2">设计/艺术</label><br />
<input type="radio" name="kinds" value="3" id="r3" /><label for="r3">产品/策划</label><br />
<input type="radio" name="kinds" value="4" id="r4" /><label for="r4">市场/销售</label><br />
<input type="radio" name="kinds" value="5" id="r5" /><label for="r5">运营/编辑</label><br />
<input type="radio" name="kinds" value="6" id="r6" /><label for="r6">行政/管理</label><br />
<input type="radio" name="kinds" value="7" id="r7" /><label for="r7">客户服务</label><br />
<input type="radio" name="kinds" value="8" id="r8" /><label for="r8">其他</label><br />
</div>
</div>
<div id="keywords">
<h3>关键词列表</h3>
<div class="place_got" id="wordList">
<span><font>武汉</font><a href="#" onclick="rmkeyWord(this);"></a></span>
<span><font>心仪</font><a href="#" onclick="rmkeyWord(this);"></a></span>
<span><font>海量</font><a href="#" onclick="rmkeyWord(this);"></a></span>
<span><font>宣讲会</font><a href="#" onclick="rmkeyWord(this);"></a></span>
</div>
</div>
<div class="pages" style="display:none;">
<a href="#" title="上一篇">↑</a>
<a href="#" title="下一篇">↓</a>
</div>
<div id="article">
<h2>宣讲会查询系统 -- 百度百科</h2>
<p>宣讲会查询系统是华中科技大学网络应用于研发中心(海投网)为了方便应届毕业生,查找本校和本地高校的校园宣讲会信息而开发的程序软件。宣讲会查询系统能够让大学生全面的获取校园招聘信息,并提醒大学生及时的参加宣讲会活动。</p>
<p>宣讲会查询系统,覆盖全国重点高校宣讲会信息,包括武汉、北京、南京、西安、广州、成都、天津、合肥、重庆、大连、济南、杭州等地。目前系统还在优化之中,新的地区高校宣讲会信息正在不断更新完善。</p>
<p><strong>收藏功能:</strong>用户可以根据自己的喜好,从海量的信息中收藏自己心仪的公司的招聘信息。点击每条信息最后的收藏按钮即可快速收藏该信息,并在“我的收藏”中查看所有收藏的信息。</p>
<p><strong>快照功能:</strong>由于很多高校的官方就业信息网服务器不稳定,偶尔会服务器错误,使同学们无法查看。招聘信息查询系统提供快照功能,将高校的官方就业信息网的信息详情存储下来,提供给同学们看。保证同学们始终能看到全面的招聘信息[1]。</p>
</div>
<br class="cl" />
</div>
<a href="https://github.com/demo-platform/getkeyword"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://www.barretlee.com/blogimgs/forkme.png" alt="Fork me on GitHub"></a>
<script type="text/javascript">
var GetKeywords = {
str: "",
limit: 11,
keywords:[],
url: "./tool.php",
//page id
getId: function(){
this.id = this._("wp").getAttribute("data-page");
},
init : function(){
var box = this._("article"),
_this = this;
//获取已经存在的关键词
this.getAllKeyWord();
//获取页面ID
this.getId();
//让rmKeyWord函数全局化
window.rmkeyWord = this.rmkeyWord;
//取词事件
box.onmouseup = function(evt){
var evt = evt || window.event,
target = evt.target || evt.srcElement;
//如果鼠标是在button上弹起,则忽略
if(target.id == "btn") return;
GetKeywords.str = _this.getSelectionText();
if(_this.str.length == 0){
_this.removeBtn();
return;
}
if(_this._("btn")) {
_this.removeBtn();
if(GetKeywords.str == "") return;
_this.createBtn(evt);
return;
}
_this.createBtn(evt);
}
var types = document.getElementsByTagName("input");
for(var j = 0, len = types.length; j < len; j++){
(function(j){
types[j].onchange = function(){
_this.sendData(j + 1, "change");
}
})(j);
}
},
//工具函数
_: function(obj){
return document.getElementById(obj);
},
//获取选中文本
getSelectionText: function(){
if(window.getSelection) {
return window.getSelection().toString();
} else if(document.selection && document.selection.createRange) {
return document.selection.createRange().text;
}
return '';
},
//创建按钮
createBtn: function(evt){
var button = document.createElement("div"),
evt = evt || window.event,
x = evt.pageX || evt.x,
y = evt.pageY || evt.y,
i, j, len,
cssList = "",
_this = this,
csses = {
"height" : "30px",
"line-height" : "30px",
"position": "absolute",
"top": y + 10 + "px",
"left": x + 10 + "px",
"cursor": "pointer",
"border": "1px solid #000",
"background": "#EEE",
"padding": "2px 8px",
"border-radius": "3px"
};
for(i in csses){
if(csses.hasOwnProperty(i)){
cssList += i + ":" + csses[i] + ";";
}
}
button.style.cssText = cssList;
button.innerHTML = "添加到关键词列表";
button.setAttribute("id", "btn");
this._("article").appendChild(button);
button.onclick = function(){
if(_this.str.length > _this.limit){
alert("关键词长度最长为11,可以通过设置GetKeywords.limit来控制长度。");
_this.removeBtn();
return;
}
for(j = 0, len = GetKeywords.keywords.length; j < len; j++){
if(GetKeywords.keywords[j] == _this.str){
alert("已经存在该关键词了~");
_this.removeBtn();
return;
}
continue;
}
_this.sendData(_this.str);
_this.keywords.push(_this.str);
_this.setRed(_this.str);
_this.addTo();
_this.removeBtn();
};
},
//删除按钮
removeBtn: function(){
var btn = this._("btn");
btn.parentNode.removeChild(btn);
},
//加入到关键词里列表
addTo: function(){
var word = this._("wordList");
word.innerHTML += "<span><font>" + this.str + "</font><a href='#' onclick='rmkeyWord(this);'></a></span>";
},
//关键词标红
setRed: function(str){
var content = this._("article"),
temp = '(' + str + ')';
reg = new RegExp(temp,'g');
content.innerHTML = content.innerHTML.replace(reg, "<span style='color:red;'>$1</span>");
},
//删除标红
rmRed: function(str){
var content = this._("article"),
temp = "(<span[^<]*" + str + "</span>)";
reg = new RegExp(temp,'gi');
content.innerHTML = content.innerHTML.replace(reg, str);
},
//获取已经存在的关键词(也可以用来获取所有关键词)
getAllKeyWord: function (){
var spans = this._("wordList").getElementsByTagName("span"),
key = [], i = 0, len;
for(len = spans.length; i < len; i++){
var font = spans[i].getElementsByTagName("font")[0];
var temp = font.innerText || font.textContent;
this.setRed(temp);
key.push(temp);
}
this.keywords = key;
},
//删除关键词
rmkeyWord: function (obj){
var target = obj.parentNode,
word = obj.previousSibling.innerHTML,
i = 0, len;
res = GetKeywords.sendData(word, "del");
GetKeywords.rmRed(word);
for(len = GetKeywords.keywords.length; i < len; i++){
if(GetKeywords.keywords[i] == word){
GetKeywords.keywords.splice(i,i);
}
continue;
}
target.parentNode.removeChild(target);
var evt = arguments.callee.caller.arguments[0];
try{
evt.preventDefault();
}catch(e){
window.event.returnValue = false;
}
},
//ajax
sendData: function(data, action){
var xmlhttp,
action = action || "add",
_this = this;
if (window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}else{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", this.url + "?" + action + "=" + data + "&id=" + this.id, true);
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
_this.sendSuccess(xmlhttp.responseText);
}
}
xmlhttp.send();
},
sendSuccess:function(data){
window.console && window.console.log && window.console.log(data);
}
}
GetKeywords.init();
</script>
</body>
</html>
<script src='http://www.barretlee.com/demo-platform.js'></script>