|
@@ -14,8 +14,8 @@ function on_check_fail(){
|
|
|
var out = "";
|
|
|
Queue.backup.forEach(function(val,index,arr){
|
|
|
out += val + "\n";
|
|
|
- })
|
|
|
- alert("抱歉, 服务器连接失败! \n 请确认 " + out + "其中之一可用");
|
|
|
+ });
|
|
|
+ send_alert("抱歉, 服务器连接失败! \n 请确认 " + out + "其中之一可用");
|
|
|
}else{
|
|
|
Queue.SVR_URL = Queue.backup[Queue.nowuse];
|
|
|
Queue.nowuse ++;
|
|
@@ -57,7 +57,7 @@ function group_get_data(groupName, url, callback){
|
|
|
}
|
|
|
});
|
|
|
if(gid === -1) {
|
|
|
- alert("Group 方法使用错误!!!")
|
|
|
+ send_alert("Group 方法使用错误!!!")
|
|
|
}
|
|
|
Queue.list.push({url:url, callback:callback, gid:gid});
|
|
|
}
|
|
@@ -122,31 +122,31 @@ function check_if_success(a,b){
|
|
|
console.warn("=---------- 异常 -----------=");
|
|
|
console.warn(a);
|
|
|
console.warn("=----------------------------=");
|
|
|
- alert("信息失败 : "+e);
|
|
|
+ send_alert("信息失败 : "+e);
|
|
|
return;
|
|
|
}
|
|
|
- }else if(typeof a == "undefined"){
|
|
|
+ }else if(typeof a === "undefined"){
|
|
|
console.warn("=---------- 异常 -----------=");
|
|
|
console.warn(a);
|
|
|
console.warn("=------------------------------=");
|
|
|
- alert("信息失败 : "+e);
|
|
|
+ send_alert("信息失败 : "+e);
|
|
|
return;
|
|
|
}
|
|
|
if(a.ret === "10000") {
|
|
|
return true;
|
|
|
}else{
|
|
|
console.error(JSON.stringify(a));
|
|
|
- alert("查询失败 : 请参阅控制台输出! ");
|
|
|
+ send_alert("查询失败 : 请参阅控制台输出! ");
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
function on_fail(msg) {
|
|
|
- alert("很抱歉,网络错误,请查看Console");
|
|
|
- console.warn("----- 网络请求失败 ---------")
|
|
|
+ send_alert("很抱歉,网络错误,请查看Console");
|
|
|
+ console.warn("----- 网络请求失败 ---------");
|
|
|
console.warn(JSON.stringify(this));
|
|
|
- console.warn("----------------------------")
|
|
|
+ console.warn("----------------------------");
|
|
|
Queue.shouldStop = true;
|
|
|
}
|
|
|
|
|
@@ -178,12 +178,21 @@ function on_document_load() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+var alertModel = document.createElement();
|
|
|
+
|
|
|
function send_alert(a, b){
|
|
|
- var modelO = $("#alertModal");
|
|
|
- if(modelO.length == 0){
|
|
|
+ var q = "<!-- Modal 部分开始 -->\n<div class=\"modal fade\" id=\"alertModal\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"alertModalLabel\">New message</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form>\n <div class=\"form-group\">\n <label for=\"recipient-name\" class=\"col-form-label\">Recipient:</label>\n <input type=\"text\" class=\"form-control\" id=\"recipient-name\">\n </div>\n <div class=\"form-group\">\n <label for=\"message-text\" class=\"col-form-label\">Message:</label>\n <textarea class=\"form-control\" id=\"message-text\"></textarea>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n <button type=\"button\" class=\"btn btn-primary\">Send message</button>\n </div>\n </div>\n </div>\n</div>";
|
|
|
+ //var model = document.createElement("div");
|
|
|
+ //$("body").append(q);
|
|
|
+ document.write(q);
|
|
|
+ var modalO = $("alertModal");
|
|
|
+ if(modalO.length === 0){
|
|
|
alert(a);
|
|
|
}else{
|
|
|
- modelO.modal('show');
|
|
|
+ $("#alertModelLabel").text(b);
|
|
|
+ $("#message-text").text(b);
|
|
|
+ modalO.modal('show');
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|