/[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 59 by dpavlin, Sun Aug 20 23:37:52 2006 UTC revision 65 by dpavlin, Sun Sep 3 10:36:48 2006 UTC
# Line 119  function tac( Line 119  function tac(
119    
120  tac.prototype.suggest = function( partial ) {  tac.prototype.suggest = function( partial ) {
121    
122          $.log.info('suggest to '+partial);          $.log.info('suggest to \''+partial+'\'');
123    
124          var len = partial.length;          var len = partial.length;
125          var suggest = '';          var suggest = '';
# Line 285  tac.prototype.parse = function() { Line 285  tac.prototype.parse = function() {
285          var t = $(this.tags_input).val().replace(/^  */,'').replace(/  *$/,'').split(/ /);          var t = $(this.tags_input).val().replace(/^  */,'').replace(/  *$/,'').split(/ /);
286    
287          if (this.entered.ordered.length) $('.entered').removeClass('entered');          if (this.entered.ordered.length) $('.entered').removeClass('entered');
         this.clean_suggested();  
288    
289          this.entered = {          this.entered = {
290                  ordered: new Array(),                  ordered: new Array(),
# Line 309  tac.prototype.parse = function() { Line 308  tac.prototype.parse = function() {
308    
309  tac.prototype.current_tag = function() {  tac.prototype.current_tag = function() {
310          var tags = $(this.tags_input).val();          var tags = $(this.tags_input).val();
311            var t = this;
312          if (tags != this.last_tags) {          if (tags != this.last_tags) {
313                  this.last_tags = tags;                  this.last_tags = tags;
314                  this.parse();                  defer(function() { t.parse() }, 500, 'parse');
315          }          }
316          var last_tag = tags.replace(/^([^ ][^ ]* )*/, '');          var last_tag = tags.replace(/^([^ ][^ ]* )*/, '');
317          if (last_tag != this.last_tag) {          if (last_tag != this.last_tag) {
318                  this.last_tag = last_tag;                  this.last_tag = last_tag;
                 return last_tag;  
319          } else {          } else {
320                  this.parse();                  defer(function() { t.parse() }, 500, 'parse');
                 return '';  
321          }          }
322            return this.last_tag;
323  }  }
324    
325  tac.prototype.focus = function() {  tac.prototype.focus = function() {

Legend:
Removed from v.59  
changed lines
  Added in v.65

  ViewVC Help
Powered by ViewVC 1.1.26