/* 鍒濆?鍖栦竴浜涘叏灞€鍙橀噺 */
var lf = "
";
var needupVerList = [];
var curVer = "";
var nextVer = "";
var iframe = null;
var notice = null;
var ui = "";
/* Ajax璁剧疆 */
Ajax.onRunning = null;
Ajax.onComplete = null;
/* 鍦ㄥ崌绾ц繃绋嬩腑璋冪敤璇ユ柟娉 */
function startNotice() {
$("js-monitor-loading").src = "images/loading.gif";
$("js-monitor-wait-please").innerHTML = ""
+ $_LANG["wait_please"] + "";
$("js-monitor-rollback").innerHTML = '';
};
/* 鍗囩骇瀹屾瘯璋冪敤璇ユ柟娉 */
function stopNotice() {
$("js-monitor-loading").src = "images/loading2.gif";
$("js-monitor-wait-please").innerHTML = $_LANG["has_been_stopped"];
$("js-monitor-rollback").innerHTML = $_LANG["rollback"];
};
/* 椤甸潰鍔犺浇瀹屾瘯鎵ц?涓€浜涙搷浣 */
window.onload = function () {
if ($("js-submit")) {
$("js-submit").onclick = function () {
this.setAttribute("disabled", "true");
upgrade();
};
}
if ($("js-submit-uc")) {
$("js-submit-uc").onclick = function () {
this.setAttribute("disabled", "true");
importUCenterData();
}
}
iframe = frames[0];
notice = $("js-notice", iframe);
var d = new Draggable();
d.bindDragNode("js-monitor", "js-monitor-title");
var detail = $("js-monitor-view-detail")
detail.innerHTML = $_LANG["display_detail"];
detail.onclick = function () {
var mn = $("js-monitor-notice");
if (mn.style.display === "block") {
mn.style.display = "none"
this.innerHTML = $_LANG["display_detail"];
} else {
mn.style.display = "block"
this.innerHTML = $_LANG["hide_detail"];
}
};
$("js-monitor-rollback").onclick = function ()
{
this.setAttribute("disabled", "true");
rollback();
}
$("js-monitor-close").onclick = function () {
$("js-monitor").style.display = "none";
if ($("js-submit")) {
$("js-submit").removeAttribute("disabled");
}
if ($("js-submit-uc")) {
$("js-submit-uc").removeAttribute("disabled");
}
};
ui = QueryString('ui');
if (ui == '') {
ui = 'ecshop';
}
};
/**
* 鍗囩骇绋嬪簭涓绘柟娉
*/
function upgrade() {
startNotice();
$("js-monitor").style.display = "block";
notice.innerHTML = $_LANG["initialize"] + $_LANG["suspension_points"];
delay(1);
try {
var result = getVerList();
if (result === false) {
displayErrorMsg();
return;
}
curVer = result["cur_ver"];
needupVerList = result["needup_ver_list"];
// if (needupVerList.length === 0) {
// notice.innerHTML += $_LANG["fail"] + lf
// + lf + lf + $_LANG["is_last_version"] + lf;
//displayErrorMsg();
//} else {
notice.innerHTML += $_LANG["success"] + lf;
go();
// }
} catch (ex) {
ex = typeof(ex) === "object" ? ex.message : ex;
location.href="index.php?step=error&msg="
+ encodeURI(ex);
}
}
/**
* 鐢ㄤ簬閫掕?璋冪敤鐨勬柟娉
*/
function go() {
if (needupVerList.length === 0) {
goToDone();
return;
}
nextVer = needupVerList.shift();
notice.innerHTML += lf + lf + " " +$_LANG["from"] + " " + curVer + " "
+ $_LANG["to"] + " " + nextVer + lf;
notice.innerHTML += "