Created
July 20, 2018 01:45
-
-
Save eacmen/682f764862596f836e32c5a88f4fed01 to your computer and use it in GitHub Desktop.
TP-LINK WL-WA850RE Login Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="pragma" content="no-cache"> | |
<meta http-equiv="cache-control" content="no-cache, must-revalidate"> | |
<meta http-equiv="expires" content="0"> | |
<!-- <link type="text/css" href="css/reset.css" rel="stylesheet" /> --> | |
<link rel="icon" href="./favicon.ico" type="image/x-icon" /> | |
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> | |
<link type="text/css" href="css/widget.css" rel="stylesheet" /> | |
<link type="text/css" href="themes/green/css/style.css" rel="stylesheet" /> | |
<!--[if lte IE 8]> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<link href="themes/green/css/ie.css" rel="stylesheet" type="text/css" /> | |
<![endif]--> | |
<!--[if lte IE 7]> | |
<link href="themes/green/css/ie.css" rel="stylesheet" type="text/css" /> | |
<![endif]--> | |
<!--[if lte IE 6]> | |
<link href="themes/green/css/ie.css" rel="stylesheet" type="text/css" /> | |
<![endif]--> | |
<script> | |
if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))){ | |
if(screen.height>=1080) | |
document.write('<meta name="viewport" content="width=device-width, initial-scale=2.0, minimum-scale=1.0, maximum-scale=3.0, target-densityDpi=device-dpi, user-scalable=yes">'); | |
else if(screen.height<670) | |
document.write('<meta name="viewport" content="width=device-width, initial-scale=0.5, minimum-scale=0.5, maximum-scale=3.0, target-densityDpi=device-dpi, user-scalable=yes">'); | |
else | |
document.write('<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=3.0, target-densityDpi=device-dpi, user-scalable=yes">'); | |
} | |
</script> | |
<title>Opening...</title> | |
</head> | |
<body id="login-body"> | |
<div class="top" id="login-main"> | |
<div class="top-header"> | |
<div class="top-header-wrap"> | |
<h1 id="product-tag"></h1> | |
<div id="top-control" class="top-control"> | |
<input id="lan-select" class="lan-select-container"/> | |
</div> | |
</div> | |
</div> | |
<div class="top-main"> | |
<div class="top-main-wrap"> | |
<div class="top-content"> | |
<div class="top-content-wrap" id="top-content"> | |
<div id="welcome"> | |
<h2></h2> | |
<p></p> | |
</div> | |
<form id="form-login" method="post" action="/cgi-bin/luci"> | |
<div class="login-field"> | |
<label id="login-username-label"> | |
<span class="icon"></span> | |
<span class="text"></span> | |
</label> | |
<input id="login-username" type="text" /> | |
</div> | |
<div class="login-field"> | |
<label id="login-password-label"> | |
<span class="icon"></span> | |
<span class="text"></span> | |
</label> | |
<input id="login-password" type="password" /> | |
</div> | |
<div class="login-field"> | |
<label id="login-password-label"> | |
<span class="icon"></span> | |
<span class="text"></span> | |
</label> | |
<input id="login-password-comfirm" type="password" /> | |
<span id="comfirm-status"></span> | |
</div> | |
<!--<div> | |
<input id="show-characters" /> | |
</div>--> | |
<button id="login-btn" type="button"></button> | |
</form> | |
</div> | |
</div> | |
<div class="top-footer-mask"></div> | |
<div class="top-footer"> | |
<div class="top-footer-wrap"> | |
<span class="help-faq"> | |
<a id="btn-faq" class="btn-faq" target="_blank" href="http://www.tp-link.com/en/Support/"></a> | |
<a id="btn-app" class="btn-app" href="javascript:void(0);"></a> | |
</span> | |
</div> | |
</div> | |
<div class="qr-code-container quick-setup hidden"> | |
<div class="qr-code-container-wrapper"> | |
<div class="qr-code"> | |
<span id="close-icon" class="close-icon"></span> | |
<div class="characters-illustrate"> | |
<span id="characters-illustrate-title" class="characters-illustrate-title"></span> | |
<span id="characters-illustrate-note" class="characters-illustrate-note"></span> | |
</div> | |
<span class="qr-code-picture"></span> | |
<div class="app-download-place"> | |
<a class="apple-store" target="_blank" href="https://itunes.apple.com/us/app/tp-link-tether/id599496594?ls=1&mt=8"></a> | |
<a class="google-play" target="_blank" href="https://play.google.com/store/apps/details?id=com.tplink.tether"></a> | |
</div> | |
</div> | |
<div class="qr-code-container-delta"></div> | |
</div> | |
</div> | |
</div> | |
<div class="top-main-img"></div> | |
</div> | |
</div> | |
<!-- user confilct 内容 --> | |
<div id="user-conflict-msg-container" class="conflict-situation"> | |
<div> | |
<h4 class="title"> | |
<span class="icon"></span> | |
<span class="text" id="user-conflict-situation"></span> | |
</h4> | |
<div class="content"> | |
<span id="user-conflict-situation-info"></span> | |
</div> | |
</div> | |
</div> | |
<!-- ip conflict 内容 --> | |
<!-- <div id="ip-conflict-msg-container"> | |
<div id="ip-conflict-situation-0" class="conflict-situation"> | |
<h4 class="title"> | |
<span class="icon"></span> | |
<span class="text" id="ip-conflict-situation-0-title"></span> | |
</h4> | |
<div class="content"> | |
<span id="ip-conflict-situation-0-info"></span> | |
<a class="link" id="ip-conflict-situation-0-new" href="javascript:void(0);"></a> | |
<span id="ip-conflict-situation-0-end"></span> | |
</div> | |
<button type="button" id="ip-conflict-situation-0-btn-continue"></button> | |
</div> | |
<div id="ip-conflict-situation-1" class="conflict-situation"> | |
<h4 class="title"> | |
<span class="icon"></span> | |
<span class="text" id="ip-conflict-situation-1-title"></span> | |
</h4> | |
<div class="content"> | |
<span id="ip-conflict-situation-1-info"></span> | |
<a class="link" id="ip-conflict-situation-1-new" href="javascript:void(0);"></a> | |
<span id="ip-conflict-situation-1-or"></span> | |
<a class="link" id="ip-conflict-situation-1-dst" href="javascript:void(0);"></a> | |
<span id="ip-conflict-situation-1-end"></span> | |
</div> | |
</div> | |
</div> --> | |
<div id="no-cookie-msg-container" class="hidden warning"> | |
<h4 class="title"> | |
<span class="icon"></span> | |
<span class="text" id="no-cookie-text"></span> | |
</h4> | |
</div> | |
<!-- 最长尝试次数超时 --> | |
<div id="max-attempts-msg-container" class="hidden warning"> | |
<h4 class="title"> | |
<span class="icon"></span> | |
<span class="text" id="max-attempts-text"></span> | |
</h4> | |
</div> | |
<!-- 剩余尝试次数 --> | |
<div id="left-attempts-msg-container" class="hidden warning"> | |
<h4 class="title"> | |
<span class="icon"></span> | |
<span class="text" id="left-attempts-text"></span> | |
</h4> | |
</div> | |
<script type="text/javascript" src="js/libs/jquery.min.js"></script> | |
<script type="text/javascript" src="js/su/locale.js"></script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
try{ | |
$.su.locale.setDefault(); | |
}catch(error){ | |
location.href = "./error.html"; | |
}; | |
//]]> | |
</script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
try{ | |
$.su.locale.URL_LAN_CHECK = "./data/lang.json"; // $.su.url("/locale?form=lang"); | |
$.su.locale.get(); | |
}catch(error){ | |
location.href = "./error.html"; | |
}; | |
//]]> | |
</script> | |
<script type="text/javascript" src="js/su/su.js"></script> | |
<script type="text/javascript" src="js/libs/encrypt.js"></script> | |
<script type="text/javascript" src="js/libs/md5.js"></script> | |
<script type="text/javascript" src="js/su/data/proxy.js"></script> | |
<script type="text/javascript" src="js/su/widget/widget.js"></script> | |
<script type="text/javascript" src="js/su/widget/window/msg.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/form.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/status.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/combobox.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/textbox.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/password.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/checkbox.js"></script> | |
<script type="text/javascript" src="js/su/widget/form/button.js"></script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
function strmodify(str) | |
{ | |
var localStr = ""; | |
var len = str.length; | |
var i,j; | |
var charStr; | |
for(i=0;i<len;i++) | |
{ | |
if(document.all) | |
{ | |
charStr = str.slice(i,i+1); | |
if(charStr != ' ')break; | |
} | |
else | |
{ | |
if(str[i] != ' ')break; | |
} | |
} | |
for(j=(len-1);j>0;j--) | |
{ | |
if(document.all) | |
{ | |
charStr = str.slice(j,j+1); | |
if(charStr != ' ')break; | |
} | |
else | |
{ | |
if(str[j] != ' ')break; | |
} | |
} | |
if(j<i) | |
{ | |
return localStr; | |
} | |
else localStr = str.slice(i,j+1); | |
return localStr; | |
} | |
function checkCookie(srcStr) | |
{ | |
var sliceStr = srcStr.indexOf("="); | |
var testStr = strmodify(srcStr.slice(0,sliceStr)).toUpperCase(); | |
if(testStr == "COOKIE") | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
function getCookie() | |
{ | |
var sliceStr; | |
var srcStr; | |
var tmpstring = document.cookie; | |
while(tmpstring.length > 0) | |
{ | |
sliceStr = tmpstring.indexOf(";"); | |
if(sliceStr == -1) | |
{ | |
srcStr = tmpstring; | |
if(checkCookie(srcStr) == true) | |
{ | |
sliceStr = srcStr.indexOf("="); | |
if(sliceStr == -1)return null; | |
var submitStr = strmodify(srcStr.slice(sliceStr+1)); | |
return submitStr; | |
} | |
} | |
else | |
{ | |
srcStr = tmpstring.slice(0,sliceStr); | |
if(checkCookie(srcStr) == true) | |
{ | |
sliceStr = srcStr.indexOf("="); | |
if(sliceStr == -1)return null; | |
var submitStr = strmodify(srcStr.slice(sliceStr+1)); | |
return submitStr; | |
} | |
} | |
tmpstring = tmpstring.slice(sliceStr+1); | |
} | |
return null; | |
} | |
///////////////////////////////////////////////////////////// | |
$(document).ready(function(e){ | |
/*var URL_IP_CONFLICT = $.su.url("/domain_login?form=dlogin"); | |
var URL_USER_CONFLICT = $.su.url("/login?form=limit"); | |
var URL_FORGET_PASSWORD = $.su.url("/login?form=password"); | |
var URL_VERIFY_CODE = $.su.url("/login?form=vercode"); | |
var URL_LOGIN = $.su.url("/login?form=login");*/ | |
// var URL_IP_CONFLICT = "./data/login.json"; | |
/*var URL_USER_CONFLICT = "./data/login.json"; | |
var URL_FORGET_PASSWORD = "./data/login.json"; | |
var URL_VERIFY_CODE = "./data/login.json";*/ | |
var URL_LOGIN = "./data/login.json"; | |
var URL_LOCALE = "./data/locale.json"; | |
//ip冲突部分内容 | |
/*var ipConflictProxy = new $.su.Proxy({ | |
url: URL_IP_CONFLICT, | |
autoLoad: false | |
});*/ | |
/* var ipConflictMsg = $("div#ip-conflict-msg-container").msg({ | |
closeBtn: false, | |
type: "window", | |
cls: "l" | |
}); | |
$("button#ip-conflict-situation-0-btn-continue").button({ | |
text: $.su.CHAR.LOGIN.CONTINUE, | |
handler: function(){ | |
ipConflictMsg.msg("close"); | |
loginMain.fadeIn(200); | |
}, | |
cls: "submit btn-continue-conflict" | |
});*/ | |
/* $("span#ip-conflict-situation-0-title").html($.su.CHAR.LOGIN.IMPORTANT_UPDATE); | |
$("span#ip-conflict-situation-0-info").html($.su.CHAR.LOGIN.IMPORTANT_UPDATE_INFO); | |
$("span#ip-conflict-situation-0-end").html($.su.CHAR.LOGIN.END); | |
$("span#ip-conflict-situation-1-title").html($.su.CHAR.LOGIN.IMPORTANT_NOTICE); | |
$("span#ip-conflict-situation-1-info").html($.su.CHAR.LOGIN.IMPORTANT_UPDATE_INFO); | |
$("span#ip-conflict-situation-1-or").html($.su.CHAR.LOGIN.OR); | |
$("span#ip-conflict-situation-1-end").html($.su.CHAR.LOGIN.END);*/ | |
/* $("a#ip-conflict-situation-1-new").on("click", function(e){ | |
ipConflictMsg.msg("close"); | |
loginMain.fadeIn(200); | |
});*/ | |
var passwordOnly = false; | |
var passwordLength; | |
var isSetup = false; | |
var loginTypeProxy = new $.su.Proxy({ | |
url: "./data/login.type.json", | |
async: false | |
}); | |
loginTypeProxy.read({},function(data){ | |
passwordOnly = data.passwordOnly; | |
passwordLength = data.passwordLength || 15; | |
isSetup = data.isSetup; | |
if(passwordOnly){ | |
$("#login-username").closest(".login-field").addClass("hidden"); | |
if(isSetup){ | |
$("#login-password-comfirm").closest(".login-field").addClass("hidden"); | |
$("#welcome p").hide(); | |
}else{ | |
$(".qr-code-container").removeClass("hidden"); | |
} | |
}else{ | |
$("#login-password-comfirm").closest(".login-field").addClass("hidden"); | |
$("#welcome p").hide(); | |
} | |
}); | |
//用户登录冲突部分 | |
var userConflictMsg = $("div#user-conflict-msg-container").msg({ | |
closeBtn: false, | |
cls: "l", | |
type: "alert", | |
okHandler: function(){ | |
$("button#login-btn").button("enable"); | |
$("#form-login").find("button").focus(); | |
} | |
}); | |
//主页面内容部分 | |
var loginMain = $("div#login-main"); | |
var lanSelectCombo = $("input#lan-select").combobox({ | |
cls: "top-lan-select", | |
items: [ | |
], | |
fieldLabel: null | |
}).on("ev_click", function(e, vOld, vNew){ | |
if (vOld[0] == vNew[0]){ | |
return; | |
}; | |
$.su.locale.set(vNew[0], function(){ | |
lanSelectCombo.combobox("setValue", [$.su.locale.locale]); | |
}, function(){ | |
lanSelectCombo.combobox("setValue", [$.su.locale.locale]); | |
}); | |
}) | |
document.title = $.su.locale.model; | |
$("h1#product-tag").html($.su.locale.model); | |
$("a#btn-faq").html($.su.CHAR.INDEX.HELP_SUPPORT); | |
$.su.CHAR.SUPPORT = { | |
BG_BG: "http://www.tp-link.com/en/Support/", | |
CS_CZ: "http://cz.tp-link.com/Support/", | |
DE_DE: "http://www.tp-link.de/Support", | |
EN_US: "http://www.tp-link.com/en/Support/", | |
ES_ES: "http://www.tp-link.es/Support/", | |
FR_FR: "http://www.tp-link.fr/Support/", | |
IT_IT: "http://www.tp-link.it/Support/", | |
KO_KR: "http://www.tp-link.co.kr/Support/", | |
NL_NL: "http://nl.tp-link.com/Support/", | |
PL_PL: "http://www.tp-link.com.pl/Support/", | |
PT_PT: "http://www.tp-link.pt/Support/", | |
RO_RO: "http://www.tp-link.ro/Support/", | |
RU_RU: "http://www.tp-linkru.com/Support/", | |
SK_SK: "http://cz.tp-link.com/Support/", | |
TH_TH: "http://www.tp-link.co.th/Support/", | |
TR_TR: "http://www.tp-link.com.tr/Support/", | |
UK_UA: "http://www.tp-link.ua/uk/Support/", | |
VI_VN: "http://www.tp-link.vn/Support/", | |
ZH_TW: "http://www.tp-link.tw/Support/", | |
PT_BR: "http://www.tp-link.com.br/Support/", | |
ES_LA: "http://www.tp-link.com/ar/Support/", | |
JA_JP: "http://www.tp-link.jp/support.html" | |
} | |
var support_url = $.su.CHAR.SUPPORT[$.su.locale.locale.toUpperCase()] || "http://www.tp-link.com/en/Support/"; | |
$("#btn-faq").attr("href",support_url); | |
if ($.su.locale.force != false){ | |
lanSelectCombo.combobox("hide"); | |
}else{ | |
var localeProxy = new $.su.Proxy({ | |
url: URL_LOCALE | |
}); | |
localeProxy.read({}, function(data){ | |
var locale=[]; | |
for(var i=0;i<data.length;i++){ | |
locale[i]={}; | |
locale[i].value=data[i].value; | |
locale[i].name=$.su.CHAR.LANGUAGE[data[i].name]; | |
}; | |
lanSelectCombo.combobox("loadData",locale).combobox("setValue", [$.su.locale.locale]); | |
}); | |
} | |
$("#welcome h2").text($.su.CHAR.LOGIN.WELCOME); | |
$("#welcome p").text($.su.CHAR.LOGIN.WELCOME_TIPS); | |
$("input#login-username").textbox({ | |
hint: $.su.CHAR.LOGIN.USERNAME, | |
fieldLabel: null, | |
allowBlank: passwordOnly, | |
vtype: "ascii_visible", | |
maxLength: 15, | |
minLength: 1, | |
cls: "inline-block login-text" | |
}); | |
$("input#login-password").password({ | |
showLevel: false, | |
hint: passwordOnly?(isSetup?$.su.CHAR.LOGIN.PASSWORD:$.su.CHAR.LOGIN.NEW_PASSWORD):$.su.CHAR.LOGIN.PASSWORD, | |
fieldLabel: null, | |
maxLength: passwordLength, | |
vtype: { | |
vtype: passwordLength==15?"ascii_visible":"password", | |
vtypeText: $.su.CHAR.VTYPETEXT.PASSWORD | |
}, | |
minLength: 1, | |
allowBlank: false, | |
allowVisible: false, | |
cls: "inline-block login-text" | |
}).on("ev_change", function(e, value, key, keyCode){ | |
if($("input#login-password-comfirm").password("getValue") != ""){ | |
if(value != $("input#login-password-comfirm").password("getValue")){ | |
$("#comfirm-status").status("setFailed"); | |
return; | |
}else{ | |
$("#comfirm-status").status("setSuccess"); | |
} | |
} | |
if (key == "Enter" || keyCode == 13 )/*&& $("div#left-attempts-msg-container").css("display")!="block" | |
&& $("div#left-attempts-msg-container").css("display")!= "block" | |
&& $("div#max-attempts-msg-container").css("display") != "block" | |
&& $("div#user-conflict-msg-container").css("display") != "block")*/{ | |
//$("input#login-password").password("removeFocus"); | |
if(!$("button#login-btn").prop('disabled')){ | |
$("button#login-btn").button("disable"); | |
$("input#login-password").password("doEncrypt"); | |
if (checkCookie()){ | |
doLogin(); | |
}; | |
} | |
setTimeout(function(){ | |
$("button#login-btn").button("enable"); | |
},500); | |
}/*else if($("div#left-attempts-msg-container").css("display") == "block" | |
|| $("div#max-attempts-msg-container").css("display") == "block" | |
|| $("div#user-conflict-msg-container").css("display") == "block"){ | |
$("div#left-attempts-msg-container").msg("close"); | |
$("div#max-attempts-msg-container").msg("close"); | |
$("div#user-conflict-msg-container").msg("close"); | |
}*/ | |
}); | |
$("input#login-password-comfirm").password({ | |
showLevel: false, | |
hint: $.su.CHAR.LOGIN.CONFIRM_PASSWORD, | |
fieldLabel: null, | |
maxLength: passwordLength, | |
minLength: 1, | |
allowBlank: !passwordOnly||isSetup, | |
allowVisible: false, | |
vtype: { | |
vtype: passwordLength==15?"ascii_visible":"password", | |
vtypeText: $.su.CHAR.VTYPETEXT.PASSWORD | |
}, | |
cls: "inline-block login-text" | |
}).on("ev_change", function(e, value, key, keyCode){ | |
if(value != $("input#login-password").password("getValue")){ | |
$("#comfirm-status").status("setFailed"); | |
return; | |
}else{ | |
$("#comfirm-status").status("setSuccess"); | |
} | |
if (key == "Enter" || keyCode == 13 ){ | |
if(!$("button#login-btn").prop('disabled')){ | |
$("button#login-btn").button("disable"); | |
$("input#login-password").password("doEncrypt"); | |
if (checkCookie()){ | |
doLogin(); | |
}; | |
} | |
setTimeout(function(){ | |
$("button#login-btn").button("enable"); | |
},500); | |
} | |
}); | |
$("#comfirm-status").status({ | |
cls: "inline-block" | |
}) | |
var loginProxy = new $.su.Proxy({ | |
url: URL_LOGIN | |
}); | |
var loginForm = $("form#form-login").form({ | |
proxy: loginProxy, | |
showPrompt: false, | |
autoLoad: false, | |
fields: [ | |
/* {name: "username"}, | |
{name: "password"}*/ | |
] | |
}); | |
var doLogin = function(){ | |
/////////////// get cookies | |
checkCookie(); | |
var submitStr = getCookie() || $.su.locale.cookie; | |
/* if(submitStr == null) | |
{ | |
alert('open your cookies!'); | |
return false; | |
}*/ | |
var password = $.su.md5( $.su.md5($("input#login-password").password('getValue') ).toUpperCase() + ':' + submitStr ).toUpperCase(); | |
var strEncoded = passwordOnly?password:($("input#login-username").textbox('getValue') + ':' + password); | |
$('input#login-username').textbox('setNormal'); | |
$('input#login-password').password('setNormal'); | |
if( $('input#login-username').textbox('validate') && $('input#login-password').password('validate') && $('input#login-password-comfirm').password('validate') ){ | |
var postData = { | |
"operation": "login", | |
"encoded": strEncoded, | |
"nonce": submitStr | |
} | |
if(!isSetup){ | |
postData.firstLogin = true; | |
postData.password = $.su.md5($("input#login-password").password('getValue')).toUpperCase(); | |
} | |
loginForm.form("submit", postData, function(data, status, xhr){ | |
location.href = "/"; | |
}, function(errorcode, others, data){ | |
switch (errorcode.toUpperCase()){ | |
case "USER CONFLICT": | |
$("span#user-conflict-situation").html($.su.CHAR.LOGIN.USER_CONFLICT); | |
var c = $.su.CHAR.LOGIN.USER_CONFLICT_INFO.replace("%USER%", data.logined_user).replace("%HOST%", data.logined_host).replace("%IP%", data.logined_ip).replace("%MAC%", data.logined_mac); | |
$("span#user-conflict-situation-info").html(c) | |
userConflictMsg.msg("show"); | |
userConflictMsg.find("button").focus(); | |
break; | |
case "LOGIN FAILED": | |
var num1 = data.failureCount; | |
var num2 = data.attemptsAllowed; | |
var num3 = num2 + num1; | |
if (num2 == 0){ | |
var str = $.su.CHAR.ERROR["00000089"].replace("%num", num3); | |
$("span#max-attempts-text").html(str); | |
maxAttemptsMsg.msg("show"); | |
maxAttemptsMsg.find("button").focus(); | |
}else if(num1 >= num2){ | |
var str = $.su.CHAR.LOGIN.LOGIN_FAILED_COUNT.replace("%num1", num1); | |
str = str.replace("%num2", num2); | |
if(num2<=1){ | |
try{str = str.replace("attempts", "attempt");}catch(error){} | |
} | |
// loginForm.form("prompt", false, str, 4000); | |
$("span#left-attempts-text").html(str); | |
leftAttemptsMsg.msg("show"); | |
leftAttemptsMsg.find("button").focus(); | |
}else { | |
loginForm.form("prompt", false, $.su.CHAR.LOGIN.LOGIN_FAILED); | |
$("#form-login").find("button").focus(); | |
//$("button#login-btn").button("enable"); | |
} | |
break; | |
case "EXCEEDED MAX ATTEMPTS": | |
var num1 = data.failureCount; | |
var num2 = data.attemptsAllowed; | |
var num3 = num2 + num1; | |
var str = $.su.CHAR.ERROR["00000089"].replace("%num", num3); | |
$("span#max-attempts-text").html(str); | |
maxAttemptsMsg.msg("show"); | |
maxAttemptsMsg.find("button").focus(); | |
break; | |
default: | |
}; | |
}); | |
} | |
}; | |
$("button#login-btn").button({ | |
text: isSetup?$.su.CHAR.LOGIN.LOGIN:$.su.CHAR.LOGIN.START, | |
handler: function(e){ | |
/*var psw = $("input#login-password").password("getValue"), | |
user = $("input#login-username").textbox("getValue");*/ | |
if( !isSetup && ($("input#login-password").password("getValue") != $("input#login-password-comfirm").password("getValue"))){ | |
$("#comfirm-status").status("setFailed"); | |
$("input#login-password-comfirm").password("setError"); | |
return; | |
} | |
$("button#login-btn").button("disable"); | |
if (checkCookie()){ | |
function Base64Encoding(input) | |
{ | |
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
var output = ""; | |
var chr1, chr2, chr3, enc1, enc2, enc3, enc4; | |
var i = 0; | |
//input = utf8_encode(input); | |
while (i < input.length) | |
{ | |
chr1 = input.charCodeAt(i++); | |
chr2 = input.charCodeAt(i++); | |
chr3 = input.charCodeAt(i++); | |
enc1 = chr1 >> 2; | |
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); | |
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); | |
enc4 = chr3 & 63; | |
if (isNaN(chr2)) { | |
enc3 = enc4 = 64; | |
} else if (isNaN(chr3)) { | |
enc4 = 64; | |
} | |
output = output + | |
keyStr.charAt(enc1) + keyStr.charAt(enc2) + | |
keyStr.charAt(enc3) + keyStr.charAt(enc4); | |
} | |
return output; | |
} | |
username = $('input#login-username').textbox('getValue'); | |
password = $('input#login-password').password('getValue'); | |
/* | |
var auth = "Basic "+ Base64Encoding(username + ":" + password); | |
document.cookie = "Authorization="+escape(auth)+";path=/"; | |
*/ | |
doLogin(); | |
}; | |
setTimeout(function(){ | |
$("button#login-btn").button("enable"); | |
},500); | |
}, | |
cls: "submit login-btn inline-block" | |
}); | |
/*$("button#test").click(function(e){ | |
$.ajax({ | |
url: "./data/internet.json", | |
type: "POST", | |
data: { | |
"name" : "name", | |
"id": "id" | |
}, | |
success: function(data, status, xhr){ | |
//console.log(data); | |
} | |
}); | |
});*/ | |
//登录流程 | |
/* ipConflictProxy.read({}, function(data){ | |
if (data && data.conflict === true){ | |
var sit0 = $("div#ip-conflict-situation-0"); | |
var sit1 = $("div#ip-conflict-situation-1"); | |
switch (data.mode){ | |
case 0: | |
sit0.css("display", "block"); | |
sit1.css("display", "none"); | |
$("a#ip-conflict-situation-0-new").html(data.new_addr); | |
break; | |
case 1: | |
sit0.css("display", "none"); | |
sit1.css("display", "block"); | |
$("a#ip-conflict-situation-1-dst").html(data.dst_addr).attr("href", "http://" + data.dst_addr + data.dst_webpath); | |
$("a#ip-conflict-situation-1-new").html(data.new_addr); | |
break; | |
}; | |
loginMain.css("display", "none"); | |
ipConflictMsg.msg("show"); | |
}else{ | |
ipConflictMsg.msg("close"); | |
loginMain.fadeIn(200); | |
}; | |
}, function(e){ | |
ipConflictMsg.msg("close"); | |
loginMain.fadeIn(200); | |
}, function(e){ | |
ipConflictMsg.msg("close"); | |
loginMain.fadeIn(200); | |
});*/ | |
loginMain.show(); | |
/*cookie check*/ | |
$("span#no-cookie-text").html($.su.CHAR.LOGIN.NO_COOKIE); | |
var noCookieMsg = $("div#no-cookie-msg-container").msg({ | |
type: "alert", | |
cls: "m", | |
closeBtn: false | |
}); | |
var checkCookie = function(){ | |
if (navigator.cookieEnabled){ | |
noCookieMsg.msg("close"); | |
return true; | |
}else{ | |
noCookieMsg.msg("show"); | |
return false; | |
}; | |
}; | |
checkCookie(); | |
/////////////// MAX ATTEMPTS | |
var maxAttemptsMsg = $("div#max-attempts-msg-container").msg({ | |
type: "alert", | |
cls: "m", | |
closeBtn: false, | |
okHandler: function(){ | |
$("button#login-btn").button("enable"); | |
$("#form-login").find("button").focus(); | |
} | |
}); | |
/*left attempt*/ | |
// $("span#left-attempts-text").html($.su.CHAR.ERROR.LOGIN_FAILED_COUNT); | |
var leftAttemptsMsg = $("div#left-attempts-msg-container").msg({ | |
type: "alert", | |
cls: "m", | |
closeBtn: false, | |
okHandler: function(){ | |
$("button#login-btn").button("enable"); | |
$("#form-login").find("button").focus(); | |
} | |
}); | |
/**********SRT*布局调整*SRT*********/ | |
$.su.layout.doLayout = function(){ | |
var hh = $("div.top-header").height(); | |
//var fh = $("div.top-footer").height() || 67; | |
var fh = 0; | |
var wh = $(window).height(); | |
$("body").css({ | |
"height": wh | |
}); | |
var c = $("div.top-content"); | |
var pT = parseInt(c.css("paddingTop"), 10); | |
var pB = parseInt(c.css("paddingBottom"), 10); | |
var ch = $("#cloud-login").height(); | |
ch = $("#cloud-login").css("display") == "none" ? 0 : ch; | |
var h = Math.max(180, ch); | |
var h = Math.max(h, wh - hh - pT - fh); | |
$("div.top-main").css({ | |
"height": wh - hh | |
}); | |
$("div.top-main-wrap").css({ | |
"min-height": pT + fh + h | |
}); | |
$("div.top-content").css({ | |
"height": h | |
}); | |
/**移动端100%宽度有问题**/ | |
$("div.top-footer").css({ | |
"width": $("div.top-footer").parent().width() | |
}); | |
}; | |
/**********END*布局调整*END*********/ | |
/**页面初始化**/ | |
$.su.layout.doLayout(); | |
$(window).on("resize load", function(){ | |
$.su.layout.doLayout(); | |
//onReceive({data:{eType:"ev_windowResize"},source:null,origin:"_self"}); | |
}); | |
//$.su.loading.show(); | |
$.su.loading.hide(); | |
/**********STR*二维码*STR**********/ | |
$("a#btn-app").html($.su.CHAR.INDEX.HELP_APP); | |
$("span#characters-illustrate-title").html($.su.CHAR.INDEX.CHARACTERS_ILLUSTRETE_TITLE); | |
$("span#characters-illustrate-note").html($.su.CHAR.INDEX.CHARACTERS_ILLUSTRETE_NOTE0+" "+$.su.CHAR.INDEX.CHARACTERS_ILLUSTRETE_NOTE1); | |
$("a#btn-app").click(function(){ | |
if($("div.qr-code-container").css("display") == "block"){ | |
$("div.qr-code-container").slideUp("2000"); | |
} | |
else{ | |
$("div.qr-code-container").slideDown("2000"); | |
} | |
}); | |
$("span#close-icon").click(function(){ | |
$("div.qr-code-container").slideUp("2000"); | |
}); | |
/**********END*二维码*END*********/ | |
setTimeout(function(){ | |
if(passwordOnly) | |
$("input#login-password").parent().parent().find('input.text-hint').click(); | |
else | |
$("input#login-username").parent().parent().find('input.text-hint').click(); | |
}, 500); | |
}); | |
//]]> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment