mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-12 13:58:35 +01:00
Return an object for egw message in order to have access to it after display
This commit is contained in:
parent
0f4b40c7fb
commit
1624ceae07
@ -173,8 +173,6 @@ class admin_hooks
|
|||||||
}
|
}
|
||||||
// allow apps to hook into "Admin >> Clear cache and register hooks"
|
// allow apps to hook into "Admin >> Clear cache and register hooks"
|
||||||
Api\Hooks::process('clear_cache', array(), true);
|
Api\Hooks::process('clear_cache', array(), true);
|
||||||
|
|
||||||
Api\Json\Response::get()->apply('egw.message', array(lang('Done'), 'success'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1101,9 +1101,13 @@ var AdminApp = /** @class */ (function (_super) {
|
|||||||
* cache to use different method not requiring eg. so much memory
|
* cache to use different method not requiring eg. so much memory
|
||||||
*/
|
*/
|
||||||
AdminApp.prototype.clear_cache = function () {
|
AdminApp.prototype.clear_cache = function () {
|
||||||
this.egw.message(this.egw.lang('Clear cache and register hooks') + "\n" + this.egw.lang('Please wait...'), 'info');
|
var wait = this.egw.message(this.egw.lang('Clear cache and register hooks') + "\n" + this.egw.lang('Please wait...'), 'info');
|
||||||
this.egw.json('admin.admin_hooks.ajax_clear_cache').sendRequest(true, undefined, jQuery.proxy(function (_xmlhttp, _err) {
|
var success = function () {
|
||||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1').sendRequest(true);
|
wait.close();
|
||||||
|
egw.message('Done');
|
||||||
|
};
|
||||||
|
this.egw.json('admin.admin_hooks.ajax_clear_cache', null, success).sendRequest(true, undefined, jQuery.proxy(function (_xmlhttp, _err) {
|
||||||
|
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1', null, success).sendRequest(true);
|
||||||
}, this));
|
}, this));
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
@ -1335,11 +1335,14 @@ class AdminApp extends EgwApp
|
|||||||
*/
|
*/
|
||||||
clear_cache()
|
clear_cache()
|
||||||
{
|
{
|
||||||
this.egw.message(this.egw.lang('Clear cache and register hooks')+"\n"+this.egw.lang('Please wait...'),'info');
|
let wait = this.egw.message(this.egw.lang('Clear cache and register hooks')+"\n"+this.egw.lang('Please wait...'),'info');
|
||||||
|
let success = function (){
|
||||||
this.egw.json('admin.admin_hooks.ajax_clear_cache').sendRequest(true, undefined, jQuery.proxy(function(_xmlhttp, _err)
|
wait.close();
|
||||||
|
egw.message('Done');
|
||||||
|
};
|
||||||
|
this.egw.json('admin.admin_hooks.ajax_clear_cache', null, success).sendRequest(true, undefined, jQuery.proxy(function(_xmlhttp, _err)
|
||||||
{
|
{
|
||||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1').sendRequest(true);
|
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1', null, success).sendRequest(true);
|
||||||
}, this));
|
}, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
api/js/jsapi/egw_global.d.ts
vendored
4
api/js/jsapi/egw_global.d.ts
vendored
@ -827,8 +827,10 @@ declare interface IegwWndLocal extends IegwGlobal
|
|||||||
* @param {string} _discardID unique string id (appname:id) in order to register
|
* @param {string} _discardID unique string id (appname:id) in order to register
|
||||||
* the message as discardable. If no appname given, the id will be prefixed with
|
* the message as discardable. If no appname given, the id will be prefixed with
|
||||||
* current app. The discardID will be stored in local storage.
|
* current app. The discardID will be stored in local storage.
|
||||||
|
*
|
||||||
|
* @returns {object} returns an object containing data and methods related to the message
|
||||||
*/
|
*/
|
||||||
message(_msg : string, _type? : "help"|"info"|"error"|"warning"|"success", _discardID? : string) : void;
|
message(_msg: string, _type?: "help" | "info" | "error" | "warning" | "success", _discardID?: string): {node: JQuery, message: string, index: number, close: Function};
|
||||||
/**
|
/**
|
||||||
* Are we running in a popup
|
* Are we running in a popup
|
||||||
*
|
*
|
||||||
|
@ -62,6 +62,8 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
|||||||
* @param {string} _discardID unique string id (appname:id) in order to register
|
* @param {string} _discardID unique string id (appname:id) in order to register
|
||||||
* the message as discardable. If no appname given, the id will be prefixed with
|
* the message as discardable. If no appname given, the id will be prefixed with
|
||||||
* current app. The discardID will be stored in local storage.
|
* current app. The discardID will be stored in local storage.
|
||||||
|
*
|
||||||
|
* @return {object} returns an object containing data and methods related to the message
|
||||||
*/
|
*/
|
||||||
message: function(_msg, _type, _discardID)
|
message: function(_msg, _type, _discardID)
|
||||||
{
|
{
|
||||||
@ -206,6 +208,12 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
node: msg_div,
|
||||||
|
message: _msg,
|
||||||
|
index: msg_index,
|
||||||
|
close: function(){msg_close.click();}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user