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
@ -17,11 +17,11 @@ piwik.getSparklineColors = function () {
piwik.initSparklines = function() {
$('.sparkline > img').each(function () {
var $self = $(this);
if ($self.attr('src')) {
return;
}
var colors = JSON.stringify(piwik.getSparklineColors());
var appendToSparklineUrl = '&colors=' + encodeURIComponent(colors);
@ -42,10 +42,14 @@ window.initializeSparklines = function () {
// try to find sparklines and add them clickable behaviour
graph.parent().find('div.sparkline').each(function () {
// find the sparkline and get it's src attribute
var sparklineUrl = $('img', this).attr('data-src');
if (sparklineUrl != "") {
$(this).addClass('linked');
var params = broadcast.getValuesFromUrl(sparklineUrl);
for (var i = 0; i != sparklineUrlParamsToIgnore.length; ++i) {
delete params[sparklineUrlParamsToIgnore[i]];
@ -60,7 +64,8 @@ window.initializeSparklines = function () {
}
// on click, reload the graph with the new url
$(this).click(function () {
$(this).off('click.sparkline');
$(this).on('click.sparkline', function () {
var reportId = graph.attr('data-graph-id'),
dataTable = $(require('piwik/UI').DataTable.getDataTableByReport(reportId));
@ -69,7 +74,11 @@ window.initializeSparklines = function () {
// if this happens, we can't find the graph using $('#'+idDataTable+"Chart");
// instead, we just use the first evolution graph we can find.
if (dataTable.length == 0) {
dataTable = $('div.dataTableVizEvolution');
if ($(this).closest('.widget').length) {
dataTable = $(this).closest('.widget').find('div.dataTableVizEvolution');
} else {
dataTable = $('div.dataTableVizEvolution');
}
}
// reload the datatable w/ a new column & scroll to the graph