MediaWiki:Common.js

From FridaV

Jump to: navigation, search
       // get columns
       // get columns
-
       $('.wdbi-results-header th',this).each(function(j) {
+
       $('tr:first th',this).each(function(j) {
         var name=this.innerHTML;
         var name=this.innerHTML;
         console.log('column '+name);
         console.log('column '+name);

Revision as of 21:17, 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
      $('tr:first 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);
Personal tools
maps, graphs & data