PageSourceSearch

http://superalphalight.com/static/hn.js

js superalphalight.com collected 2026-10-08 18:33:14 UTC 26,408 bytes, 778 lines download raw bytes

1
2// 弹出层相关
3var hn = {
4    dragging: false,
5    dragX: 0,
6    dragY: 0,
7    dragEl: null,
8    dragBox: null,
9    dragMaxX: 0,
10    dragMaxY: 0,
11    dragHasSet: false,
12    msg: function(text, el, fn) {
13        var hnTip = $("#hnTip")
14        if (!hnTip.length) {
15            hnTip = $('<div class="hn-tip" id="hnTip"><div class="hn-mask"></div><div class="hn-msg"></div></div>')
16            $("body").append(hnTip)
17        }
18        hnTip.find(".hn-msg").html(text || '')
19        setTimeout(function() {
20            hnTip.addClass("show")
21        }, 1)
22        el = el || {}
23        var time = el.time || 1500
24        setTimeout(function() {
25            hnTip.removeClass("show")
26            typeof el == 'function' && el()
27            typeof fn == 'function' && fn()
28        }, time)
29    },
30    load: function(text, el, fn) {
31        var hnLoad = $("#hnLoad")
32        if (!hnLoad.length) {
33            hnLoad = $('<div class="hn-load" id="hnLoad"><div class="hn-mask"></div><div class="hn-load-cont"><div class="hn-load-icon"></div><div class="hn-load-title"></div></div></div>')
34            $("body").append(hnLoad)
35        }
36        hnLoad.find(".hn-load-title").html(text || '')
37        setTimeout(function() {
38            hnLoad.addClass("show")
39        }, 1)
40        el = el || {}
41        var time = el.time || 360000
42        setTimeout(function() {
43            hnLoad.removeClass("show")
44            typeof el == 'function' && el()
45            typeof fn == 'function' && fn()
46        }, time)
47    },
48    hideLoad: function() {
49        $("#hnLoad").removeClass("show")
50    },
51    confirm: function(el) {
52        var hnConfirm = $("#hnConfirm")
53        if (!hnConfirm.length) {
54            hnConfirm = $('<div class="hn-confirm" id="hnConfirm"><div class="hn-mask"></div><div class="hn-confirm-dialog"><div class="hn-confirm-title"></div><div class="hn-confirm-close" onclick="hn.hideConfirm()">✕</div><div class="hn-confirm-cont"></div><div class="hn-confirm-btns"></div></div></div>')
55            $("body").append(hnConfirm)
56        }
57        hn.dragEl = hnConfirm.find(".hn-confirm-title")
58        hn.dragBox = hnConfirm.find(".hn-confirm-dialog")
59        hn.setDrag()
60        hn.dragEl.text(el.title || '')
61        hnConfirm.find(".hn-confirm-cont").text(el.content || '')
62        var btns = hnConfirm.find(".hn-confirm-btns")
63        btns.html('')
64        if (el.btn.length) {
65            for (var i = 0; i < el.btn.length; i++) {
66                if (i == 0) {
67                    $('<a class="c-btn c-blue">' + el.btn[i] + '</a>').appendTo(btns)
68                } else {
69                    $('<a class="c-btn c-white">' + el.btn[i] + '</a>').appendTo(btns)
70                }
71            }
72        }
73        if (el.callback.length) {
74            var cbtn = btns.find(".c-btn")
75            for (var i = 0; i < el.callback.length; i++) {
76                cbtn.eq(i).on("click", el.callback[i])
77            }
78        }
79        hn.dragBox.css({
80            left: ($(window).width() - hn.dragBox.outerWidth()) / 2,
81            top: ($(window).height() - hn.dragBox.outerHeight()) / 2
82        })
83        setTimeout(function() {
84            hnConfirm.addClass("show")
85        }, 1)
86    },
87    hideConfirm: function() {
88        $("#hnConfirm").removeClass("show")
89    },
90    open: function(el) {
91        var hnHtml = $("#hnHtml")
92        if (!hnHtml.length) {
93            hnHtml = $('<div class="hn-html" id="hnHtml"><div class="hn-mask"></div><div class="hn-html-dialog"><div class="hn-html-title"></div><div class="hn-html-close" onclick="hn.hideOpen()">✕</div><div class="hn-html-cont"></div></div></div>')
94            $("body").append(hnHtml)
95        }
96        hn.dragEl = hnHtml.find(".hn-html-title")
97        hn.dragBox = hnHtml.find(".hn-html-dialog")
98        hn.setDrag()
99        hn.dragEl.text(el.title || '')
100        var cont = hnHtml.find(".hn-html-cont")
101        cont.html(el.content || '')
102        var area = el.area || [600, 338]
103        cont.css({
104            width: area[0],
105            height: area[1] - hn.dragEl.outerHeight()
106        })
107        hn.dragBox.css({
108            left: ($(window).width() - hn.dragBox.outerWidth()) / 2,
109            top: ($(window).height() - hn.dragBox.outerHeight()) / 2
110        })
111        setTimeout(function() {
112            hnHtml.addClass("show")
113        }, 1)
114    },
115    hideOpen: function() {
116        $("#hnHtml").removeClass("show")
117    },
118    //让弹窗可拖动
119    setDrag: function() {
120        hn.dragEl.off("mousedown").on("mousedown", function(e) {
121            hn.dragX = e.offsetX
122            hn.dragY = e.offsetY
123            hn.dragMaxX = $(window).width() - hn.dragBox.outerWidth()
124            hn.dragMaxY = $(window).height() - hn.dragBox.outerHeight()
125            hn.dragging = true
126        })
127        if (hn.dragHasSet) {
128            return
129        } else {
130            hn.dragHasSet = true
131        }
132        $(document).on("mousemove", function(e) {
133            if (hn.dragging) {
134                var x = e.pageX - hn.dragX - $(window).scrollLeft()
135                var y = e.pageY - hn.dragY - $(window).scrollTop()
136                x = x < 0 ? 0 : x
137                y = y < 0 ? 0 : y
138                x = x > hn.dragMaxX ? hn.dragMaxX : x
139                y = y > hn.dragMaxY ? hn.dragMaxY : y
140                hn.dragBox.css({
141                    left: x,
142                    top: y
143                })
144            }
145        })
146        $(document).on("mouseup", function(e) {
147            hn.dragging = false
148        })
149    }
150}
151
152
153//url 参数使用
154//非获取地址栏异步处理
155/**
156 *参数  _name:参数名     _value:参数值
157 @ps    此函数默认使用的url模式为普通模式,在使用thinkphp等支持pathinfo url地址模式的框架时,请填写上第三个参数'/'
158 @ps2   2014/5/26 增加有子目录的pathinfo地址的支持(制作英文版可以会用到),第四个参数为子目录,如:"/en"
159 @例如  js_aup('p','3','/','/en');
160 */
161function js_aup_jump(_name, _value,_id,delimter,subcatalog,just_return,location_search) {
162    //var delimter = arguments[3] || '&';
163    //var subcatalog = arguments[4] || '';
164    //var just_return = arguments[5] || false;
165    //var location_search = arguments[5] || location.search;
166    var location_search = location_search || $('#href_value').val();
167    var newurl = '';
168    if (delimter == '/') { //pathinfo模式
169        var query_string = location.pathname.replace(subcatalog, '');
170        var arr = query_string.split('/');
171        var paremters_obj = {};
172        for (var i = 4; i < arr.length; i += 2) {
173            paremters_obj[arr[i]] = arr[i + 1];
174        }
175        if (_value === null) {
176            delete (paremters_obj[_name]);
177        } else {
178            paremters_obj[_name] = _value;
179        }
180        for (var key in paremters_obj) {
181            newurl += key + '/' + paremters_obj[key] + '/';
182        }
183        newurl = subcatalog + '/' + arr[1] + '/' + arr[2] + '/' + arr[3] + '/' + newurl.substr(0, newurl.length - 1);
184    } else { //普通模式
185        var paramters = location_search.getQuery();
186        //console.log(paramters)
187        if (paramters == false) {
188            if (_value === null){
189                newurl='';
190            }else{
191                newurl = '?' + _name + '=' + _value;
192            }
193        } else {
194            if (_value === null) {
195                delete (paramters[_name]);
196            } else {
197                paramters[_name] = _value;
198            }
199            for (var key in paramters) {
200                newurl += key + '=' + paramters[key] + '&';
201            }
202            newurl = '?' + newurl.substr(0, newurl.length - 1);
203        }
204    }
205
206    if (newurl == '?') {
207        newurl = document.url || location.href;
208        newurl = newurl.replace(location.search, '');
209    }
210    /*if (_id != null || _id != '' || _id !=undefined){
211        var str = '#'+_id;
212        newurl = newurl.replace(str, '');
213        newurl = newurl+'#'+_id;
214    }*/
215    if (just_return) {
216        console.log(newurl)
217        return newurl;
218    } else {
219        return newurl;
220        //location.href = newurl;
221    }
222    console.log(newurl);
223}
224//多选的追加地址参数函数  Create By TuJia @2014/10/27
225/**
226 *参数  _name:参数名     _value:参数值
227 */
228function js_aup2_jump(_name, _value,_id,delimter,subcatalog,just_return,location_search) {
229    //var the_value = location.search.getQuery(_name) || '';//获取地址参数
230    var the_value = location_search.getQuery(_name) || '';//获取地址参数
231    var value_arr = the_value ? the_value.split(',') : [];//转换成数组
232    if (value_arr.find(_value) < 0) { //不存在,追加
233        value_arr.push(_value);
234        the_value = value_arr.join(',');
235    }
236   return  js_aup_jump(_name, the_value,_id,delimter,subcatalog,just_return,location_search);
237}
238//交换的追加地址参数函数  Create By TuJia @2014/10/27
239/**
240 *功能  存在则去除,不存在就添加
241 *参数  _name:参数名     _value:参数值
242 */
243function js_aup3_jump(_name,_id, _value, just_return, location_search) {
244    //var the_value = location.search.getQuery(_name) || '';//获取地址参数
245    var the_value = $('#href_value').val();
246    if (the_value == '') return false;
247    if (the_value) _value = null;
248
249    if (just_return) {
250        return js_aup_jump(_name, _value,_id, '', '', true, location_search);
251    } else {
252        js_aup_jump(_name, _value,_id);
253    }
254}
255//取消多选地址参数  Create By TuJia @2014/11/9
256/**
257 *功能  js_aup2对应的取消函数
258 *参数  _name:参数名     _value:参数值
259 */
260function js_aup4_jump(_name,_id,_value, just_return, location_search) {
261    var the_value = location_search.getQuery(_name) || '';//获取地址参数
262    if (the_value == _value) {//只剩下唯一值
263        return js_aup3_jump(_name,_id, _value, just_return, location_search);
264        //return false;
265    }
266    var value_arr = the_value ? the_value.split(',') : [];//转换成数组
267    var _index = value_arr.find(_value);
268    if (_index < 0) {//不存在,追加
269        value_arr.push(_value);
270    } else {
271        value_arr.remove(_index);
272    }
273    the_value = value_arr.join(',');
274    return js_aup_jump(_name, the_value,_id, '', '', just_return, location_search);
275}
276//获取地址栏
277//追加地址参数(参数不存在则追加,参数存在则修改)
278/**
279 *参数  _name:参数名     _value:参数值
280 @ps    此函数默认使用的url模式为普通模式,在使用thinkphp等支持pathinfo url地址模式的框架时,请填写上第三个参数'/'
281 @ps2   2014/5/26 增加有子目录的pathinfo地址的支持(制作英文版可以会用到),第四个参数为子目录,如:"/en"
282 @例如  js_aup('p','3','/','/en');
283 */
284function js_aup(_name, _value,_id,delimter,subcatalog,just_return,location_search) {
285    var delimter = arguments[2] || '&';
286    var subcatalog = arguments[3] || '';
287    var just_return = arguments[4] || false;
288    var location_search = arguments[5] || location.search;
289    var newurl = '';
290    if (delimter == '/') { //pathinfo模式
291        var query_string = location.pathname.replace(subcatalog, '');
292        var arr = query_string.split('/');
293        var paremters_obj = {};
294        for (var i = 4; i < arr.length; i += 2) {
295            paremters_obj[arr[i]] = arr[i + 1];
296        }
297        if (_value === null) {
298            delete (paremters_obj[_name]);
299        } else {
300            paremters_obj[_name] = _value;
301        }
302        for (var key in paremters_obj) {
303            newurl += key + '/' + paremters_obj[key] + '/';
304        }
305        newurl = subcatalog + '/' + arr[1] + '/' + arr[2] + '/' + arr[3] + '/' + newurl.substr(0, newurl.length - 1);
306    } else { //普通模式
307        var paramters = location_search.getQuery();
308        if (paramters == false) {
309            newurl = '?' + _name + '=' + _value;
310        } else {
311            if (_value === null) {
312                delete (paramters[_name]);
313            } else {
314                paramters[_name] = _value;
315            }
316            for (var key in paramters) {
317                newurl += key + '=' + paramters[key] + '&';
318            }
319            newurl = '?' + newurl.substr(0, newurl.length - 1);
320        }
321    }
322
323    if (newurl == '?') {
324        newurl = document.url || location.href;
325        newurl = newurl.replace(location.search, '');
326    }
327    /*if (_id != null || _id != '' || _id !=undefined){
328        var str = '#'+_id;
329        newurl = newurl.replace(str, '');
330        newurl = newurl+'#'+_id;
331    }*/
332    if (just_return) {
333        return newurl;
334    } else {
335        location.href = newurl;
336    }
337}
338function js_aup11(_name, _value,_id,delimter,subcatalog,just_return,location_search) {
339    var delimter = arguments[2] || '&';
340    var subcatalog = arguments[3] || '';
341    var just_return = arguments[4] || false;
342    var newurl = '';
343    if (delimter == '/') { //pathinfo模式
344        var query_string = location.pathname.replace(subcatalog, '');
345        var arr = query_string.split('/');
346        var paremters_obj = {};
347        for (var i = 4; i < arr.length; i += 2) {
348            paremters_obj[arr[i]] = arr[i + 1];
349        }
350        if (_value === null) {
351            delete (paremters_obj[_name]);
352        } else {
353            paremters_obj[_name] = _value;
354        }
355        for (var key in paremters_obj) {
356            newurl += key + '/' + paremters_obj[key] + '/';
357        }
358        newurl = subcatalog + '/' + arr[1] + '/' + arr[2] + '/' + arr[3] + '/' + newurl.substr(0, newurl.length - 1);
359    } else { //普通模式
360        var paramters = location_search.getQuery();
361        if (paramters == false) {
362            newurl = '?' + _name + '=' + _value;
363        } else {
364            if (_value === null) {
365                delete (paramters[_name]);
366            } else {
367                paramters[_name] = _value;
368            }
369            for (var key in paramters) {
370                newurl += key + '=' + paramters[key] + '&';
371            }
372            newurl = '?' + newurl.substr(0, newurl.length - 1);
373        }
374    }
375
376    if (newurl == '?') {
377        newurl = document.url || location.href;
378        newurl = newurl.replace(location.search, '');
379    }
380    /*if (_id != null || _id != '' || _id !=undefined){
381        var str = '#'+_id;
382        newurl = newurl.replace(str, '');
383        newurl = newurl+'#'+_id;
384    }*/
385    return newurl;
386}
387//多选的追加地址参数函数  Create By TuJia @2014/10/27
388/**
389 *参数  _name:参数名     _value:参数值
390 */
391function js_aup2(_name, _value,_id,delimter,subcatalog,just_return,location_search) {
392    var the_value = location.search.getQuery(_name) || '';//获取地址参数
393    var value_arr = the_value ? the_value.split(',') : [];//转换成数组
394    if (value_arr.find(_value) < 0) { //不存在,追加
395        value_arr.push(_value);
396        the_value = value_arr.join(',');
397    }
398    js_aup(_name, the_value,_id,delimter,subcatalog,just_return,location_search);
399}
400function js_aup22(_name, _value,_id,delimter,subcatalog,just_return,location_search) {
401    var the_value = location_search.getQuery(_name) || '';//获取地址参数
402    var value_arr = the_value ? the_value.split(',') : [];//转换成数组
403    if (value_arr.find(_value) < 0) { //不存在,追加
404        value_arr.push(_value);
405        the_value = value_arr.join(',');
406    }
407    return  value_arr;
408}
409
410//交换的追加地址参数函数  Create By TuJia @2014/10/27
411/**
412 *功能  存在则去除,不存在就添加
413 *参数  _name:参数名     _value:参数值
414 */
415function js_aup3(_name,_id, _value, just_return, location_search) {
416    var location_search = location_search || location.search;
417    var the_value = location_search.getQuery(_name) || '';//获取地址参数
418    if (the_value == '') return false;
419    if (the_value) _value = null;
420
421    if (just_return) {
422        return js_aup(_name, _value,_id, '', '', true, location_search);
423    } else {
424        js_aup(_name, _value,_id);
425    }
426}
427
428
429//取消多选地址参数  Create By TuJia @2014/11/9
430/**
431 *功能  js_aup2对应的取消函数
432 *参数  _name:参数名     _value:参数值
433 */
434function js_aup4(_name, _value) {
435    var the_value = location.search.getQuery(_name) || '';//获取地址参数
436    if (the_value == _value) {//只剩下唯一值
437        js_aup3(_name, _value);
438        return false;
439    }
440    var value_arr = the_value ? the_value.split(',') : [];//转换成数组
441    var _index = value_arr.find(_value);
442    if (_index < 0) {//不存在,追加
443        value_arr.push(_value);
444    } else {
445        value_arr.remove(_index);
446    }
447    the_value = value_arr.join(',');
448    js_aup(_name, the_value);
449}
450
451
452//追加多个参数
453function js_aup5(param,_id) {
454    var newurl = '';
455    for (var i = 0, len = param.length; i < len; i++) {
456        newurl = js_aup(param[i]['_name'], param[i]['_value'],_id, '&', '', true, newurl);
457    }
458    location.href = newurl;
459}
460
461
462//删除某个参数再追加
463function js_aup6(_name, _value, _cancel) {
464    var location_search = js_aup3(_cancel, '', true);
465    js_aup(_name, _value, '', '', '', location_search);
466}
467
468
469//删除多个参数
470function js_aup7() {
471    var len = arguments.length;
472    var location_search = '';
473    for (var i = 0; i < len; i++) {
474        if (location.search.getQuery(arguments[i]) == undefined) continue;
475        location_search = js_aup3(arguments[i], '', true, location_search);
476    }
477    location.href = location_search;
478}
479//删除多个参数   一键清空筛选条件
480function js_aup8(){
481    var name,value;
482    var location_search = '';
483    var str=location.href; //取得整个地址栏
484    var num=str.indexOf("?");
485    str = str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]
486    var arr=str.split("&"); //各个参数放到数组里
487    // console.log(arr);return false;
488    for(var i=0;i < arr.length;i++){
489        num=arr[i].indexOf("=");
490        if(num>0){
491            name=arr[i].substring(0,num);
492            value=arr[i].substr(num+1);
493            location_search = js_aup3(name,'',true,location_search);
494            // this[name]=value;
495        }
496    }
497    location.href = location_search;
498}
499//获取字符串里的参数
500//例如:var id = location.search.getQuery('id');
501/**
502 *参数  _name:参数名(选填,不填返回所有参数)
503 */
504String.prototype.getQuery = function () {
505    var url = this;
506    var offset = url.indexOf('?');
507    if (offset == -1) return false;
508    offset += 1;
509    url = url.substr(offset);
510    var arr = url.split('&');
511    var args = new Object();
512    arr.forEach(function (_this) {
513        var arr2 = _this.split('=');
514        args[arr2[0]] = UrlDecode(arr2[1]);
515    });
516
517    var _name = arguments[0] || null;
518    return _name ? args[_name] : args;
519}
520
521
522//删除数组元素
523/**
524 *参数  dx:数组索引
525 */
526Array.prototype.remove = function (dx) {
527    if (isNaN(dx) || dx > this.length) {
528        return false;
529    }
530    for (var i = 0, n = 0; i < this.length; i++) {
531        if (this[i] != this[dx]) {
532            this[n++] = this[i];
533        }
534    }
535    this.length -= 1;
536}
537
538//数组查找元素
539/**
540 *参数  _value:数组索引
541 */
542Array.prototype.find = function (_value) {
543    for (var i = 0, len = this.length; i < len; i++) {
544        if (this[i] == _value) {
545            return i;
546            break;
547        }
548    }
549    return -1;
550}
551
552//js版本 urldecode
553function UrlDecode(zipStr) {
554    var uzipStr = "";
555    for (var i = 0; i < zipStr.length; i++) {
556        var chr = zipStr.charAt(i);
557        if (chr == "+") {
558            uzipStr += " ";
559        } else if (chr == "%") {
560            var asc = zipStr.substring(i + 1, i + 3);
561            if (parseInt("0x" + asc) > 0x7f) {
562                uzipStr += decodeURI("%" + asc.toString() + zipStr.substring(i + 3, i + 9).toString());
563                i += 8;
564            } else {
565                uzipStr += AsciiToString(parseInt("0x" + asc));
566                i += 2;
567            }
568        } else {
569            uzipStr += chr;
570        }
571    }
572
573    return uzipStr;
574}
575
576function AsciiToString(asccode) {
577    return String.fromCharCode(asccode);
578}
579
580//验证手机格式
581function checkMobile(mobile){
582    console.log(mobile);
583    if(mobile.length == 0){
584        hn.msg("请输入手机");
585        return false;
586    }
587    if(mobile.length != 11){
588        hn.msg('请输入有效的手机号码');
589        return false;
590    }
591    var cMobile = /^1[3-9]\d{9}$/;
592    if(!cMobile.test(mobile)){
593        hn.msg('请输入有效的手机号码');
594        return false;
595    }
596    return true;
597}
598
599/**
600 * 获取手机验证码
601 * @param send_type 发短信类型 1 用户注册/修改手机 2找回密码 3绑定第三方账号 4留言短信验证
602 * @param sendButton
603 * @param webUrl
604 * @param id
605 * @param code_id
606 * @returns {boolean}
607 */
608function getCode(send_type,sendButton,webUrl,id,code_id){
609    var mobile = $("#"+id).val();
610    if (mobile == '' || mobile == 0 || mobile == undefined){
611        hn.msg("请输入手机");
612        return false;
613    }
614    if(!checkMobile(mobile)){
615        return false;
616    }
617    var captcha = '';
618    /*if(send_type==2 || send_type==3){
619        //判断验证码
620        captcha = $("#code").val();
621        if(mobile.captcha == 0){
622            hn.msg("请输入验证码");
623            return false;
624        }
625    }*/
626    $.ajax({
627        url: webUrl,
628        type: 'POST',
629        data: {send_type:send_type,mobile:mobile,captcha:captcha},
630        dataType: 'json',
631        success: function (res) {
632            if(res.code == 1){
633                countDown(sendButton);
634                // alert(sendButton.val('60'));
635            }else{
636                $('#'+code_id).val('').focus();
637                // changCaptcha();
638            }
639            hn.msg(res.msg,{time:1500},function() {
640                if (res.code === 1) {
641                    // window.location.href = '/home/user/security';
642                }
643            });
644        }
645    })
646    return false;
647}
648
649
650//验证邮箱格式
651function checkEmail(email){
652    if(email.length == 0){
653        hn.msg("Please enter your email");
654        return false;
655    }
656    var email_reg  = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
657    if (!email_reg.test(email)) {
658        hn.msg("Please enter the correct email address");
659        return false;
660    }
661    return true;
662}
663
664/**
665 * 获取邮箱验证码
666 * @param send_type 发邮箱类型 1 用户注册/修改邮箱 2找回密码 3绑定第三方账号
667 * @param sendButton
668 * @param webUrl     请求访问地址
669 * @param id
670 * @param code_id
671 * @returns {boolean}
672 */
673function getEmailCode(send_type,sendButton,webUrl,id,code_id,lang){
674    var email = $("#"+id).val();
675    if(!checkEmail(email)){
676        $("#"+id).focus();
677        return false;
678    }
679    var captcha = '';
680    if(send_type==2 || send_type==3){
681        //判断验证码
682        captcha = $("#captcha").val();
683        if(email.captcha == 0){
684            hn.msg('Please enter your code');
685            return false;
686        }
687    }
688    $.ajax({
689        url: webUrl,
690        type: 'POST',
691        data: {send_type:send_type,email:email,captcha:captcha,lang:lang},
692        dataType: 'json',
693        success: function (res) {
694            if(res.code == 1){
695                countDown(sendButton);
696            }else{
697                if(send_type==2 || send_type==3) {
698                    $('#captcha').val('').focus();
699                    changCaptcha();
700                }
701                $('#'+code_id).val('').focus();
702            }
703            hn.msg(res.msg,{time:1500},function() {
704                if (res.code === 1) {
705                    // window.location.href = '/home/user/security';
706                }
707            });
708        }
709    })
710    return false;
711}
712
713//发 短信/邮箱 倒计时
714var wait = 60;
715function countDown(obj,msg){
716    obj = $(obj);
717    if(wait == 0){
718        obj.removeAttr("disabled");
719        obj.removeClass("gray");
720        //obj.val('获取验证码');
721        //obj.children('span').html('获取验证码');
722        obj.text('Obtain verification code');
723        wait = 60;
724    }else{
725        if(msg == undefined || msg == null){
726            msg = obj.val();
727        }
728        obj.attr("disabled","disabled");
729        obj.addClass("gray");
730        //obj.children('span').html(wait + '秒');
731        obj.text('Remaining ' + wait + "s");
732        //obj.val(wait + '秒');
733        wait--;
734        setTimeout(function(){
735            countDown(obj,msg)
736        },1000)
737    }
738}
739//退出登录
740function logoutUser(url) {
741    hn.confirm({
742        title: "Tips",
743        content: "Are you sure you want to log out?",
744        btn:["Confirm","Cancel"],
745        callback:[
746            function(){
747                hn.hideConfirm();
748                hn.load();// loading层
749                $.ajax({
750                    url: url,
751                    type: 'POST',
752                    data: {},
753                    dataType: 'Json',
754                    success: function(res){
755                        if (res.code == 1)
756                        {
757                            hn.hideLoad();// 关闭loading层
758                            window.location.href = "/home/auth/login";
759                        }else{
760                            hn.msg(res.msg);
761                            hn.hideLoad();// 关闭loading层
762                        }
763                    },
764                    error: function (){
765                        hn.msg('Request exception');
766                        hn.hideLoad();// 关闭loading层
767                    }
768                });
769            },
770            function(){
771                hn.hideConfirm();
772            }
773        ]
774    })
775    return false;
776}
777
778

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.