Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeezyT <timo@ezdesign.de>2012-10-13 18:42:40 +0400
committerBeezyT <timo@ezdesign.de>2012-10-13 18:42:40 +0400
commit1001bc057e487871e5a066b72768296cb89468df (patch)
tree9bf1798211ac772daffd5c8b5e537687d02d57e0 /plugins/Transitions
parentae9741a49593e195ca128095c999464caca74995 (diff)
refs #534: bringing the new popover behavior to row evolution
* the popover parameter is used to remember the current state of row evolution * Piwik_Popover is used for controlling the popover * ajax helper methods are refactored from Transitions to piwikHelper and reused in row evolution * simplified logic for remembering rows for multi row evolution * applied code formatter (hence the whitespace changes) git-svn-id: http://dev.piwik.org/svn/trunk@7179 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Transitions')
-rw-r--r--plugins/Transitions/templates/transitions.js86
1 files changed, 33 insertions, 53 deletions
diff --git a/plugins/Transitions/templates/transitions.js b/plugins/Transitions/templates/transitions.js
index 31825c7156..308507787b 100644
--- a/plugins/Transitions/templates/transitions.js
+++ b/plugins/Transitions/templates/transitions.js
@@ -242,7 +242,7 @@ Piwik_Transitions.prototype.prepareCanvas = function(canvasId, width, height) {
var canvas;
if (typeof Piwik_Transitions.canvasCache == 'undefined'
- || typeof window.G_vmlCanvasManager != "undefined") {
+ || typeof window.G_vmlCanvasManager != "undefined") {
// no recycling for excanvas because they are disposed properly anyway and
// recycling doesn't work this way in IE8
Piwik_Transitions.canvasCache = {};
@@ -1373,66 +1373,46 @@ Piwik_Transitions_Ajax.prototype.callTransitionsController = function(action, ca
};
Piwik_Transitions_Ajax.prototype.callApi = function(method, params, callback) {
- params.module = 'API';
- params.method = method;
- params.date = piwik.currentDateString;
- params.idSite = piwik.idSite;
- params.period = piwik.period;
- params.token_auth = piwik.token_auth;
+ var self = this;
+
params.format = 'JSON';
- if (params.period == 'range') {
- params.date = piwik.startDateString + ',' + params.date;
- }
+
+ piwikHelper.ajaxCallApi(method, params, callback, function(errorName) {
+ var showError = function() {
+ var errorTitle, errorMessage, errorBack;
+ if (typeof Piwik_Transitions_Translations[errorName] == 'undefined') {
+ errorTitle = 'Exception';
+ errorMessage = errorName;
+ errorBack = '<<<';
+ } else {
+ errorTitle = Piwik_Transitions_Translations[errorName];
+ errorMessage = Piwik_Transitions_Translations[errorName + 'Details'];
+ errorBack = Piwik_Transitions_Translations[errorName + 'Back'];
+ }
- var segment = broadcast.getValueFromHash('segment', window.location.href);
- if (segment) {
- params.segment = segment;
- }
+ if (typeof params.actionName != 'undefined') {
+ var url = params.actionName;
+ url = Piwik_Transitions_Util.addBreakpointsToUrl(url);
+ errorTitle = errorTitle.replace(/%s/, '<span>' + url + '</span>');
+ }
- var self = this;
- piwikHelper.queueAjaxRequest($.post('index.php', params, function(result) {
- if (typeof result.result != 'undefined' && result.result == 'error') {
- var errorName = result.message;
-
- var showError = function() {
- var errorTitle, errorMessage, errorBack;
- if (typeof Piwik_Transitions_Translations[errorName] == 'undefined') {
- errorTitle = 'Exception';
- errorMessage = errorName;
- errorBack = '<<<';
- } else {
- errorTitle = Piwik_Transitions_Translations[errorName];
- errorMessage = Piwik_Transitions_Translations[errorName + 'Details'];
- errorBack = Piwik_Transitions_Translations[errorName + 'Back'];
- }
+ errorMessage = errorMessage.replace(/%s/g, '<br />');
+ Piwik_Popover.showError(errorTitle, errorMessage, errorBack);
+ };
- if (typeof params.actionName != 'undefined') {
- var url = params.actionName;
- url = Piwik_Transitions_Util.addBreakpointsToUrl(url);
- errorTitle = errorTitle.replace(/%s/, '<span>' + url + '</span>');
+ if (typeof Piwik_Transitions_Translations == 'undefined') {
+ self.callApi('Transitions.getTranslations', {}, function(response) {
+ if (typeof response[0] == 'object') {
+ Piwik_Transitions_Translations = response[0];
+ } else {
+ Piwik_Transitions_Translations = {};
}
-
- errorMessage = errorMessage.replace(/%s/g, '<br />');
- Piwik_Popover.showError(errorTitle, errorMessage, errorBack);
- };
-
- if (typeof Piwik_Transitions_Translations == 'undefined') {
- self.callApi('Transitions.getTranslations', {}, function(response) {
- if (typeof response[0] == 'object') {
- Piwik_Transitions_Translations = response[0];
- } else {
- Piwik_Transitions_Translations = {};
- }
- showError();
- });
- } else {
showError();
- }
-
+ });
} else {
- callback(result);
+ showError();
}
- }, 'json'));
+ });
};