/[sql-web-session]/sql-editor.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sql-editor.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by dpavlin, Sat Apr 18 23:14:41 2009 UTC revision 34 by dpavlin, Wed Dec 9 13:10:54 2009 UTC
# Line 12  $(document).ready( function() { Line 12  $(document).ready( function() {
12    
13          function click_on_cell(e) {          function click_on_cell(e) {
14    
15    console.debug( e, this );
16    
17                  var tag = e.originalTarget.tagName;                  var tag = e.originalTarget.tagName;
18    
19                  var col_nr = e.originalTarget.cellIndex;                  var col_nr = e.originalTarget.cellIndex;
# Line 66  $(document).ready( function() { Line 68  $(document).ready( function() {
68                  $('form#sql').addClass('visible').addClass('fixed');                  $('form#sql').addClass('visible').addClass('fixed');
69          };          };
70    
71          $('table#results').bind('mouseup', click_on_cell);          $('table#results th').bind('click', function(e) {
72                    var column = $(this).text();
73                    console.info('header', column);
74    
75                    $('form#sql .changed').removeClass('changed');
76    
77                    $('form#sql input[name=order_by]')
78                            .addClass('changed')
79                            .attr('value', column + ' desc')
80                            ;
81    
82                    $('form#sql').addClass('visible').addClass('fixed');
83            });
84    
85    //      $('table#results td').bind('click', click_on_cell);
86    
87          $('#status').bind('click', function() {          $('#status').bind('click', function() {
88                  $('form#sql').toggleClass('visible').addClass('fixed');                  $('form#sql').toggleClass('visible').addClass('fixed');
# Line 78  $(document).ready( function() { Line 94  $(document).ready( function() {
94                  var col_nr = $('form#sql select[name=where_column]').attr('options').selectedIndex;                  var col_nr = $('form#sql select[name=where_column]').attr('options').selectedIndex;
95                  var operator = $('select[name=where_operator]').attr('options').selectedIndex;                  var operator = $('select[name=where_operator]').attr('options').selectedIndex;
96    
97                  l.html('...loading lookup for '+column+'...').css('display','block');                  l.html('...loading lookup for '+column+'...').css('display','block').scrollTop(0);
98    
99                  console.debug( this, e, column, col_nr, l );                  console.debug( this, e, column, col_nr, l );
100    
# Line 89  $(document).ready( function() { Line 105  $(document).ready( function() {
105                  var where_parts = [];                  var where_parts = [];
106                  $('input[name=where_parts]').each(function(){ if (this.checked) where_parts.push(this.value) });                  $('input[name=where_parts]').each(function(){ if (this.checked) where_parts.push(this.value) });
107                  var args = {                  var args = {
108                            table: $('input[name=from]').val(),
109                          lookup_col: column,                          lookup_col: column,
110                          where_parts: where_parts,                          where_parts: where_parts,
111                  };                  };

Legend:
Removed from v.23  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26