diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-09-10 17:51:41 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-10-06 18:25:27 +0300 |
commit | c7928e4f7f83fd60d8a9a1f7da4b8b267e081c0b (patch) | |
tree | cb6958891cdb81560fc04386bd0e60aa80d9f303 /plugins/Morpheus | |
parent | d8df02c63a216a6ed7810d32dbf9d875b9364dc4 (diff) |
new API to make checkTokenInUrl easier
Diffstat (limited to 'plugins/Morpheus')
-rw-r--r-- | plugins/Morpheus/javascripts/ajaxHelper.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/Morpheus/javascripts/ajaxHelper.js b/plugins/Morpheus/javascripts/ajaxHelper.js index 8050539192..d8d0b27c2f 100644 --- a/plugins/Morpheus/javascripts/ajaxHelper.js +++ b/plugins/Morpheus/javascripts/ajaxHelper.js @@ -99,6 +99,8 @@ function ajaxHelper() { */ this.errorCallback = this.defaultErrorCallback; + this.withToken = false; + /** * Callback function to be executed on complete (after error or success) */ @@ -171,6 +173,10 @@ function ajaxHelper() { } }; + this.withTokenInUrl = function () { + this.withToken = true; + }; + /** * Sets the base URL to use in the AJAX request. * @@ -432,6 +438,9 @@ function ajaxHelper() { return $.ajax(ajaxCall); }; + this._isRequestToApiMethod = function () { + return this.getParams && this.getParams['module'] === 'API' && this.getParams['method']; + } this._getDefaultPostParams = function () { return { token_auth: piwik.token_auth |