/** * ----------------------------------------------------------------------------- * file: ui.tagSelector.js * file version: 1.0.0 * date: 2010-10-22 * * A jQuery plugin provided by the piwigo's plugin "GrumPluginClasses" * * ----------------------------------------------------------------------------- * Author : Grum * email : grum@piwigo.com * website : http://photos.grum.fr * PWG user : http://forum.phpwebgallery.net/profile.php?id=3706 * * << May the Little SpaceFrog be with you ! >> * ----------------------------------------------------------------------------- * * * * * :: HISTORY :: * * | release | date | * | 1.0.0 | 2010/10/10 | first release * | | | * | | | * | | | * | | | * | | | * | | | * */ ( 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:'plugins/GrumPluginClasses/gpc_ajax.php', serverCallDelay:250, 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, } ); properties=$this.data('properties'); } if(!objects) { objects = { container:$('
', { 'class':'ui-tag-selector-input', css:{ width:'100%' } } ).bind('click.tagSelector', function () { objects.input.focus(); } ), selectedTagList:$('