diff --git a/api/js/jsapi/egw_json.js b/api/js/jsapi/egw_json.js index eeb6c78cff..10c7e0f55d 100644 --- a/api/js/jsapi/egw_json.js +++ b/api/js/jsapi/egw_json.js @@ -4,7 +4,7 @@ * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package etemplate * @subpackage api - * @link http://www.egroupware.org + * @link https://www.egroupware.org * @author Andreas Stöckel (as AT stylite.de) * @author Ralf Becker */ @@ -59,7 +59,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) * @param {object} _sender * @param {egw} _egw */ - window.json_request = function(_menuaction, _parameters, _callback, _context, + const json_request = function(_menuaction, _parameters, _callback, _context, _async, _sender, _egw) { // Copy the parameters @@ -105,7 +105,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) * @param {function} error option error callback(_msg) used instead our default this.error * @param {int} reconnect timeout in ms (internal) */ - window.json_request.prototype.openWebSocket = function(url, tokens, account_id, error, reconnect) + json_request.prototype.openWebSocket = function(url, tokens, account_id, error, reconnect) { const min_reconnect_time = 1000; const max_reconnect_time = 300000; @@ -193,7 +193,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) * * @return {jqXHR|boolean} jQuery jqXHR request object or for async==="keepalive" boolean is returned */ - window.json_request.prototype.sendRequest = function(async, method, error) + json_request.prototype.sendRequest = function(async, method, error) { if(typeof async != "undefined") { @@ -244,7 +244,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) * @param {XMLHTTP} _xmlhttp * @param {string} _err */ - window.json_request.prototype.handleError = function(_xmlhttp, _err) { + json_request.prototype.handleError = function(_xmlhttp, _err) { // Don't error about an abort if(_err !== 'abort') { @@ -271,7 +271,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) } }; - window.json_request.prototype.handleResponse = function(data) { + json_request.prototype.handleResponse = function(data) { if (data && typeof data.response != 'undefined') { if (egw.preference('show_generation_time', 'common', false) == "1")