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:
authorBenaka Moorthi <benaka.moorthi@gmail.com>2013-09-16 04:41:21 +0400
committerBenaka Moorthi <benaka.moorthi@gmail.com>2013-09-16 04:41:36 +0400
commitd5d6c9e0a9b7c94ae7e5df3404e8da53608049e9 (patch)
tree0ab537ffe9b23d1556711e0e38ccbdb674134c52 /plugins/CoreVisualizations
parented213bd7405e4c95420324a9f37239d3d2349a7a (diff)
Refs #4041, use require() and UIControl in all DataTable JS classes.
Diffstat (limited to 'plugins/CoreVisualizations')
-rw-r--r--plugins/CoreVisualizations/Visualizations/HtmlTable.php2
-rw-r--r--plugins/CoreVisualizations/javascripts/jqplot.js34
-rw-r--r--plugins/CoreVisualizations/javascripts/jqplotBarGraph.js11
-rw-r--r--plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js11
-rw-r--r--plugins/CoreVisualizations/javascripts/jqplotPieGraph.js9
5 files changed, 32 insertions, 35 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
index 3f39f57134..0c0f57e4c7 100644
--- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php
+++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
@@ -168,7 +168,7 @@ class HtmlTable extends DataTableVisualization
{
$defaults = array(
'enable_sort' => true,
- 'datatable_js_type' => 'dataTable',
+ 'datatable_js_type' => 'DataTable',
'filter_limit' => Config::getInstance()->General['datatable_default_limit'],
'visualization_properties' => array(
'table' => array(
diff --git a/plugins/CoreVisualizations/javascripts/jqplot.js b/plugins/CoreVisualizations/javascripts/jqplot.js
index 61a0399bc9..37e6575c8d 100644
--- a/plugins/CoreVisualizations/javascripts/jqplot.js
+++ b/plugins/CoreVisualizations/javascripts/jqplot.js
@@ -10,34 +10,28 @@
(function ($, require) {
- var dataTable = window.dataTable,
- dataTablePrototype = dataTable.prototype;
+ var exports = require('piwik/UI'),
+ DataTable = exports.DataTable,
+ dataTablePrototype = DataTable.prototype;
/**
* DataTable UI class for jqPlot graph datatable visualizations.
*
* @constructor
*/
- window.JqplotGraphDataTable = function () {
- dataTable.call(this);
+ exports.JqplotGraphDataTable = function (element) {
+ DataTable.call(this, element);
};
- $.extend(window.JqplotGraphDataTable.prototype, dataTablePrototype, {
+ $.extend(exports.JqplotGraphDataTable.prototype, dataTablePrototype, {
/**
* Initializes this class.
- *
- * @param {String} workingDivId The HTML ID of the data table DOM element.
- * @param {Element} [domElem] The DOM element of the data table.
*/
- init: function (workingDivId, domElem) {
- if (typeof domElem == "undefined") {
- domElem = $('#' + workingDivId);
- }
-
- dataTablePrototype.init.call(this, workingDivId, domElem);
+ init: function () {
+ dataTablePrototype.init.call(this);
- var graphElement = $('.piwik-graph', domElem);
+ var graphElement = $('.piwik-graph', this.$element);
if (!graphElement.length) {
return;
}
@@ -52,7 +46,7 @@
};
// set a unique ID for the graph element (required by jqPlot)
- this.targetDivId = workingDivId + 'Chart';
+ this.targetDivId = this.workingDivId + 'Chart';
graphElement.attr('id', this.targetDivId);
try {
@@ -214,7 +208,7 @@
rows = rows.split(',');
}
- var dataTable = $('#' + this.workingDivId).data('dataTableInstance');
+ var dataTable = $('#' + this.workingDivId).data('uiControlObject');
dataTable.param.columns = columns.join(',');
dataTable.param.rows = rows.join(',');
delete dataTable.param.filter_limit;
@@ -463,7 +457,7 @@
seriesColorNames = ['series1', 'series2', 'series3', 'series4', 'series5',
'series6', 'series7', 'series8', 'series9', 'series10'];
- var viewDataTable = $('#' + this.workingDivId).data('dataTableInstance').param['viewDataTable'];
+ var viewDataTable = $('#' + this.workingDivId).data('uiControlObject').param['viewDataTable'];
var graphType;
if (viewDataTable == 'graphEvolution') {
@@ -914,7 +908,7 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () {
var SeriesPicker = require('piwik/DataTableVisualizations/Widgets').SeriesPicker;
// create the series picker
- var dataTable = $('#' + target).closest('.dataTable').data('dataTableInstance');
+ var dataTable = $('#' + target).closest('.dataTable').data('uiControlObject');
var seriesPicker = new SeriesPicker(dataTable);
// handle placeSeriesPicker event
@@ -1074,4 +1068,4 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () {
$.jqplot.preInitHooks.push($.jqplot.PieLegend.init);
$.jqplot.postDrawHooks.push($.jqplot.PieLegend.postDraw);
-})(jQuery); \ No newline at end of file
+})(jQuery, require); \ No newline at end of file
diff --git a/plugins/CoreVisualizations/javascripts/jqplotBarGraph.js b/plugins/CoreVisualizations/javascripts/jqplotBarGraph.js
index f2e8366a05..4af18aaf50 100644
--- a/plugins/CoreVisualizations/javascripts/jqplotBarGraph.js
+++ b/plugins/CoreVisualizations/javascripts/jqplotBarGraph.js
@@ -10,13 +10,14 @@
(function ($, require) {
- var JqplotGraphDataTable = window.JqplotGraphDataTable;
+ var exports = require('piwik/UI'),
+ JqplotGraphDataTable = exports.JqplotGraphDataTable;
- window.JqplotBarGraphDataTable = function () {
- dataTable.call(this);
+ exports.JqplotBarGraphDataTable = function (element) {
+ JqplotGraphDataTable.call(this, element);
};
- $.extend(window.JqplotBarGraphDataTable.prototype, JqplotGraphDataTable.prototype, {
+ $.extend(exports.JqplotBarGraphDataTable.prototype, JqplotGraphDataTable.prototype, {
_setJqplotParameters: function (params) {
JqplotGraphDataTable.prototype._setJqplotParameters.call(this, params);
@@ -76,4 +77,4 @@
}
});
-})(jQuery, require);
+})(jQuery, require); \ No newline at end of file
diff --git a/plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js b/plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js
index ed6109409f..cabd812ffc 100644
--- a/plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js
+++ b/plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js
@@ -10,14 +10,15 @@
(function ($, require) {
- var JqplotGraphDataTable = window.JqplotGraphDataTable,
+ var exports = require('piwik/UI'),
+ JqplotGraphDataTable = exports.JqplotGraphDataTable,
JqplotGraphDataTablePrototype = JqplotGraphDataTable.prototype;
- window.JqplotEvolutionGraphDataTable = function () {
- dataTable.call(this);
+ exports.JqplotEvolutionGraphDataTable = function (element) {
+ JqplotGraphDataTable.call(this, element);
};
- $.extend(window.JqplotEvolutionGraphDataTable.prototype, JqplotGraphDataTablePrototype, {
+ $.extend(exports.JqplotEvolutionGraphDataTable.prototype, JqplotGraphDataTablePrototype, {
_setJqplotParameters: function (params) {
JqplotGraphDataTablePrototype._setJqplotParameters.call(this, params);
@@ -126,4 +127,4 @@
}
});
-})(jQuery, require);
+})(jQuery, require); \ No newline at end of file
diff --git a/plugins/CoreVisualizations/javascripts/jqplotPieGraph.js b/plugins/CoreVisualizations/javascripts/jqplotPieGraph.js
index 9b96135e85..61f0a22c84 100644
--- a/plugins/CoreVisualizations/javascripts/jqplotPieGraph.js
+++ b/plugins/CoreVisualizations/javascripts/jqplotPieGraph.js
@@ -10,13 +10,14 @@
(function ($, require) {
- var JqplotGraphDataTable = window.JqplotGraphDataTable;
+ var exports = require('piwik/UI'),
+ JqplotGraphDataTable = exports.JqplotGraphDataTable;
- window.JqplotPieGraphDataTable = function () {
- dataTable.call(this);
+ exports.JqplotPieGraphDataTable = function (element) {
+ JqplotGraphDataTable.call(this, element);
};
- $.extend(window.JqplotPieGraphDataTable.prototype, JqplotGraphDataTable.prototype, {
+ $.extend(exports.JqplotPieGraphDataTable.prototype, JqplotGraphDataTable.prototype, {
_setJqplotParameters: function (params) {
JqplotGraphDataTable.prototype._setJqplotParameters.call(this, params);