add replaceServerResDataAsync

This commit is contained in:
加里
2014-10-21 11:18:55 +08:00
parent 025a6803ea
commit c6c2355d17
12 changed files with 78 additions and 159 deletions

View File

@@ -36,9 +36,6 @@ define("./detail",['$', 'gallery/underscore/1.6.0/underscore.js'],function(requi
' <h4 class="subTitle">response body</h4>'+
' <div class="detail">'+
' <div class="J_responseBody resBodyContent"></div>'+
// ' <form class="uk-form">'+
// ' <textarea class="J_responseBody">loading...</textarea>'+
// ' </form>'+
' </div>'+
' </section>'+
' <% } %>';

View File

@@ -93,7 +93,7 @@ seajs.use(['$', 'Underscore', 'Backbone',"./detail"], function($, _, Backbone,De
if(!isInApp){
self.detailPanel.showDetail(detailData);
}else{
window.webkit.messageHandlers.list.postMessage(JSON.stringify(detailData))
window.webkit.messageHandlers.list.postMessage(JSON.stringify(detailData));
}
}
},
@@ -174,7 +174,7 @@ seajs.use(['$', 'Underscore', 'Backbone',"./detail"], function($, _, Backbone,De
var data = JSON.parse(event.data);
var reqDate = new Date(data.startTime);
data.startTimeStr = reqDate.toLocaleTimeString() + "";
data.startTimeStr = reqDate.format("hh:mm:ss") + "";
var previous;
if(previous = recList.get(data.id)){
@@ -238,19 +238,19 @@ seajs.use(['$', 'Underscore', 'Backbone',"./detail"], function($, _, Backbone,De
})();
// Date.prototype.Format = function (fmt) {
// var o = {
// "M+": this.getMonth() + 1, //月份
// "d+": this.getDate(), //日
// "h+": this.getHours(), //小时
// "m+": this.getMinutes(), //分
// "s+": this.getSeconds(), //秒
// "q+": Math.floor((this.getMonth() + 3) / 3), //季度
// "S": this.getMilliseconds() //毫秒
// };
// if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
// for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
// return fmt;
// }
});
});
Date.prototype.format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}