1/* 2 * drag 1.0 3 * create by [email protected] 4 * date 2015-08-18 5 * æå¨æ»å 6 */ 7var intvalidCode = "0"; 8var intvalidCode2 = "0"; 9var dragWiht=0; 10(function ($) { 11 $.fn.drag = function (options) { 12 var x, drag = this, isMove = false, defaults = { 13 }; 14 var options = $.extend(defaults, options); 15 //æ·»å èæ¯ï¼æåï¼æ»å 16 var html = '<div class="drag_bg"></div>' + 17 '<div class="drag_text" onselectstart="return false;" unselectable="on">æå¨æ»åéªè¯</div>' + 18 '<div class="handler handler_bg"></div>'; 19 this.html(html); 20 21 var handler = drag.find('.handler'); 22 var drag_bg = drag.find('.drag_bg'); 23 var text = drag.find('.drag_text'); 24 var maxWidth = drag.width() - handler.width(); //è½æ»å¨çæå¤§é´è· 25 if (maxWidth<=0 && dragWiht>0) { 26 maxWidth = dragWiht; 27 } 28 dragWiht = maxWidth; 29 //é¼ æ æä¸æ¶åçxè½´çä½ç½® 30 handler.mousedown(function (e) { 31 isMove = true; 32 x = e.pageX - parseInt(handler.css('left'), 10); 33 }); 34 35 //é¼ æ æéå¨ä¸ä¸æç§»å¨æ¶ï¼ç§»å¨è·ç¦»å¤§äº0å°äºæå¤§é´è·ï¼æ»åxè½´ä½ç½®çäºé¼ æ ç§»å¨è·ç¦» 36 $(document).mousemove(function (e) { 37 var _x = e.pageX - x; 38 if (isMove) { 39 if (_x > 0 && _x <= maxWidth) { 40 handler.css({ 'left': _x }); 41 drag_bg.css({ 'width': _x }); 42 } else if (_x > maxWidth) { //é¼ æ æéç§»å¨è·ç¦»è¾¾å°æå¤§æ¶æ¸ 空äºä»¶ 43 handler.css({ 'left': maxWidth }); 44 drag_bg.css({ 'width': maxWidth }); 45 dragOk(); 46 } 47 } 48 }).mouseup(function (e) { 49 isMove = false; 50 var _x = e.pageX - x; 51 if (_x < maxWidth) { //é¼ æ æ¾å¼æ¶ï¼å¦ææ²¡æè¾¾å°æå¤§è·ç¦»ä½ç½®ï¼æ»åå°±è¿ååå§ä½ç½® 52 handler.css({ 'left': 0 }); 53 drag_bg.css({ 'width': 0 }); 54 } 55 }); 56 57 //æ¸ ç©ºäºä»¶ 58 function dragOk() { 59 handler.removeClass('handler_bg').addClass('handler_ok_bg'); 60 text.text('éªè¯éè¿'); 61 drag.css({ 'color': '#fff' }); 62 handler.unbind('mousedown'); 63 $(document).unbind('mousemove'); 64 $(document).unbind('mouseup'); 65 intvalidCode = CommonFunc.DragOk().value; 66 // login(validCode); 67 if (options.type == 2) { 68 //æå¨éªè¯æå 69 intvalidCode2 = intvalidCode; 70 } else { 71 DragOklogin(); 72 } 73 } 74 }; 75})(jQuery); 76//æ¸ ç©ºäºä»¶ 77function Cleardrag() { 78 jQuery('#drag').drag({type: 1}); 79 $('#drag').css("color", ""); 80 intValidCode = "0"; 81} 82function Cleardrag2() { 83 jQuery('#drag2').drag({type: 2}); 84 $('#drag2').css("color", ""); 85 intValidCode2 = "0"; 86} 87function Cleardrag3() { 88 jQuery('#drag').drag({ type: 2 }); 89 $('#drag2').css("color", ""); 90 intValidCode2 = "0"; 91} 92function DragOklogin() { 93 if ($("#txtUserName").val().length < 1) { 94 Boxy.hide(); 95 Boxy.alert('请填åç¨æ·åï¼', function () { $("#txtUserName").focus(); }, { title: "é误", modal: true, closeable: false }); 96 return false; 97 } 98 if ($("#txtPassWord").val().length < 1) { 99 Boxy.hide(); 100 Boxy.alert('请填åå¯ç ï¼', function () { $("#txtPassWord").focus(); }, { title: "é误", modal: true, closeable: false }); 101 return false; 102 } 103 var cbCookies = $("#cbCookies").is(':checked') ? "true" : "false"; 104 $('#btnOk').attr("disabled", "disabled"); 105 var result = CommonFunc.DragCheckLogin(intvalidCode, $("#txtUserName").val(), $("#txtPassWord").val(), cbCookies).value; 106 $('#btnOk').removeAttr("disabled"); 107 if (result == "-1") { 108 Boxy.alert('æ»å¨éªè¯é误ï¼è¯·å·æ°é¡µé¢åéæ°æ»å¨ï¼', '', { title: "é误", modal: true });
109 return false; 110 } else if (result.indexOf("次") > 0) { 111 Boxy.alert("æ¨è¿æ<span style='color:red'>" + result + "</span>æºä¼æ¥å¡«åæ£ç¡®çç¨æ·ååå¯ç ", "", { title: "é误", modal: true }); 112 return false; 113 } else { 114 var jsonOjbect = eval("data=" + result); 115 if (jsonOjbect.Error) { 116 $("#ValidCodeImg").attr("src", "/UserManage/ValidCode.aspx?" + Math.random()); 117 $("#txtValidCode").val(''); 118 if (jsonOjbect.Error == "-2") 119 Boxy.alert('该账å·ä¸åå¨ï¼', '', { title: "é误", modal: true }); 120 else if (jsonOjbect.Error == "-1") 121 Boxy.alert('ç¨æ·åæå¯ç é误ï¼è¯·äºååéåéè¯ã', '', { title: "é误", modal: true }); 122 else if (jsonOjbect.Error == "-3") 123 Boxy.alert('æ¨æ³¨åçé®ç®±æªéªè¯ï¼è¯·éªè¯åéæ°ç»å½ï¼', '', { title: "é误", modal: true }); 124 else if (jsonOjbect.Error == "-4") { 125 Boxy.alert('å¾éæ¾ï¼æ¨é¿æ¶é´æªç»å½ï¼è´¦å·å·²è¢«å»ç»ã<br>请使ç¨APPæ«ç éªè¯ç»å½æèç³»æ¬ç«å®¢æï¼<br>çµè¯ï¼' + $("#CsPhone").val() + '<br>QQï¼' + $("#CsQuin").val(), { title: "é误", modal: true }); 126 } 127 else if (jsonOjbect.Error == "-20230810") { 128 Boxy.alert('å¾éæ¾ï¼æ¨é¿æ¶é´æªç»å½ï¼è´¦å·å·²è¢«å»ç»ã<br>请èç³»æ¬ç«å®¢æ', { title: "é误", modal: true }); 129 } 130 else 131 Boxy.alert('ç»é失败ï¼', '', { title: "é误", modal: true }); 132 return false; 133 } 134 } 135 if (getCookie('gourl') != undefined) { 136 var url = getCookie('gourl'); 137 deleteCookie('gourl'); 138 window.location = url; 139 return true; 140 } 141 if (result == "1") { 142 window.location = '/UserManage/Default.aspx'; 143 } 144 else if (result == "2") { 145 window.location = '/PurchasManage/Default.aspx'; 146 } 147 else 148 window.location = '/UserManage/Default.aspx'; 149 150 return true; 151} 152//jsæ··æ·å å¯å缩 153 154function getCookie(cookie_name) { 155 var allcookies = document.cookie; 156 var cookie_pos = allcookies.indexOf(cookie_name); 157 if (cookie_pos != -1) { 158 cookie_pos += cookie_name.length + 1; 159 var cookie_end = allcookies.indexOf(";", cookie_pos); 160 if (cookie_end == -1) { 161 cookie_end = allcookies.length; 162 } 163 var value = unescape(allcookies.substring(cookie_pos, cookie_end)); 164 } 165 return value; 166} 167function deleteCookie(name) { 168 //è·åå½åæ¶é´ 169 var date = new Date(); 170 //å°date设置为è¿å»çæ¶é´ 171 date.setTime(date.getTime() - 10000); 172 document.cookie = name + "=v; expires=" + date.toGMTString() + ";path=/;domain=ybzhan.cn" ; 173 174}
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.