MediaWiki:Common.js

From FridaV

Jump to: navigation, search
     $('table.flot').each(function(i) {
     $('table.flot').each(function(i) {
       var my_id=$(this).attr('id');
       var my_id=$(this).attr('id');
-
       console.log(id);
+
       console.log('table '+my_id);
       chart.chart[my_id]={cols:{}, ncols:[]};
       chart.chart[my_id]={cols:{}, ncols:[]};

Revision as of 21:15, 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').each(function(j) {
         var name=this.innerHTML;
         chart.chart[my_id].cols[name]=j;
         chart.chart[my_id].ncols.push(name);
      });
      console.log(chart.chart[my_id]);
    });
  }
}

$(document).ready(chart.init);
maps, graphs & data