/** * ----------------------------------------------------------------------------- * file: ui.inputTag.js * file version: 1.1.1 * date: 2012-06-18 * * A jQuery plugin provided by the piwigo's plugin "GrumPluginClasses" * * ----------------------------------------------------------------------------- * Author : Grum * email : grum@piwigo.com * website : http://photos.grum.fr * * << May the Little SpaceFrog be with you ! >> * ----------------------------------------------------------------------------- * * * * * :: HISTORY :: * * | release | date | * | 1.0.0 | 2010/10/10 | * first release * | | | * | 1.1.0 | 2010/11/03 | * add 'isValid' method * | | | * | 1.1.1 | 2012/06/18 | * improve memory managment * | | | * | | | * | | | * */ ( function($) { /* * plugin 'public' functions */ var publicMethods = { init : function (opt) { return this.each(function() { // default values for the plugin var $this=$(this), data = $this.data('options'), objects = $this.data('objects'), properties = $this.data('properties'), options = { ignoreCase:true, //allowCreate:false, serverUrl:'', serverCallDelay:250, postData:{}, // additional free data sent to the server listMaxWidth:0, listMaxHeight:0, maximumTagLoaded:0, //0 = no limits textStart:'Start to type text...', textFound:'%s tags found', textDisplay:'display only %s tags', mode:'public', filter:'affected', inputNumCar:5, add:null, remove:null, popup:null, load:null }; // if options given, merge it // if(opt) $.extend(options, opt); ==> options are set by setters $this.data('options', options); if(!properties) { $this.data('properties', { initialized:false, selectorVisible:false, totalTags:0, tags:[], // a tag = {id:0, name:''} cache:[], timerHandle:null, isValid:true } ); properties=$this.data('properties'); } if(!objects) { objects = { container:$('
', { 'class':'ui-tag-selector-input', css:{ width:'100%' } } ).bind('click.inputTag', function () { objects.input.focus(); } ), selectedTagList:$('