merge from 1.7.3.5(r13153:r13167)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2013-09-29 23:32:39 +00:00
parent cc47d2b247
commit 2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions

View file

@ -313,6 +313,14 @@ $.exec_xml = window.exec_xml = function(module, act, params, callback_func, resp
// ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음)
var waiting_obj = $('.wfsr');
if(show_waiting_message && waiting_obj.length) {
var timeoutId = $(".wfsr").data('timeout_id');
if(timeoutId) clearTimeout(timeoutId);
$(".wfsr").css('opacity', 0.0);
$(".wfsr").data('timeout_id', setTimeout(function(){
$(".wfsr").css('opacity', '');
}, 1000));
waiting_obj.html(waiting_message).show();
}
}
@ -354,10 +362,17 @@ function arr2obj(arr) {
/**
* @brief exec_json (exec_xml와 같은 용도)
**/
$.exec_json = function(action,data,func){
$.exec_json = function(action,data,func,f_error){
if(typeof(data) == 'undefined') data = {};
action = action.split(".");
if(action.length == 2){
// The cover can be disturbing if it consistently blinks (because ajax call usually takes very short time). So make it invisible for the 1st 0.5 sec and then make it visible.
var timeoutId = $(".wfsr").data('timeout_id');
if(timeoutId) clearTimeout(timeoutId);
$(".wfsr").css('opacity', 0.0);
$(".wfsr").data('timeout_id', setTimeout(function(){
$(".wfsr").css('opacity', '');
}, 1000));
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
$.extend(data,{module:action[0],act:action[1]});
@ -370,7 +385,18 @@ $.exec_json = function(action,data,func){
,data:$.param(data)
,success : function(data){
$(".wfsr").hide().trigger('cancel_confirm');
if(data.error > 0) alert(data.message);
if(data.error != 0 && data.error > -1000){
if(data.error == -1 && data.message == 'msg_is_not_administrator'){
alert('You are not logged in as an administrator');
// window.location.reload();
if($.isFunction(f_error)) f_error(data);
return;
}else{
alert(data.message);
if($.isFunction(f_error)) f_error(data);
return;
}
}
if($.isFunction(func)) func(data);
}
});
@ -384,6 +410,12 @@ $.fn.exec_html = function(action,data,type,func,args){
var self = $(this);
action = action.split(".");
if(action.length == 2){
var timeoutId = $(".wfsr").data('timeout_id');
if(timeoutId) clearTimeout(timeoutId);
$(".wfsr").css('opacity', 0.0);
$(".wfsr").data('timeout_id', setTimeout(function(){
$(".wfsr").css('opacity', '');
}, 1000));
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
$.extend(data,{module:action[0],act:action[1]});