Ignore:
Timestamp:
Jan 28, 2011, 4:54:02 PM (13 years ago)
Author:
grum
Message:

release 3.4.0
fix bug:1984, bug:2109
js file are minified, remove packed files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/js/ui.tagSelector.js

    r7370 r8961  
    2222 *
    2323 * | release | date       |
    24  * | 1.0.0   | 2010/10/10 | first release
     24 * | 1.0.0   | 2010/10/10 | * first release
    2525 * |         |            |
     26 * | 1.1.0   | 2010/11/03 | * add 'isValid' method
    2627 * |         |            |
    2728 * |         |            |
     
    9394                    cache:[],
    9495                    timerHandle:null,
     96                    isValid:true
    9597                  }
    9698                );
     
    118120                      {
    119121                        html: '',
    120                         'class':'ui-tag-selector-selected-tag-list',
     122                        'class':'ui-tag-selector-selected-tag-list'
    121123                      }
    122124                    ),
     
    151153                            display:'none',
    152154                            position:'absolute',
    153                             zIndex:9999,
     155                            zIndex:9999
    154156                          }
    155157                        }
     
    166168                          padding:'0px',
    167169                          margin:'0px',
    168                           overflow:"auto",
     170                          overflow:"auto"
    169171                        }
    170172                      }
     
    217219      options: function (value)
    218220        {
    219           this.each(function()
    220             {
    221               var $this=$(this);
    222               privateMethods.setOptions($this, value);
    223               return($this);
     221          return this.each(function()
     222            {
     223              privateMethods.setOptions($(this), value);
    224224            }
    225225          );
     
    229229      ignoreCase: function (value)
    230230        {
    231           if(value)
    232           {
    233             this.each(function()
    234               {
    235                 var $this=$(this);
    236                 privateMethods.setIgnoreCase($this, value);
    237                 return($this);
     231          if(value!=null)
     232          {
     233            return this.each(function()
     234              {
     235                privateMethods.setIgnoreCase($(this), value);
    238236              }
    239237            );
     
    256254      inputNumCar: function (value)
    257255        {
    258           if(value)
    259           {
    260             this.each(function()
    261               {
    262                 var $this=$(this);
    263                 privateMethods.setInputNumCar($this, value);
    264                 return($this);
     256          if(value!=null)
     257          {
     258            return this.each(function()
     259              {
     260                privateMethods.setInputNumCar($(this), value);
    265261              }
    266262            );
     
    311307      maximumTagLoaded: function (value)
    312308        {
    313           if(value)
    314           {
    315             this.each(function()
    316               {
    317                 var $this=$(this);
    318                 privateMethods.setMaximumTagLoaded($this, value);
    319                 return($this);
     309          if(value!=null)
     310          {
     311            return this.each(function()
     312              {
     313                privateMethods.setMaximumTagLoaded($(this), value);
    320314              }
    321315            );
     
    338332      listMaxWidth: function (value)
    339333        {
    340           if(value)
    341           {
    342             this.each(function()
    343               {
    344                 var $this=$(this);
    345                 privateMethods.setListMaxWidth($this, value);
    346                 return($this);
     334          if(value!=null)
     335          {
     336            return this.each(function()
     337              {
     338                privateMethods.setListMaxWidth($(this), value);
    347339              }
    348340            );
     
    365357      listMaxHeight: function (value)
    366358        {
    367           if(value)
    368           {
    369             this.each(function()
    370               {
    371                 var $this=$(this);
    372                 privateMethods.setListMaxHeight($this, value);
    373                 return($this);
     359          if(value!=null)
     360          {
     361            return this.each(function()
     362              {
     363                privateMethods.setListMaxHeight($(this), value);
    374364              }
    375365            );
     
    393383      serverCallDelay: function (value)
    394384        {
    395           if(value)
    396           {
    397             this.each(function()
    398               {
    399                 var $this=$(this);
    400                 privateMethods.setServerCallDelay($this, value);
    401                 return($this);
     385          if(value!=null)
     386          {
     387            return this.each(function()
     388              {
     389                privateMethods.setServerCallDelay($(this), value);
    402390              }
    403391            );
     
    421409      serverUrl: function (value)
    422410        {
    423           if(value)
    424           {
    425             this.each(function()
    426               {
    427                 var $this=$(this);
    428                 privateMethods.setServerUrl($this, value);
    429                 return($this);
     411          if(value!=null)
     412          {
     413            return this.each(function()
     414              {
     415                privateMethods.setServerUrl($(this), value);
    430416              }
    431417            );
     
    448434      textStart: function (value)
    449435        {
    450           if(value)
    451           {
    452             this.each(function()
    453               {
    454                 var $this=$(this);
    455                 privateMethods.setTextStart($this, value);
    456                 return($this);
     436          if(value!=null)
     437          {
     438            return this.each(function()
     439              {
     440                privateMethods.setTextStart($(this), value);
    457441              }
    458442            );
     
    475459      textFound: function (value)
    476460        {
    477           if(value)
    478           {
    479             this.each(function()
    480               {
    481                 var $this=$(this);
    482                 privateMethods.setTextFound($this, value);
    483                 return($this);
     461          if(value!=null)
     462          {
     463            return this.each(function()
     464              {
     465                privateMethods.setTextFound($(this), value);
    484466              }
    485467            );
     
    502484      textDisplay: function (value)
    503485        {
    504           if(value)
    505           {
    506             this.each(function()
    507               {
    508                 var $this=$(this);
    509                 privateMethods.setTextDisplay($this, value);
    510                 return($this);
     486          if(value!=null)
     487          {
     488            return this.each(function()
     489              {
     490                privateMethods.setTextDisplay($(this), value);
    511491              }
    512492            );
     
    529509      filter: function (value)
    530510        {
    531           if(value)
    532           {
    533             this.each(function()
    534               {
    535                 var $this=$(this);
    536                 privateMethods.setFilter($this, value);
    537                 return($this);
     511          if(value!=null)
     512          {
     513            return this.each(function()
     514              {
     515                privateMethods.setFilter($(this), value);
    538516              }
    539517            );
     
    556534      mode: function (value)
    557535        {
    558           if(value)
    559           {
    560             this.each(function()
    561               {
    562                 var $this=$(this);
    563                 privateMethods.setMode($this, value);
    564                 return($this);
     536          if(value!=null)
     537          {
     538            return this.each(function()
     539              {
     540                privateMethods.setMode($(this), value);
    565541              }
    566542            );
     
    583559      value: function (value)
    584560        {
    585           if(value)
     561          if(value!=null)
    586562          {
    587563            // set selected value
     
    596572            // return the selected tags
    597573            var properties=this.data('properties');
     574
    598575            return(properties.tags);
    599576          }
    600577        }, // value
     578
     579      isValid: function (value)
     580        {
     581          if(value!=null)
     582          {
     583            // set selected value
     584            return this.each(function()
     585              {
     586                privateMethods.setIsValid($(this), value);
     587              }
     588            );
     589          }
     590          else
     591          {
     592            // return the selected tags
     593            var properties=this.data('properties');
     594
     595            return(properties.isValid);
     596          }
     597        }, // isValid
    601598
    602599      load: function (value)
     
    610607          {
    611608            // set selected value
    612             this.each(function()
    613               {
    614                 var $this=$(this);
    615                 privateMethods.setEventLoad($this, value);
    616                 return($this);
     609            return this.each(function()
     610              {
     611                privateMethods.setEventLoad($(this), value);
    617612              }
    618613            );
     
    630625          {
    631626            // set selected value
    632             this.each(function()
    633               {
    634                 var $this=$(this);
    635                 privateMethods.setEventPopup($this, value);
    636                 return($this);
     627            return this.each(function()
     628              {
     629                privateMethods.setEventPopup($(this), value);
    637630              }
    638631            );
     
    658651          {
    659652            // set selected value
    660             this.each(function()
    661               {
    662                 var $this=$(this);
    663                 privateMethods.setEventAdd($this, value);
    664                 return($this);
     653            return this.each(function()
     654              {
     655                privateMethods.setEventAdd($(this), value);
    665656              }
    666657            );
     
    686677          {
    687678            // set selected value
    688             this.each(function()
    689               {
    690                 var $this=$(this);
    691                 privateMethods.setEventRemove($this, value);
    692                 return($this);
     679            return this.each(function()
     680              {
     681                privateMethods.setEventRemove($(this), value);
    693682              }
    694683            );
     
    764753        },
    765754
     755      setIsValid : function (object, value)
     756        {
     757          var objects=object.data('objects'),
     758              properties=object.data('properties');
     759
     760          if(properties.isValid!=value)
     761          {
     762            properties.isValid=value;
     763            if(properties.isValid)
     764            {
     765              objects.container.removeClass('ui-error');
     766              objects.input.removeClass('ui-error');
     767            }
     768            else
     769            {
     770              objects.container.addClass('ui-error');
     771              objects.input.addClass('ui-error');
     772            }
     773          }
     774          return(properties.isValid);
     775        },
     776
    766777      setIgnoreCase : function (object, value)
    767778        {
    768779          var options=object.data('options'),
    769780              properties=object.data('properties');
     781
    770782          if((!properties.initialized || options.ignoreCase!=value) && (value==true || value==false))
    771783          {
     
    780792              objects=object.data('objects'),
    781793              properties=object.data('properties');
     794
    782795          if((!properties.initialized || options.inputNumCar!=value) && value>0)
    783796          {
     
    805818          var options=object.data('options'),
    806819              properties=object.data('properties');
     820
    807821          if((!properties.initialized || options.setMaximumTagLoaded!=value) && value>=0)
    808822          {
     
    817831          var options=object.data('options'),
    818832              properties=object.data('properties');
     833
    819834          if(!properties.initialized || options.textStart!=value)
    820835          {
     
    828843          var options=object.data('options'),
    829844              properties=object.data('properties');
     845
    830846          if(!properties.initialized || options.textFound!=value)
    831847          {
     
    839855          var options=object.data('options'),
    840856              properties=object.data('properties');
     857
    841858          if(!properties.initialized || options.textDisplay!=value)
    842859          {
     
    851868              properties=object.data('properties'),
    852869              objects=object.data('objects');
     870
    853871          if((!properties.initialized || options.listMaxWidth!=value) && value>=0)
    854872          {
     
    871889              properties=object.data('properties'),
    872890              objects=object.data('objects');
     891
    873892          if((!properties.initialized || options.listMaxHeight!=value) && value>=0)
    874893          {
     
    890909          var options=object.data('options'),
    891910              properties=object.data('properties');
     911
    892912          if((!properties.initialized || options.serverCallDelay!=value) && value>0 )
    893913          {
     
    901921          var options=object.data('options'),
    902922              properties=object.data('properties');
     923
    903924          if(!properties.initialized || options.serverUrl!=value)
    904925          {
     
    914935          var options=object.data('options'),
    915936              properties=object.data('properties');
     937
    916938          if((!properties.initialized || options.mode!=value) && (value=='admin' || value=='public'))
    917939          {
     
    925947          var options=object.data('options'),
    926948              properties=object.data('properties');
     949
    927950          if((!properties.initialized || options.filter!=value) && (value=='all' || value=='affected'))
    928951          {
     
    935958      setValue : function (object, value)
    936959        {
    937           var options=object.data('options'),
    938               properties=object.data('properties'),
     960          var properties=object.data('properties'),
    939961              objects=object.data('objects');
    940962
     
    10711093                {
    10721094                  objects.selectorList.html('Error ! '+msg);
    1073                 },
     1095                }
    10741096            }
    10751097         );
     
    10801102          // clear the cache tag list
    10811103          var objects=object.data('objects'),
    1082               options=object.data('options'),
    10831104              properties=object.data('properties');
    10841105
     
    10861107          properties.cache=[];
    10871108        },
     1109
    10881110      cacheAddItems : function (object, listItems)
    10891111        {
     
    10981120              {
    10991121                id:listItems[i].id,
    1100                 name:listItems[i].name,
     1122                name:listItems[i].name
    11011123              }
    11021124            );
     
    12131235        {
    12141236          var options=object.data('options');
     1237
    12151238          options.popup=value;
    12161239          object.unbind('tagSelectorPopup');
     
    12181241          return(options.popup);
    12191242        },
     1243
    12201244      setEventAdd : function (object, value)
    12211245        {
    12221246          var options=object.data('options');
     1247
    12231248          options.add=value;
    12241249          object.unbind('tagSelectorAdd');
     
    12261251          return(options.add);
    12271252        },
     1253
    12281254      setEventRemove : function (object, value)
    12291255        {
    12301256          var options=object.data('options');
     1257
    12311258          options.remove=value;
    12321259          object.unbind('tagSelectorRemove');
     
    12341261          return(options.remove);
    12351262        },
     1263
    12361264      setEventLoad : function (object, value)
    12371265        {
     
    12531281          }
    12541282        },
     1283
    12551284      setTimerHandle : function(object)
    12561285        {
Note: See TracChangeset for help on using the changeset viewer.