1//placeholder 2(function($){ 3 if($.fn.placeholder){return;} 4 $.fn.placeholder = function () { 5 var fnFocus = function () { 6 $(this).addClass('ph-wrap-focus').find('input').focus(); 7 } 8 var fnPaste=function(e) { 9 $(this).parent().addClass('ph-wrap-has'); 10 } 11 var fnKey = function () { 12 this.value != '' ? $(this).parent().addClass('ph-wrap-has') : ''; 13 } 14 var fnBlur = function () { 15 if ($.trim(this.value) == '') { 16 $(this).val('').parent().removeClass('ph-wrap-has ph-wrap-focus'); 17 } 18 } 19 return this.each(function () { 20 var $this = $(this), dSpan = $('<span/>', { 'class': 'placeholder', text: $this.attr('placeholder') }); 21 dWrap = $('<div/>', { 'class': 'ph-wrap', click: fnFocus }); 22 $this.wrap(dWrap).before(dSpan).bind({ keyup: fnKey, blur: fnBlur,paste:fnPaste }); 23 if ($.trim(this.value) != '') { 24 $this.parent().addClass('ph-wrap-has'); 25 } 26 }) 27 } 28 // æ£æµ placeholder æ¯æ 29 $(function(){ 30 var supportPlaceholder = 'placeholder' in document.createElement('input'); 31 if (!supportPlaceholder) { 32 $('input[placeholder]').placeholder(); 33 } 34 }); 35 window.onload=function(){ 36 $('.ph-wrap input').each(function () { 37 if ($.trim(this.value) != '') { 38 $(this).parent().addClass('ph-wrap-has'); 39 } 40 }); 41 } 42})(jQuery); 43//è¾å ¥å¯ç æ¶éªè¯capslk 44(function($) { 45 var curID = 0;// 46 $.fn.extend({ 47 capsLockTip : function(options) { 48 options = $.extend({}, $.CapsLockTip.defaults, options); 49 return this.each(function() { 50 new $.CapsLockTip($(this),options); 51 }); 52 } 53 }); 54 $.CapsLockTip = function(input,options) { 55 // 设置å½åå®ä¾çé ç½®åæ°ã 56 var _this = this; 57 var width=options.width;// 设置èªå¨å®ææ¡ç宽度 58 width = width < $(input).width()?$(input).width():width; 59 var $input = $(input).attr("curCapsLockId", curID++); 60 var $div = $("#autocapsLock" + $input.attr("curCapsLockId")).length != 0 ? $("#autocapsLock" 61 + $input.attr("curCapsLockId")) 62 : $("<div/>").attr("id", 63 "autocapsLock" + $input.attr("curCapsLockId")).css({ 64 "padding-top" : "3px", 65 position : "absolute", 66 "z-index" : "99999" 67 }).css("width",width) 68 .css("left", $input.offset().left + "px") 69 .css("top", $input.offset().top + 35 + 3 + "px") 70 .appendTo("body").text(options.text).hide(); 71 if(!$div.attr("class")&&options.styleClass){ 72 $div.addClass(options.styleClass); 73 }else{ 74 $div.css({color : "#555555", 75 "font-size" : "12px", 76 border : "solid 1px #ffeab9", 77 "border-bottom-color" : "#ffeab9", 78 "border-right-color" : "#ffeab9", 79 "background":"#ffffcc" 80 }); 81 } 82 $input.bind("keypress", function(_event) { 83 if($.fn.capsLockTip.capsLockActived){return;} 84 var e = _event || window.event; 85 var kc = e.keyCode || e.which;// æé®çkeyCode 86 var isShift = e.shiftKey || (kc == 16) || false;// shift鮿¯å¦æä½ 87 $.fn.capsLockTip.capsLockActived = false; 88 if ((kc >= 65 && kc <= 90 && !isShift) 89 || (kc >= 97 && kc <= 122 && isShift)) 90 $.fn.capsLockTip.capsLockActived = true; 91 _this.showTips($.fn.capsLockTip.capsLockActived); 92 }); 93 $input.bind("keydown",function(_event) { 94 var e = _event || window.event; 95 var kc = e.keyCode || e.which; 96 if (kc == 20&& null != $.fn.capsLockTip.capsLockActived) { 97 $.fn.capsLockTip.capsLockActived = !$.fn.capsLockTip.capsLockActived; 98 _this.showTips($.fn.capsLockTip.capsLockActived); 99 } 100 }); 101 $input.bind("focus", function(_event) { 102 if (null != $.fn.capsLockTip.capsLockActived) 103 _this.showTips($.fn.capsLockTip.capsLockActived); 104 }); 105 $input.bind("blur", function(_event) { 106 _this.showTips(false); 107 }); 108 //Show or hide the Caps Lock prompt. 109 this.showTips = function(display) { 110 if (display) { 111 $div.show(); 112 } else { 113 $div.hide(); 114 } 115 }; 116 // Caps Lock key state 117 $.fn.capsLockTip.capsLockActived = null; 118 }; 119 $.CapsLockTip.defaults = { 120 styleClass:"",//æç¤ºæ¡æ ·å¼classåç§° 121 width:0,//æç¤ºæ¡å®½åº¦ 122 text:"大åé®å·²è¢«éå®"//é误æç¤ºä¿¡æ¯ 123 }; 124})(jQuery); 125 126var gIsCodeShow; 127 128//é误æç¤º 129function showError(id,msg){ 130 $('#'+id).html( msg ).attr('className','errortips'); 131 $('#'+id).parent().prev("dd").children(".nreg_input_bg").css({"border":"1px solid #333"}); 132} 133//ç§»é¤é误æç¤º 134function removeError(id){ 135 $('#'+id).html('').removeClass('errortips'); 136 if(id=='code2_tip'){ 137 $('#'+id).parent().prev("dd").children(".nreg_input_bg").removeAttr("style").css({"width":"202px"}); 138 }else{ 139 $('#'+id).parent().prev("dd").children(".nreg_input_bg").removeAttr("style"); 140 } 141} 142//æ ¡éªè´¦å· 143function checkUser(){ 144 if($.trim($('#email_').val())==''){ 145 showError("login_email_tip","请è¾å ¥è´¦å·"); 146 return false;
147 } 148 removeError('login_email_tip'); 149 return true; 150} 151//æ´æ¹éªè¯ç å¾ç 152function changeValidateImage2(){ 153 $('#code2_').val(''); 154 var requestHost = 'https:' == document.location.protocol ? 'https://passport.yougou.com' : 'https://www.yougou.com'; 155 //$('#imageValidate2').attr("src", requestHost+'/servlet/imageValidate?rand='+Math.random()); 156 $('#imageValidate2').attr("src",requestHost+'/servlet/imageCaptcha?rand='+Math.random()); 157} 158//æ ¡éªå¯ç 159function checkPass(){ 160 var iLen = $.trim($('#password_').val()).length; 161 if(iLen==0){ 162 showError("login_password_tip","请è¾å ¥å¯ç "); 163 return false; 164 } 165 if(iLen<6||iLen>25){ 166 showError("login_password_tip","å¯ç åº6-25ä½ä¹é´"); 167 return false; 168 } 169 removeError('login_password_tip'); 170 return true; 171} 172//æ ¡éªéªè¯ç 173function checkValiCode(){ 174 var val = $.trim($('#code2_').val()); 175 if(val==''){ 176 showError("code2_tip","请è¾å ¥éªè¯ç "); 177 return false; 178 } 179 if(val.length<4){ 180 showError("code2_tip","éªè¯ç æ ¼å¼é误"); 181 return false; 182 } 183 removeError('code2_tip'); 184 return true; 185} 186 187// å¼¹çªç»éæååè° 188function poploginSuccessHandler(){ 189 var loginEmail = $("#login_email").val(); 190 try{ 191 $.cookie("belle_username", loginEmail.replace("@","#"), {expires: 30, path: '/', domain: '.yougou.com', secure: false }); 192 }catch(e){} 193 window.top.isLogin = true; 194 try 195 { 196 try 197 { 198 parent.synUserAddressData(); 199 closeLoginPop(); 200 } 201 catch(e) 202 { 203 closeDialog(); 204 } 205 } 206 catch(e) 207 { 208 try{ 209 //è´ç©è½¦é¡µ 210 parent.shopcartLoginCall(); 211 }catch(e){ 212 //åå页ç 213 parent.closeDialog(); 214 } 215 216 } 217} 218 219function loginSucCallBack(){ 220 if($('#redirectURL_1')[0]){ 221 var redirect = encodeURI($("#redirectURL_1").val()); 222 if(redirect.length <= 0) redirect = "/my/ucindex.jhtml"; 223 var re=new RegExp("^((https|http|www.))"); 224 redirect = YouGou.Util.setUrlStamp(redirect);//å 䏿¶é´æ³ 225 if(re.test(redirect)){ 226 location.href =redirect; 227 }else{ 228 location.href = "https://www.yougou.com"+redirect; 229 230 } 231 232 }else{ 233 poploginSuccessHandler(); 234 } 235} 236var loginOptFlag = false; 237//éªè¯ç»é 238function validaLogin(){ 239 $('.errortips').html('').removeClass('errortips'); 240 var isCode = gIsCodeShow?checkValiCode():true; 241 var isPass = checkPass(); 242 var username = $('#email_').val(),password = $('#password_').val(),verifycode = $('#code2_').val(); 243 var loginNonceName = $("#loginNonceId").attr('name'); 244 var loginNonceValue = $("#loginNonceId").attr('value'); 245 if(checkUser()&&checkPass()&&isCode){ 246 if(loginOptFlag){ 247 return false; 248 } 249 loginOptFlag = true; 250 var data = {"username" :username,"password":password,"verifycode":verifycode,"isVerify":isCode}; 251 data[loginNonceName] = loginNonceValue; 252 $.ajax({ 253 type : "POST", 254 url:"/my/procsignin.jhtml?callback=?", 255 async : false, 256 data : data, 257 dataType:"jsonp", 258 success: function(d){ 259 if(!!d.verifycode&&!gIsCodeShow){ 260 changeValidateImage2(); 261 gIsCodeShow=true; 262 $("#code_container").show(); 263 } 264 var msg = d.msg; 265 switch(msg){ 266 case 'login_success': 267 loginSucCallBack(); 268 break; 269 case 'username_err': 270 $("#password_").val(""); 271 showError("login_email_tip","æ¨çè´¦å·æå¯ç æè¯¯"); 272 showError("login_password_tip",""); 273 loginOptFlag = false; 274 break; 275 case 'pwd_err': 276 $("#password_").val(""); 277 showError("login_email_tip","æ¨çè´¦å·æå¯ç æè¯¯"); 278 showError("login_password_tip",""); 279 loginOptFlag = false; 280 break; 281 case 'vercode_err': 282 changeValidateImage2(); 283 showError("code2_tip","éªè¯ç è¾å ¥é误"); 284 loginOptFlag = false; 285 break; 286 case 'nonce_err': 287 $("#password_").val(""); 288 showError("login_email_tip","è¯·å·æ°é¡µé¢åéæ°æäº¤"); 289 loginOptFlag = false; 290 break; 291 case 'ip_limit_err': 292 showError("login_email_tip","æ¨æå¨ipç»å½æ¬¡æ°è¿å¤ï¼è¯·ç¨ååè¯"); 293 loginOptFlag = false; 294 break; 295 case 'account_blacklist': 296 showError("login_email_tip","ç»å½å¼å¸¸ï¼è¯·éè¯ã"); 297 loginOptFlag = false; 298 break; 299 case 'sys_err': 300 showError("login_email_tip","ç»å½å¼å¸¸ï¼è¯·éè¯ã"); 301 loginOptFlag = false;
302 break; 303 case 'user_limit_err': 304 showError("login_email_tip","æ¨ç»å½è¿äºé¢ç¹ï¼è¯·ç¨ååè¯ã"); 305 loginOptFlag = false; 306 break; 307 default: 308 location.reload(); 309 break; 310 } 311 } 312 }); 313 } 314 return false; 315}; 316$(function(){ 317 $('#email_').blur(checkUser); 318 $('#password_').blur(checkPass); 319 $('#code2_').blur(checkValiCode); 320 $('#loginform').submit(validaLogin); 321 $('.nlog_submit').hover(function(){ 322 $(this).addClass('nlog_subon'); 323 },function(){ 324 $(this).removeClass('nlog_subon'); 325 }); 326 gIsCodeShow = $("#code_container").is(':visible')?true:false; 327 changeValidateImage2(); 328 //init pop login 329 $('#pop_login').click(validaLogin); 330 331 $("#password_").capsLockTip({width:"80px",text:"大åç¶æå¼å¯"}); 332});
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.