update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit d885a4baa9
5833 changed files with 418860 additions and 226988 deletions

View file

@ -1,5 +1,5 @@
/*!
* Piwik - Web Analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -8,11 +8,12 @@
function initDashboard(dashboardId, dashboardLayout) {
$('.dashboardSettings').show();
initTopControls();
// Embed dashboard
if (!$('#topBars').length) {
if (!$('#header .navbar-right').length) {
$('.dashboardSettings').after($('#Dashboard'));
$('#Dashboard_embeddedIndex_' + dashboardId).addClass('sfHover');
$('#Dashboard_embeddedIndex_' + dashboardId).addClass('sfActive');
}
widgetsHelper.getAvailableWidgets();
@ -167,21 +168,15 @@ function copyDashboardToUser() {
// on menu item click, trigger action event on this
var self = this;
this.$element.on('click', 'ul.submenu li[data-action]', function (e) {
self.$element.toggleClass('visible');
$(self).trigger($(this).attr('data-action'));
if (!$(this).attr('disabled')) {
self.$element.removeClass('expanded');
$(self).trigger($(this).attr('data-action'));
}
});
// open manager on open
this.$element.on('click', function (e) {
if ($(e.target).is('.dashboardSettings,.dashboardSettings>span')) {
self.$element.toggleClass('visible');
// fix position
self.$element
.find('.widgetpreview-widgetlist')
.css('paddingTop', self.$element.find('.widgetpreview-categorylist').parent('li').position().top);
if ($(e.target).is('.dashboardSettings') || $(e.target).closest('.dashboardSettings').length) {
self.onOpen();
}
});
@ -192,7 +187,7 @@ function copyDashboardToUser() {
&& !$(e.target).is('.dashboardSettings')
) {
self.$element.widgetPreview('reset');
self.$element.removeClass('visible');
self.$element.removeClass('expanded');
}
};
@ -205,7 +200,7 @@ function copyDashboardToUser() {
},
onSelect: function (widgetUniqueId) {
var widget = widgetsHelper.getWidgetObjectFromUniqueId(widgetUniqueId);
self.$element.removeClass('visible');
self.$element.removeClass('expanded');
self.widgetSelected(widget);
},
@ -278,15 +273,29 @@ function copyDashboardToUser() {
$.extend(DashboardManagerControl.prototype, DashboardSettingsControlBase.prototype, {
onOpen: function () {
if ($('#dashboardWidgetsArea').dashboard('isDefaultDashboard')) {
$('.removeDashboardLink', this.$element).hide();
if ($('#dashboardWidgetsArea').dashboard('isDefaultDashboard')) {
$('[data-action=removeDashboard]', this.$element).attr('disabled', 'disabled');
$(this.$element).tooltip({
items: '[data-action=removeDashboard]',
show: false,
hide: false,
track: true,
content: function() {
return _pk_translate('Dashboard_RemoveDefaultDashboardNotPossible')
},
tooltipClass: 'small'
});
} else {
$('.removeDashboardLink', this.$element).show();
}
$('[data-action=removeDashboard]', this.$element).removeAttr('disabled');
// try to remove tooltip if any
try {
$(this.$element).tooltip('destroy');
} catch (e) { }
}
},
hide: function () {
this.$element.removeClass('visible');
this.$element.removeClass('expanded');
},
isWidgetAvailable: function (widgetUniqueId) {