/[jquery]/tag_complete/jquery-tac.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 /tag_complete/jquery-tac.js

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

revision 54 by dpavlin, Sun Aug 20 03:35:32 2006 UTC revision 56 by dpavlin, Sun Aug 20 17:10:26 2006 UTC
# Line 67  function tac( Line 67  function tac(
67                                  obj.move_suggested( +1 );                                  obj.move_suggested( +1 );
68                                  return false;                                  return false;
69                          case 9:         // tab                          case 9:         // tab
70                                    obj.focus();
71                                    obj.take_suggested();
72                                    return false;
73                          case 13:        // return                          case 13:        // return
74                                  if (obj.current_selected != null) obj.focus();                                  if (obj.current_selected != null) obj.focus();
75                                  e.preventDefault();                                  return true;
                                 return false;  
76                          case 8:         // backspace                          case 8:         // backspace
77                          case 46:        // del                          case 46:        // del
78                                  obj.parse();                                  obj.parse();
# Line 117  tac.prototype.suggest = function( partia Line 119  tac.prototype.suggest = function( partia
119    
120                          jQuery.className.add( this.t.obj[t], 'suggested' );                          jQuery.className.add( this.t.obj[t], 'suggested' );
121    
122                          suggest += '<a href="#'+i+'"';                          suggest += '<a href="#"';
123                          if (this.suggested.length == 0) suggest += ' class="suggested" ';                          if (this.suggested.length == 0) suggest += ' class="suggested" ';
124                          suggest += ' onclick="javascript:return this.tag(\'' + t + '\')">' +                          suggest += '">' + t + '</a> ';
                                 t + '</a> ';  
125                          this.suggested.push(t);                          this.suggested.push(t);
126                  }                  }
127          }          }
128    
129          $(this.suggest_selector).html( suggest );          $(this.suggest_selector).html( suggest );
130            var obj = this;
131            $(this.suggest_selector+' a').click( function() {
132                    var t = this.firstChild.nodeValue;
133                    $.log.debug('click add: '+ t);
134                    obj.clean_suggested();
135                    obj.tag( t );
136            });
137          this.current_suggested = 0;          this.current_suggested = 0;
138          $.log.info('suggested ' + this.suggested.length + ' tags');          $.log.info('suggested ' + this.suggested.length + ' tags');
139    
# Line 161  tac.prototype.take_suggested = function( Line 169  tac.prototype.take_suggested = function(
169          }          }
170    
171          var i = this.suggested[c].i;          var i = this.suggested[c].i;
172          $.log.debug('take_suggested '+i+':'+s);          $.log.debug('take_suggested: '+s);
173          this.add_tag( s );          this.add_tag( s );
174          return false;          return false;
175  }  }

Legend:
Removed from v.54  
changed lines
  Added in v.56

  ViewVC Help
Powered by ViewVC 1.1.26