-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathlibs.html
402 lines (397 loc) · 18.1 KB
/
libs.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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>阿伟js插件集</title>
<meta name="description" content="js插件集">
<meta name="keywords" content="阿伟,JsLibs,js插件,seajs,seajs插件,js常用插件,校验插件,分页插件">
<link rel="stylesheet" href="libs.css">
</head>
<body>
<section class="page-header">
<div style="position:relative;z-index: 9999999999"></div><h1 class="project-name">Jslibs</h1>
<h2 class="project-tagline">要来就来一包!一包五颜六色的js插件(大部分为seajs的),满足前端开发的各种需求。有校验插件,分页插件,ajax插件,弹窗插件等等。</h2>
<a target="_Blank" href="https://github.com/aweiu/JsLibs" class="btn">View on GitHub</a>
<a target="_Blank" href="https://github.com/aweiu/JsLibs/zipball/master" class="btn">Download .zip</a>
<a target="_Blank" href="https://github.com/aweiu/JsLibs/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<div class="module">
<a target="_Blank" href="https://github.com/seajs/seajs/issues/266" class="title">sea</a>
</div>
<div class="module">
<a target="_Blank" href="https://github.com/seajs/seajs-css/blob/master/README.md" class="title">sea-css</a>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#jquery" class="title">seajs-jquery</a>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#utils" class="title">seajs-utils</a>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/fixJsForIE8/" class="title">fixJsForIE8</a>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/placeholder/" class="title">placeholder</a>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/singlePage/" class="title">singlePage</a>
<a target="_Blank" href="http://awei.oss-cn-shenzhen.aliyuncs.com/singlePage/index.html">查看演示(仿喜马拉雅播放器)</a>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#waitting" class="title">seajs-waiting</a>
<button id="seajs_waiting_show">show</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#commom-tip" class="title">seajs-common-tip</a>
<button id="seajs_common_tip_show_success">show-success</button>
<button id="seajs_common_tip_show_fail">show-fail</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#validate" class="title">seajs-validate</a>
<input type="text" placeholder="银行卡" validType="bankCard" id="validateIpt">
<button id="seajs_validate">validate</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#countdown" class="title">seajs-countdown</a>
<button id="seajs_countdown_start">获取验证码</button>
<button id="seajs_countdown_stop">stop</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#sendVerifyCode" class="title">seajs-sendVerifyCode</a>
<input type="text" placeholder="手机号" id="seajs_sendVerifyCode_mobile" validType="phoneNum" maxlength="11">
<button id="seajs_sendVerifyCode">获取验证码</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#httpClient" class="title">seajs-httpClient</a>
<button id="seajs_httpClient_get">get</button>
<button id="seajs_httpClient_post">post</button>
<button id="seajs_httpClient_syncGet">syncGet</button>
<button id="seajs_httpClient_syncPost">syncPost</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#modal-common" class="title">seajs-modal-common</a>
<button id="seajs_modal_common_show">show</button>
<button id="seajs_modal_common_hide">hide</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#ajaxForm" class="title">seajs-ajaxForm</a>
<form action="http://awei.oss-cn-shenzhen.aliyuncs.com/http.txt" actionName="test">
<input type="text" name="test">
<button>submit</button>
</form>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#serachIpt" class="title">seajs-searchIpt</a>
<input type="text" name="test" id="seajs_searchIpt_ipt" minLength="0">
<div id="seajs_searchIpt_draw"></div>
</div>
<div class="module" id="seajs_upload_cont">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#upload" class="title">seajs-upload</a>
<div class="tip">请使用谷歌浏览器并关闭安全模式测试</div>
<img src="" alt="" height="100" width="100" id="seajs_upload_i">
请提交图片:<input type="file" accept="image/gif,image/jpeg,image/png,image/jpg" name="file" imgTo="seajs_upload_i">
请提交文件:<input type="file" name="file">
</div>
<div class="module" id="seajs_uploadImgs_cont">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#uploadImgs" class="title">seajs-uploadImgs</a>
<div class="tip">请使用谷歌浏览器并关闭安全模式测试</div>
<div>
<img src="" alt="" height="100" width="100">
<img src="" alt="" height="100" width="100">
<img src="" alt="" height="100" width="100">
</div>
<label for="seajs_uploadImgs_subBtn" class="upbtn">选择图片</label>
<input type="file" accept="image/gif,image/jpeg,image/png,image/jpg" name="file" imgTo="i" id="seajs_uploadImgs_subBtn" class="none">
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#autoPage" class="title">seajs-autoPage</a>
<div id="seajs_autoPage_mode1" class="autoPage">
</div>
<div id="seajs_autoPage_mode2" class="autoPage">
</div>
<button id="seajs_autoPage_mode1_start">滑动模式加载开始</button>
<button id="seajs_autoPage_mode2_start">点击模式加载开始</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#passwordWidget" class="title">seajs-passwordWidget</a>
<div class="tip">请使用手机模式调试</div>
<input type="text" readonly placeholder="输入密码" id="seajs_passwordWidget_ipt">
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#switchButton" class="title">seajs-switchButton</a>
<div class="tip">请使用手机模式调试</div>
<div id="seajs_switchButton">
</div>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#topTip" class="title">seajs-topTip</a>
<button id="seajs_topTip">show</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#gritter" class="title">seajs-gritter</a>
<button id="seajs_gritter">show</button>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#tablePage" class="title">seajs-tablePage</a>
<button id="seajs_tablePage_btn">开始</button>
<table id="seajs_tablePage_table">
<thead>
<tr>
<th>t1</th>
<th>t2</th>
<th>t3</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="module">
<a target="_Blank" href="https://aweiu.com/documents/seajs-jsLibs/#calendar" class="title" name="seajs-calendar">seajs-calendar</a>
<input type="text" class="calendarIpt" placeholder="请选择生日">
<input type="text" class="calendarIpt" placeholder="请选择生日">
<input type="text" class="calendarIpt" placeholder="请选择生日">
</div>
<footer class="site-footer">
<h3>推荐使用<a target="_Blank" href="https://aweiu.com/documents/sealoader/">sealoader</a>管理您的seajs插件</h3>
<h3>觉得好用就打个赏吧^.^</h3>
<img src="imgs/zfb.png" class="code-img">
<img src="imgs/wx.png" class="code-img">
<h3>交流反馈:</h3>
<p>
QQ群:515660304 <br>
Issues: <a target="_Blank" href="https://github.com/aweiu/JsLibs/issues">issues</a>
</p>
</footer>
</section>
<script src="/libs/js/sea.js" id="seajsnode"></script>
<script>
var assetsUrl="http://awei.oss-cn-shenzhen.aliyuncs.com/";
var bindClick=function(id,fuc){
var btn=document.getElementById(id),
jsName=btn.parentNode.getElementsByTagName("a")[0].innerHTML;
btn.addEventListener("click",function(){
var that=this;
seajs.use(jsName,function(o){
fuc.call(that,o);
})
});
},
showTip=function(txt,isError){
seajs.use("seajs-common-tip",function(o){
o.show(txt,isError);
});
}
seajs.use("seajs-utils",function(utils){
//seajs_common_tip
bindClick("seajs_common_tip_show_success",function(o){
o.show("success");
});
bindClick("seajs_common_tip_show_fail",function(o){
o.show("fail",false);
});
//seajs-validate
var validateIpt=utils.$id("validateIpt");
seajs.use("seajs-validate",function(){
bindClick("seajs_validate",function(){
var validResult=validateIpt.validMe(false);
if(!validResult.isok){
validateIpt.showErrorTip(validResult.tip);
}else{
showTip("校验通过!");
}
});
});
bindClick("seajs_countdown_start",function(o){
o.start(this);
});
bindClick("seajs_countdown_stop",function(o){
o.stop();
});
bindClick("seajs_httpClient_get",function(o){
o.get(assetsUrl+"http.txt",function(rs,txt){
showTip("返回文本如下:<br>"+txt+"<br>json序列请查看控制台");
console.log(rs);
});
});
bindClick("seajs_httpClient_post",function(o){
o.post(assetsUrl+"http.txt","",function(rs,txt){
showTip("返回文本如下:<br>"+txt+"<br>json序列请查看控制台");
console.log(rs);
});
});
seajs.use("seajs-modal-common",function(modal){
modal.int({
content:"<div style='color:black;white-space:nowrap'>我是通用模态框</div>",
hasBac:false,
canClickOut:true
});
bindClick("seajs_modal_common_show",function(){
modal.show();
});
bindClick("seajs_modal_common_hide",function(){
modal.hide();
});
});
seajs.use("seajs-ajaxForm",function(myForm){
myForm.onFormResult=function(rs,actionName,txt){
showTip("返回文本如下:<br>"+txt+"<br>json序列请查看控制台");
console.log(rs);
}
});
seajs.use("seajs-searchIpt",function(o){
var rnum=1;
o.int({
iptId:"seajs_searchIpt_ipt",
url:assetsUrl+"http.txt",
searchKey:"searchKey",
draw:function(rs){
utils.$id("seajs_searchIpt_draw").innerHTML=rs.msg+"(请求次数:"+(rnum++)+"(插件做了输入延时处理,所以请求数<=输入次数))";
}
});
});
seajs.use("seajs-sendVerifyCode",function(o){
var mobileIpt=utils.$id("seajs_sendVerifyCode_mobile");
o.int({
sendBtn:utils.$id("seajs_sendVerifyCode"),
validIpts:mobileIpt,
onSuccess:function(rs){
showTip("验证码发送成功!返回结果:<br>"+rs.msg);
},
url:assetsUrl+"http.txt",
parameters:function(){
return "mobile"+mobileIpt.value
}
});
});
seajs.use("seajs-upload",function(o){
o.int({
maxFileSize:1024*1024,
uploadUrl:"http://www.51xuelicai.com/file/image",
uploadIpts:utils.$id("seajs_upload_cont").getElementsByTagName("input"),
onUploadFinish:function(rs){
if(rs.code!=0){
showTip(rs.msg,false);
return;
}
showTip("文件上传成功!请查看控制台返回内容");
console.log(rs);
}
});
});
seajs.use("seajs-uploadImgs",function(o){
o.int({
subBtn:utils.$id("seajs_uploadImgs_subBtn"),
uploadUrl:"http://www.51xuelicai.com/file/image",
imgArray:utils.$id("seajs_uploadImgs_cont").getElementsByTagName("img"),
name:"file",
onUploadFinish:function(rs,index){
if(rs.code!=0){
showTip(rs.msg,false);
return;
}
showTip("第"+index+"张图片上传成功!请查看控制台返回内容");
console.log(rs);
},
removeFuc:function(index){
showTip("取消成功!index:"+index);
},
maxFileSize:1024*1024
});
});
bindClick("seajs_waiting_show",function(o){
o.show("我是等待画面,将在3秒后自动消失");
setTimeout(o.hide,3000);
});
bindClick("seajs_autoPage_mode1_start",function(o){
this.setAttribute("disabled","true");
o.int({
contId:"seajs_autoPage_mode1",
url:assetsUrl+"autoPage.txt",
dataKey:"result.data",
pageNow:"pageNo=1",
pageSize:"pageSize=5",
draw:"<div>{content}</div>",
isLoadOver:function(){
return false;
}
});
});
bindClick("seajs_autoPage_mode2_start",function(o){
this.setAttribute("disabled","true");
o.newInstance().int({
contId:"seajs_autoPage_mode2",
url:assetsUrl+"autoPage.txt",
dataKey:"result.data",
pageNow:"pageNo=1",
pageSize:"pageSize=5",
draw:"<div>{content}</div>",
loadMode:1,
isLoadOver:function(){
return false;
}
});
});
bindClick("seajs_passwordWidget_ipt",function(o){
var that=this;
o.onFinish=function(pwd){
that.value=pwd;
}
o.show();
});
seajs.use("seajs-switchButton",function(o){
o.int({
name:"滑动按钮1",
parentNode:utils.$id("seajs_switchButton"),
onChange:function(state){
showTip("按钮1当前状态:"+state);
}
})
o.newInstance().int({
name:"滑动按钮2",
parentNode:utils.$id("seajs_switchButton"),
isOn:true,
onChange:function(state){
showTip("按钮2当前状态:"+state);
}
})
});
bindClick("seajs_topTip",function(o){
o.show("我是顶部通知")
})
bindClick("seajs_gritter",function(o){
o.show("成功通知");
o.show("错误通知",false);
})
bindClick("seajs_tablePage_btn",function(o){
o.int({
"table":"seajs_tablePage_table",
"url":assetsUrl+"tablePage.txt",
"dataKey":"result.data",
"pageTotalKey":"result.totalPage",
"pageNow":"pageNo=1",
"pageSize":"pageSize=5",
"data":[
"{t1}",
"{t2}",
"{t3}"
]
});
});
//seajs-calendar
var now=new Date(),
start=new Date(),
end=new Date();
start.setFullYear(now.getFullYear()-90);
end.setFullYear(now.getFullYear()-18);
seajs.use("seajs-calendar",function(calendar){
calendar.bind($(".calendarIpt"),{
selectedRang:[start,end]
});
});
});
</script>
</body>
</html>