diff options
author | Andrew Dolgov <[email protected]> | 2018-12-02 21:52:50 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-02 21:52:50 +0300 |
commit | ac8361e6f6e81e25d3c17e14b973af53a9b93885 (patch) | |
tree | 96f11d780211e203ff54b75b512682d684c43846 /js/common.js | |
parent | eeb49d375ce7e6addc382bab1a1545e897bb1771 (diff) |
add AppBase as a shared ancestor for main and prefs app objects
remove event.observe stuff from startup, unneeded
Diffstat (limited to 'js/common.js')
-rwxr-xr-x | js/common.js | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/js/common.js b/js/common.js index 1da3e6d1b..de6d13a78 100755 --- a/js/common.js +++ b/js/common.js @@ -1,28 +1,8 @@ 'use strict' /* global dijit, __ */ -let init_params = {}; let _label_base_index = -1024; let loading_progress = 0; -let notify_hide_timerid = false; - -Ajax.Base.prototype.initialize = Ajax.Base.prototype.initialize.wrap( - function (callOriginal, options) { - - if (getInitParam("csrf_token") != undefined) { - Object.extend(options, options || { }); - - if (Object.isString(options.parameters)) - options.parameters = options.parameters.toQueryParams(); - else if (Object.isHash(options.parameters)) - options.parameters = options.parameters.toObject(); - - options.parameters["csrf_token"] = getInitParam("csrf_token"); - } - - return callOriginal(options); - } -); /* xhr shorthand helpers */ @@ -239,15 +219,15 @@ const Notify = { switch (kind) { case this.KIND_INFO: notify.addClassName("notify_info") - icon = getInitParam("icon_information"); + icon = App.getInitParam("icon_information"); break; case this.KIND_ERROR: notify.addClassName("notify_error"); - icon = getInitParam("icon_alert"); + icon = App.getInitParam("icon_alert"); break; case this.KIND_PROGRESS: notify.addClassName("notify_progress"); - icon = getInitParam("icon_indicator_white") + icon = App.getInitParam("icon_indicator_white") break; } @@ -255,7 +235,7 @@ const Notify = { msgfmt += (" <span><img src=\"%s\" class='close' title=\"" + __("Click to close") + "\" onclick=\"Notify.close()\"></span>") - .replace("%s", getInitParam("icon_cross")); + .replace("%s", App.getInitParam("icon_cross")); notify.innerHTML = msgfmt; notify.addClassName("visible"); @@ -289,14 +269,6 @@ function displayIfChecked(checkbox, elemId) { } } -function getInitParam(key) { - return init_params[key]; -} - -function setInitParam(key, value) { - init_params[key] = value; -} - function fatalError(code, msg, ext_info) { if (code == 6) { window.location.href = "index.php"; @@ -390,5 +362,5 @@ function popupOpenArticle(id) { "height=900,width=900,resizable=yes,status=no,location=no,menubar=no,directories=no,scrollbars=yes,toolbar=no"); w.opener = null; - w.location = "backend.php?op=article&method=view&mode=raw&html=1&zoom=1&id=" + id + "&csrf_token=" + getInitParam("csrf_token"); + w.location = "backend.php?op=article&method=view&mode=raw&html=1&zoom=1&id=" + id + "&csrf_token=" + App.getInitParam("csrf_token"); } |