Changeset 6898


Ignore:
Timestamp:
03/25/10 10:28:02 (2 years ago)
Author:
MichaelDaum
Message:

Item8655:

  • backing out uggly ZonePlugin wrapper: this won't be needed
  • fixing issues discovered by jslint
Location:
trunk/JQueryPlugin
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/JQueryPlugin/data/System/JQueryPlugin.txt

    r6803 r6898  
    102102|  Version: | %$VERSION% | 
    103103|  Change History: | <!-- versions below in reverse order -->&nbsp; | 
    104 |  20 Mar 2010 (3.31): | Minifier CPAN libs removed from plugin. They will be in core CPAN lib in Foswiki 1.1 | 
    105 |  14 Mar 2010 (3.30): | upgraded =validate= to v1.7; added =wikiword= validation method; \ 
     104|  20 Mar 2010: | (3.31) Minifier CPAN libs removed from plugin. They will be in core CPAN lib in Foswiki 1.1 | 
     105|  14 Mar 2010: | (3.30) upgraded =validate= to v1.7; added =wikiword= validation method; \ 
    106106                  fixed computation of line-height in =fluidfont=; \ 
    107107                  fixed height issue in =tabpane= | 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin.pm

    r6803 r6898  
    417417} 
    418418 
    419 =begin TML 
    420  
    421 ---++ ourAddToZone($zone, $tag, $text, $requires) 
    422  
    423 This is a simple wrapper to call Foswiki::Func::addToZone() if available, or 
    424 Foswiki::Func::addToHead() otherwise (in which case, everything is added to head) 
    425  
    426 =cut 
    427  
    428 sub ourAddToZone { 
    429   my ($zone, $tag, $text, $requires) = @_; 
    430           
    431   if (not exists &Foswiki::Func::addToZone) { 
    432     Foswiki::Func::addToHEAD($tag, $text, $requires); 
    433   } else { 
    434     Foswiki::Func::addToZone($zone, $tag, $text, $requires); 
    435   } 
    436  
    437   return; 
    438 } 
    439  
    440  
    4414191; 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/FOSWIKI.pm

    r6642 r6898  
    9191  my $footer = "<script type='text/javascript' src='%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/plugins/foswiki/$js'></script>\n"; 
    9292 
    93   Foswiki::Plugins::JQueryPlugin::ourAddToZone('head', 'JQUERYPLUGIN::FOSWIKI', $header, 'JQUERYPLUGIN'); 
    94   Foswiki::Plugins::JQueryPlugin::ourAddToZone('body', 'JQUERYPLUGIN::FOSWIKI', $footer, 'JQUERYPLUGIN'); 
     93  Foswiki::Func::addToZone('head', 'JQUERYPLUGIN::FOSWIKI', $header, 'JQUERYPLUGIN'); 
     94  Foswiki::Func::addToZone('body', 'JQUERYPLUGIN::FOSWIKI', $footer, 'JQUERYPLUGIN'); 
    9595 
    9696} 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/GRID.pm

    r6748 r6898  
    8787 
    8888  my $header .= "<script type='text/javascript' src='$Foswiki::cfg{PubUrlPath}/$localePath'></script>\n"; 
    89   Foswiki::Plugins::JQueryPlugin::ourAddToZone('body', "JQUERYPLUGIN::GRID::LANG", $header, 'JQUERYPLUGIN::UI'); 
     89  Foswiki::Func::addToZone('body', "JQUERYPLUGIN::GRID::LANG", $header, 'JQUERYPLUGIN::UI'); 
    9090} 
    9191 
     
    223223HERE 
    224224 
    225     Foswiki::Plugins::JQueryPlugin::ourAddToZone('body', "JQUERYPLUGIN::GRID::$gridId", $jsTemplate, 'JQUERYPLUGIN::GRID'); 
     225    Foswiki::Func::addToZone('body', "JQUERYPLUGIN::GRID::$gridId", $jsTemplate, 'JQUERYPLUGIN::GRID'); 
    226226 
    227227    my $result = "<table id='$gridId'></table>"; 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/Plugin.pm

    r6642 r6898  
    7676  } 
    7777 
     78 
    7879  return $this; 
    7980} 
     
    99100  # load all css 
    100101  foreach my $css (@{$this->{css}}) { 
    101     $css =~ s/\.css$/.uncompressed.css/ if $this->{debug}; 
    102     $css .= '?version='.$this->{version}; 
    103     $header .= "<link rel='stylesheet' href='$this->{puburl}/$css' type='text/css' media='all' />\n"; 
     102    $header .= $this->renderCSS($css); 
    104103  } 
    105104 
    106105  # load all javascript 
    107106  foreach my $js (@{$this->{javascript}}) { 
    108     $js =~ s/\.js$/.uncompressed.js/ if $this->{debug}; 
    109     $js .= '?version='.$this->{version}; 
    110     $footer .= "<script type='text/javascript' src='$this->{puburl}/$js'></script>\n"; 
     107    $footer .= $this->renderJS($js); 
    111108  } 
    112109 
     
    122119  } 
    123120 
    124   Foswiki::Plugins::JQueryPlugin::ourAddToZone('head', "JQUERYPLUGIN::".uc($this->{name}), $header, join(', ', @dependencies)) 
     121  Foswiki::Func::addToZone('head', "JQUERYPLUGIN::".uc($this->{name}), $header, join(', ', @dependencies)) 
    125122    if $header; 
    126   Foswiki::Plugins::JQueryPlugin::ourAddToZone('body', "JQUERYPLUGIN::".uc($this->{name}), $footer, join(', ', @dependencies)) 
     123  Foswiki::Func::addToZone('body', "JQUERYPLUGIN::".uc($this->{name}), $footer, join(', ', @dependencies)) 
    127124    if $footer; 
    128125 
    129126  return 1; 
     127} 
     128 
     129sub renderCSS { 
     130  my ($this, $text) = @_; 
     131 
     132  $text =~ s/\.css$/.uncompressed.css/ if $this->{debug}; 
     133  $text .= '?version='.$this->{version}; 
     134  $text = "<link rel='stylesheet' href='$this->{puburl}/$text' type='text/css' media='all' />\n"; 
     135 
     136  return $text; 
     137} 
     138 
     139sub renderJS { 
     140  my ($this, $text) = @_; 
     141 
     142  $text =~ s/\.js$/.uncompressed.js/ if $this->{debug}; 
     143  $text .= '?version='.$this->{version}; 
     144  $text = "<script type='text/javascript' src='$this->{puburl}/$text'></script>\n"; 
     145 
     146  return $text; 
    130147} 
    131148 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/Plugins.pm

    r6642 r6898  
    6363    if $Foswiki::cfg{JQueryPlugin}{NoConflict}; 
    6464 
    65   Foswiki::Plugins::JQueryPlugin::ourAddToZone('body', 'JQUERYPLUGIN', $footer); 
     65  Foswiki::Func::addToZone('body', 'JQUERYPLUGIN', $footer); 
    6666 
    6767  # initial plugins 
    6868  createPlugin('Foswiki'); # this one is needed anyway 
     69 
    6970  my $defaultPlugins = $Foswiki::cfg{JQueryPlugin}{DefaultPlugins}; 
    7071  if ($defaultPlugins) { 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/TOGGLE.pm

    r6642 r6898  
    9797  my $toggleId = "jqToggle".Foswiki::Plugins::JQueryPlugin::Plugins::getRandom(); 
    9898 
    99   Foswiki::Plugins::JQueryPlugin::ourAddToZone("head", "JQUERYPLUGIN::TOGGLE::$toggleId", <<"HERE", 'JQUERYPLUGIN::TOGGLE'); 
     99  Foswiki::Func::addToZone("head", "JQUERYPLUGIN::TOGGLE::$toggleId", <<"HERE", 'JQUERYPLUGIN::TOGGLE'); 
    100100<meta name="foswiki.jquery.toggle.$toggleId" content="{id:'$toggleId', onclick:$cmd}" /> 
    101101HERE 
  • trunk/JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/VALIDATE.pm

    r6748 r6898  
    7474  if (-f $messageFile) { 
    7575    $header .= "<script type='text/javascript' src='$Foswiki::cfg{PubUrlPath}/$messagePath'></script>\n"; 
    76     Foswiki::Plugins::JQueryPlugin::ourAddToZone('body', "JQUERYPLUGIN::VALIDATE::LANG", $header, 'JQUERYPLUGIN::VALIDATE'); 
     76    Foswiki::Func::addToZone('body', "JQUERYPLUGIN::VALIDATE::LANG", $header, 'JQUERYPLUGIN::VALIDATE'); 
    7777  } 
    7878 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/i18n/Makefile

    r3748 r6898  
    1 all: jquery-ui-i18n.js jquery-ui-i18n.js.gz 
     1TARGET=jquery-ui-i18n.js  
    22-include ../Makefile.include 
     3 
     4UI_DATEPICKER_SOURCE=\ 
     5  ui.datepicker-ar.js\ 
     6  ui.datepicker-bg.js\ 
     7  ui.datepicker-ca.js\ 
     8  ui.datepicker-cs.js\ 
     9  ui.datepicker-da.js\ 
     10  ui.datepicker-de.js\ 
     11  ui.datepicker-el.js\ 
     12  ui.datepicker-eo.js\ 
     13  ui.datepicker-es.js\ 
     14  ui.datepicker-fa.js\ 
     15  ui.datepicker-fi.js\ 
     16  ui.datepicker-fr.js\ 
     17  ui.datepicker-he.js\ 
     18  ui.datepicker-hr.js\ 
     19  ui.datepicker-hu.js\ 
     20  ui.datepicker-hy.js\ 
     21  ui.datepicker-id.js\ 
     22  ui.datepicker-is.js\ 
     23  ui.datepicker-it.js\ 
     24  ui.datepicker-ja.js\ 
     25  ui.datepicker-ko.js\ 
     26  ui.datepicker-lt.js\ 
     27  ui.datepicker-lv.js\ 
     28  ui.datepicker-ms.js\ 
     29  ui.datepicker-nl.js\ 
     30  ui.datepicker-no.js\ 
     31  ui.datepicker-pl.js\ 
     32  ui.datepicker-pt-BR.js\ 
     33  ui.datepicker-ro.js\ 
     34  ui.datepicker-ru.js\ 
     35  ui.datepicker-sk.js\ 
     36  ui.datepicker-sl.js\ 
     37  ui.datepicker-sq.js\ 
     38  ui.datepicker-sr-SR.js\ 
     39  ui.datepicker-sr.js\ 
     40  ui.datepicker-sv.js\ 
     41  ui.datepicker-th.js\ 
     42  ui.datepicker-tr.js\ 
     43  ui.datepicker-uk.js\ 
     44  ui.datepicker-zh-CN.js\ 
     45  ui.datepicker-zh-TW.js 
     46 
     47jquery-ui-i18n.uncompressed.js: $(UI_DATEPICKER_SOURCE) 
     48        @echo "creating $@" 
     49        @$(CAT) $(UI_DATEPICKER_SOURCE) > $@ 
     50 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/plugins/foswiki/jquery.foswiki.uncompressed.js

    r6600 r6898  
    55*/ 
    66var foswiki; 
    7 if (typeof(foswiki) == "undefined") { 
     7if (typeof(foswiki) === "undefined") { 
    88  foswiki = {}; 
    99} 
     
    3434   * based on the keys descriptor.  
    3535   */ 
    36   function createMember(obj, keys, val) { 
     36  foswiki.createMember = function(obj, keys, val) { 
    3737    var key = keys.shift(); 
    3838    if (keys.length > 0) { 
     
    4242      } 
    4343      // recurse 
    44       createMember(obj[key], keys, val); 
     44      foswiki.createMember(obj[key], keys, val); 
    4545    } else { 
    4646      // store value 
     
    6666      keys = this.name.split(/\./); 
    6767      keys.shift(); // take out the first one 
    68       createMember(foswiki, keys, val); 
     68      foswiki.createMember(foswiki, keys, val); 
    6969    }); 
    7070  }); 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/plugins/textboxlist/jquery.textboxlist.uncompressed.js

    r6600 r6898  
    3434    var self = this, autocompleteOpts; 
    3535    self.input = $(elem); 
     36    elem.textboxList = self; 
    3637 
    3738    // build element specific options.  
     
    164165  $.TextboxLister.prototype.select = function(values, suppressCallback) { 
    165166    $.log("TEXTBOXLIST: called select("+values+") "+typeof(values)); 
    166     var self = this, i, j, val, found, currentVal, input, close; 
     167    var self = this, i, j, val, label, found, currentVal, input, close; 
    167168 
    168169    if (typeof(values) === 'object') { 
     
    183184          continue; 
    184185        } 
    185         $.log("val='"+val+"'"); 
    186186        for (j = 0; j < self.currentValues.length; j++) { 
    187187          currentVal = self.currentValues[j]; 
     
    213213    self.container.find("."+self.opts.listValueClass).remove(); 
    214214    for (i = self.currentValues.length-1; i >= 0; i--) { 
    215       val = self.currentValues[i]; 
     215      val = label = self.currentValues[i]; 
    216216      if (!val) { 
    217217        continue; 
    218218      } 
     219      if (val.match(/^(.+)=(.+)$/)) { 
     220        val = RegExp.$1; 
     221        label = RegExp.$2; 
     222      } 
     223      $.log("val="+val+" label="+label); 
    219224      input = "<input type='hidden' name='"+self.opts.inputName+"' value='"+val+"' />"; 
    220225      close = $("<a href='#' title='remove "+val+"'></a>"). 
    221226        addClass(self.opts.closeClass). 
    222         click(function() { 
    223           self.deselect.call(self, $(this).parent().find("input").val()); 
     227        click(function(e) { 
     228          e.preventDefault(); 
     229          self.input.trigger("DeleteValue", $(this).parent().find("input").val()); 
    224230          return false; 
    225231        }); 
     
    227233        append(input). 
    228234        append(close). 
    229         append(val). 
     235        append(label). 
    230236        prependTo(self.container); 
    231237    } 
  • trunk/JQueryPlugin/pub/System/JQueryPlugin/plugins/treeview/jquery.treeview.uncompressed.css

    r4688 r6898  
    128128  display: block; 
    129129} 
    130  
     130.treeview .open .placeholder { 
     131  display:none; 
     132} 
     133.treeview .open .placeholder { 
     134  display:none; 
     135} 
Note: See TracChangeset for help on using the changeset viewer.