Changeset 8961 for extensions/GrumPluginClasses/js/ui.tagSelector.js
- Timestamp:
- Jan 28, 2011, 4:54:02 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/js/ui.tagSelector.js
r7370 r8961 22 22 * 23 23 * | release | date | 24 * | 1.0.0 | 2010/10/10 | first release24 * | 1.0.0 | 2010/10/10 | * first release 25 25 * | | | 26 * | 1.1.0 | 2010/11/03 | * add 'isValid' method 26 27 * | | | 27 28 * | | | … … 93 94 cache:[], 94 95 timerHandle:null, 96 isValid:true 95 97 } 96 98 ); … … 118 120 { 119 121 html: '', 120 'class':'ui-tag-selector-selected-tag-list' ,122 'class':'ui-tag-selector-selected-tag-list' 121 123 } 122 124 ), … … 151 153 display:'none', 152 154 position:'absolute', 153 zIndex:9999 ,155 zIndex:9999 154 156 } 155 157 } … … 166 168 padding:'0px', 167 169 margin:'0px', 168 overflow:"auto" ,170 overflow:"auto" 169 171 } 170 172 } … … 217 219 options: function (value) 218 220 { 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); 224 224 } 225 225 ); … … 229 229 ignoreCase: function (value) 230 230 { 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); 238 236 } 239 237 ); … … 256 254 inputNumCar: function (value) 257 255 { 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); 265 261 } 266 262 ); … … 311 307 maximumTagLoaded: function (value) 312 308 { 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); 320 314 } 321 315 ); … … 338 332 listMaxWidth: function (value) 339 333 { 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); 347 339 } 348 340 ); … … 365 357 listMaxHeight: function (value) 366 358 { 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); 374 364 } 375 365 ); … … 393 383 serverCallDelay: function (value) 394 384 { 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); 402 390 } 403 391 ); … … 421 409 serverUrl: function (value) 422 410 { 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); 430 416 } 431 417 ); … … 448 434 textStart: function (value) 449 435 { 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); 457 441 } 458 442 ); … … 475 459 textFound: function (value) 476 460 { 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); 484 466 } 485 467 ); … … 502 484 textDisplay: function (value) 503 485 { 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); 511 491 } 512 492 ); … … 529 509 filter: function (value) 530 510 { 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); 538 516 } 539 517 ); … … 556 534 mode: function (value) 557 535 { 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); 565 541 } 566 542 ); … … 583 559 value: function (value) 584 560 { 585 if(value )561 if(value!=null) 586 562 { 587 563 // set selected value … … 596 572 // return the selected tags 597 573 var properties=this.data('properties'); 574 598 575 return(properties.tags); 599 576 } 600 577 }, // 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 601 598 602 599 load: function (value) … … 610 607 { 611 608 // 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); 617 612 } 618 613 ); … … 630 625 { 631 626 // 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); 637 630 } 638 631 ); … … 658 651 { 659 652 // 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); 665 656 } 666 657 ); … … 686 677 { 687 678 // 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); 693 682 } 694 683 ); … … 764 753 }, 765 754 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 766 777 setIgnoreCase : function (object, value) 767 778 { 768 779 var options=object.data('options'), 769 780 properties=object.data('properties'); 781 770 782 if((!properties.initialized || options.ignoreCase!=value) && (value==true || value==false)) 771 783 { … … 780 792 objects=object.data('objects'), 781 793 properties=object.data('properties'); 794 782 795 if((!properties.initialized || options.inputNumCar!=value) && value>0) 783 796 { … … 805 818 var options=object.data('options'), 806 819 properties=object.data('properties'); 820 807 821 if((!properties.initialized || options.setMaximumTagLoaded!=value) && value>=0) 808 822 { … … 817 831 var options=object.data('options'), 818 832 properties=object.data('properties'); 833 819 834 if(!properties.initialized || options.textStart!=value) 820 835 { … … 828 843 var options=object.data('options'), 829 844 properties=object.data('properties'); 845 830 846 if(!properties.initialized || options.textFound!=value) 831 847 { … … 839 855 var options=object.data('options'), 840 856 properties=object.data('properties'); 857 841 858 if(!properties.initialized || options.textDisplay!=value) 842 859 { … … 851 868 properties=object.data('properties'), 852 869 objects=object.data('objects'); 870 853 871 if((!properties.initialized || options.listMaxWidth!=value) && value>=0) 854 872 { … … 871 889 properties=object.data('properties'), 872 890 objects=object.data('objects'); 891 873 892 if((!properties.initialized || options.listMaxHeight!=value) && value>=0) 874 893 { … … 890 909 var options=object.data('options'), 891 910 properties=object.data('properties'); 911 892 912 if((!properties.initialized || options.serverCallDelay!=value) && value>0 ) 893 913 { … … 901 921 var options=object.data('options'), 902 922 properties=object.data('properties'); 923 903 924 if(!properties.initialized || options.serverUrl!=value) 904 925 { … … 914 935 var options=object.data('options'), 915 936 properties=object.data('properties'); 937 916 938 if((!properties.initialized || options.mode!=value) && (value=='admin' || value=='public')) 917 939 { … … 925 947 var options=object.data('options'), 926 948 properties=object.data('properties'); 949 927 950 if((!properties.initialized || options.filter!=value) && (value=='all' || value=='affected')) 928 951 { … … 935 958 setValue : function (object, value) 936 959 { 937 var options=object.data('options'), 938 properties=object.data('properties'), 960 var properties=object.data('properties'), 939 961 objects=object.data('objects'); 940 962 … … 1071 1093 { 1072 1094 objects.selectorList.html('Error ! '+msg); 1073 } ,1095 } 1074 1096 } 1075 1097 ); … … 1080 1102 // clear the cache tag list 1081 1103 var objects=object.data('objects'), 1082 options=object.data('options'),1083 1104 properties=object.data('properties'); 1084 1105 … … 1086 1107 properties.cache=[]; 1087 1108 }, 1109 1088 1110 cacheAddItems : function (object, listItems) 1089 1111 { … … 1098 1120 { 1099 1121 id:listItems[i].id, 1100 name:listItems[i].name ,1122 name:listItems[i].name 1101 1123 } 1102 1124 ); … … 1213 1235 { 1214 1236 var options=object.data('options'); 1237 1215 1238 options.popup=value; 1216 1239 object.unbind('tagSelectorPopup'); … … 1218 1241 return(options.popup); 1219 1242 }, 1243 1220 1244 setEventAdd : function (object, value) 1221 1245 { 1222 1246 var options=object.data('options'); 1247 1223 1248 options.add=value; 1224 1249 object.unbind('tagSelectorAdd'); … … 1226 1251 return(options.add); 1227 1252 }, 1253 1228 1254 setEventRemove : function (object, value) 1229 1255 { 1230 1256 var options=object.data('options'); 1257 1231 1258 options.remove=value; 1232 1259 object.unbind('tagSelectorRemove'); … … 1234 1261 return(options.remove); 1235 1262 }, 1263 1236 1264 setEventLoad : function (object, value) 1237 1265 { … … 1253 1281 } 1254 1282 }, 1283 1255 1284 setTimerHandle : function(object) 1256 1285 {
Note: See TracChangeset
for help on using the changeset viewer.