-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddx.html
238 lines (223 loc) · 7.68 KB
/
addx.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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>笑话仓库 - GIT笑话网 - gitjoke.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bmob-min.js"></script>
<script type="text/javascript"> Bmob.initialize("4c6dd7eed26e4d1ed7877d6093b299c1", "d5c309d52fd9904e1f85e4f5d5dd72f5");</script>
<!-- Baidu Tongji //-->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?279eb3fba9f1ccf8f52393aa1b8a0f63";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Page Loaded //-->
<script type="text/javascript">
$(function() {
$('footer h5').css("color", "grey");
});
</script>
</head>
<body>
<section class="page-header">
<h3 class="project-name">笑话仓库 - GIT笑话网 - gitjoke.com</h3>
</section>
<section class="main-content">
<p>
<a href="/index.html" target=_blank>笑话精选</a> |
<a href="/story/index.html" target=_blank>理发室故事</a> |
<a href="/wechat/index.html" target=_blank>微信群聊</a> |
<a href="/picture/index.html" target=_blank>微信传图</a> |
<a href="/one.html" target=_blank>一个笑话</a> |
<span style="background-color: #00FFFF"><b><a href="" onclick="funcGetRandomOne(this); return false;">随机翻页</a></b></span> |
<a href="/link.html" target=_blank>联系方式</a>
</p>
<!-- stdout //-->
<p id="idStdout0"></p>
<p id="idStdout1">加载中,请稍后片刻......</p>
<p id="idStdout2"></p>
<p id="idStdout3"></p>
<p id="idStdout4"></p>
<form id="idFormNext">
<input type="button" id="idHomeBtn" value="第一页" onclick="funcGoHomePage(this);" />
<input type="button" id="idNextBtn" value="上一页" onclick="funcGoPrevPage(this);" />
<input type="button" id="idNextBtn" value="下一页" onclick="funcGoNextPage(this);" />
</form>
<footer class="site-footer">
<h5>@ 2016 GIT笑话 - gitjoke.com | 隐私声明和 Cookie
<a href="http://go.microsoft.com/fwlink/?LinkId=248686&CLCID=804" target=_blank>@</a></h5>
</footer>
<script>
function funcGetUrlParamValueOf (url, name) {
var reg = new RegExp('(\\?|&)' + name + '=([^&?]*)', 'i');
var arr = url.match(reg);
if (arr) {
return arr[2];
}
return null;
}
</script>
<script>
var g_iTotalCount = 0;
var g_strHtmlFile = "/addx.html";
function funcGoHomePage (){
window.location.href = g_strHtmlFile;
}
function funcGoPrevPage (){
if (parseInt(g_iPageNo, 10)-1 >= 0) {
window.location.href = g_strHtmlFile + "?iPageNo=" + (parseInt(g_iPageNo,10)-1);
} else {
if (parseInt(g_iTotalCount,10)%18===0) {
window.location.href = g_strHtmlFile + "?iPageNo=" + (parseInt(g_iTotalCount/18,10)-1);
} else {
window.location.href = g_strHtmlFile + "?iPageNo=" + (Math.floor (parseInt(g_iTotalCount/18,10)));
}
}
}
function funcGoNextPage (){
if (18*(parseInt(g_iPageNo,10)+1) >= g_iTotalCount) { // 每页18条笑话
window.location.href = g_strHtmlFile; // 超过则返回第一页
} else {
window.location.href = g_strHtmlFile + "?iPageNo=" + (parseInt(g_iPageNo,10)+1);
}
}
function funcGetRandomOne() {
var iWhichPage = Math.floor(Math.random()*(g_iTotalCount/18));
window.location.href = g_strHtmlFile + "?iPageNo=" + (parseInt(iWhichPage,10));
}
</script>
<!-- RUN //-->
<script type="text/javascript">
var g_iPageNo = funcGetUrlParamValueOf (window.location.href, "iPageNo");
if (!g_iPageNo) {
g_iPageNo = 0;
}
// READY
$(document).ready(function() {
setTimeout (function () {
$.ajax({url:"/get1.html",
success:function(msg){
$("#idStdout1").html (msg);
}
});
$.ajax({url:"/get2.html",
success:function(msg){
$("#idStdout2").html (msg);
}
});
$.ajax({url:"/get3.html",
success:function(msg){
$("#idStdout3").html (msg);
}
});
$.ajax({url:"/getcount.html",
success:function(msg){
$("#idStdout0").html (msg);
}
});
}, 0);
});
// GET JOKES
function funcShowGitJokeAll (iSkipCount, iLimitCount, idStdout){
var TableLengXiaoHua = Bmob.Object.extend ("LengXiaoHua");
var tQuery = new Bmob.Query (TableLengXiaoHua);
var strFullPage = "";
var strOneLine = "";
tQuery.descending("createdAt");
tQuery.skip (iSkipCount);
tQuery.limit (iLimitCount);
tQuery.find({success: function(results) {
for (var i = 0; i < results.length; i++) {
var object = results[i];
var strObjectID = object.id;
var strContent = object.get('content');
var strLevel = object.get('level');
var strColor;
if (i%3==0){
strColor = "green";
} else if (i%3==1) {
strColor = "blue";
} else {
strColor = "black";
}
if (strLevel === "1"){
strColor = "red";
}
var strUpdateByIdHtml = "<a href='/add.html?objectId=" + strObjectID + "' target=_blank><b>【添加】</b></a>";
var strContentHtml = "<span id=\"my_" + strObjectID + "\" style=\"color:" + strColor + "\">" + strContent + "</span>";
var strLevelHtml = "<a href='' onclick='funcSetLevel(\"" + strObjectID + "\"); return false;'><b>【标记】</b></a>";
strOneLine = strContentHtml + " " + strUpdateByIdHtml + " " + strLevelHtml + "</br></br>";
strFullPage += strOneLine;
}
$(idStdout).html (strFullPage);
},
error: function(error) {
$(idStdout).text ("Query failed: " + error.code + " " + error.message);
}
});
}
</script>
<script>
function funcGetCount() {
var TableLengXiaoHua = Bmob.Object.extend ("LengXiaoHua");
var tQuery = new Bmob.Query (TableLengXiaoHua);
tQuery.count({
success: function(iTotalCount) {
g_iTotalCount = iTotalCount;
var strShowPageInfo = "已收录<font color=blue size=6>" + iTotalCount + "</font>条备选笑话," +
"共"+(Math.ceil(parseInt(iTotalCount,10)/18))+"页,当前第<font color=blue size=6>"+ (parseInt(g_iPageNo,10)+1) +"</font>页。";
$("#idStdout0").html (strShowPageInfo);
$("#idStdout4").html (strShowPageInfo);
},
error: function(error) {
$("#idStdout0").text (error.message);
$("#idStdout4").text (error.message);
}
});
}
</script>
<script>
function funcSetLevel(strObjectID) {
var TableLengXiaoHua = Bmob.Object.extend("LengXiaoHua");
var tQuery = new Bmob.Query(TableLengXiaoHua);
tQuery.get(strObjectID, {
success: function(object) {
if (object.get("level") === "1") {
object.set("level", "");
} else {
object.set("level", "1");
}
object.save(null, {
success: function(objectUpdate) {
// alert("create object success, object score:"+objectUpdate.get("level"));
// window.location.href = window.location.href;
if (objectUpdate.get("level") === "1") {
$("#my_" + strObjectID).css ('color', 'red');
} else {
$("#my_" + strObjectID).css ('color', 'black');
}
},
error: function(model, error) {
// alert("create object fail");
}
});
},
error: function(object, error) {
// alert("tQuery object fail");
}
});
}
</script>
</section>
</body>
</html>