MediaWiki:Common.js
From FridaV
// get columns | // get columns | ||
| - | $('.wdbi-results-header th').each(function(j) { | + | $('.wdbi-results-header th',this).each(function(j) { |
var name=this.innerHTML; | var name=this.innerHTML; | ||
| + | console.log('column '+name); | ||
chart.chart[my_id].cols[name]=j; | chart.chart[my_id].cols[name]=j; | ||
chart.chart[my_id].ncols.push(name); | chart.chart[my_id].ncols.push(name); | ||
Revision as of 21:16, 4 April 2009
/* Any JavaScript here will be loaded for all users on every page load. */
var chart = {
chart: {},
init: function() {
$('table.flot').each(function(i) {
var my_id=$(this).attr('id');
console.log('table '+my_id);
chart.chart[my_id]={cols:{}, ncols:[]};
// get columns
$('.wdbi-results-header th',this).each(function(j) {
var name=this.innerHTML;
console.log('column '+name);
chart.chart[my_id].cols[name]=j;
chart.chart[my_id].ncols.push(name);
});
console.log(chart.chart[my_id]);
});
}
}
$(document).ready(chart.init);
