MediaWiki:Gadget-GECharts-core.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 73:
}
 
mw.loader.using(['mediawiki.mw.util', 'mediawiki.api', 'rs.highcharts', 'oojs-ui-core', 'oojs-ui.styles.icons-media'], self.init);
},
 
Line 457:
* General helper methods
*/
mw.util = {
/**
* <doc>
Line 525:
// don't modify the time (y-coord)
arr[i][0],
Math.round((mw.util.sum(list) / list.length) * round) / round
]);
}
Line 535:
/**
* Finds the sum of numbers in an array
* Only called by `mw.util.avg`
*
* @param arr {array} Array of number to find the sum of
Line 757:
rvprop: 'content',
format: 'json',
titles: 'Module:Exchange/' + mw.util.ucFirst(item)
}
).then(function(data, textStatus) {
var OOUIextraItem = $('#extraItem' + gecchartid).data('ooui-elem'),
mw.pages = data.query.mw.pages;
if (textStatus !== 'success') {
alert('An error occured while loading ' + item);
Line 768:
var matches = []
var pageMissing = false;
if (mw.pages[-1]) {
pageMissing = true;
} else {
var exchangeData = mw.pages[Object.keys(mw.pages)[0]]
.revisions[0]['*'];
matches = exchangeData.match(/itemId\D*(\d*)/);
Line 1,299:
// @todo can this be replaced with $.extend?
// @todo what is this supposed to do?
mw.util.cloneObj(_GEC['chart' + i].options, options);
 
options.chart.renderTo = 'GEpopupchart';
Line 1,424:
dataList.push({
name: inputAvg + '-day average',
data: mw.util.avg(data, inputAvg, isIndexChart ? 2 : 0),
lineWidth: 2,
dashStyle: 'shortdash',

Navigation menu