o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1360871912.272655:@value"©!{I" class:EFI"BundledAsset; FI"logical_path; FI"cytoplasm/cytoSlider.js; FI" pathname; FI"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSlider.js.erb; FI"content_type; FI"application/javascript; FI" mtime; FI"2013-02-14T14:40:46-05:00; FI"length; FiºI"digest; F"%74a92b5041382395ff0c8392804a2792I"source; FI"º// CytoSlider v0.5 // By MacKinley Smith (function($){ var defaults = { dimensions:1, widget:{ label:{ css:{ font:'13px TitilliumTextThin' }, element:false, html:"", readout:{ css:{}, unit:false } }, sliders:{ css:{}, elements:[], options:{ min:0, max:100, value:0, step:1, slide:function(e,ui){}, change:function(e,ui){} } }, wrapper:{ css:{ padding:"5px 0px" }, element:false } }, events:{ create:function(cy){}, change:function(cy,event){}, destroy:function(cy){}, resize:function(cy,event){} } }; var methods = { init:function(options,reinit){ if (reinit==null) reinit = false; return this.each(function(){ var $this = $(this); if ($this.data('cytoSlider')!=null) return console.warn("You cannot reinstatiate cytoSlider before calling the destroy method.\nProtip: Use the refresh method to reinstantiate in one move."); if (!$this.hasClass('cytoSlider')) $this.addClass("cytoSlider"); // Initialize settings var settings; if (!reinit) { settings = $.extend(true,{},defaults,options); if ($this.data('settings')!=null) settings = $.extend(true,{},settings,$this.data('settings')); if ($this.data('dimensions')!=null) settings.dimensions = $this.data('dimensions'); if ($this.data('label')!=null) settings.widget.label.html = $this.data('label'); if ($this.data('unit')!=null) settings.widget.label.readout.unit = $this.data('unit'); if ($this.data('min')!=null) settings.widget.sliders.options.min = $this.data('min'); if ($this.data('max')!=null) settings.widget.sliders.options.max = $this.data('max'); if ($this.data('step')!=null) settings.widget.sliders.options.step = $this.data('step'); if ($this.val()!=null && $this.val()!="") settings.widget.sliders.options.value = parseInt($this.val()); } else settings = options; // Generate widget settings.widget.wrapper.element = $this.wrap("
").parent().addClass('cytoSlider-wrapper').css(settings.widget.wrapper.css); settings.widget.label.element = $('').attr("for",$this.attr("name")).addClass('cytoSlider-label').css(settings.widget.label.css).html(settings.widget.label.html+": ").prependTo(settings.widget.wrapper.element); settings.widget.label.readout.element = $('').addClass("cytoSlider-label-readout").css(settings.widget.label.readout.css).appendTo(settings.widget.label.element); // Bindings $this.bind("change.cytoSlider",function(e){ settings.widget.label.readout.element.html($(this).val()); settings.events.change.apply($this,[settings,e]); }); // Generate sliders $this.data('cytoSlider',settings); methods.setDimensions.apply($this,[settings.dimensions]); // Save settings data to input $this.data('cytoSlider',settings); methods.resize.apply($this); settings.events.create.apply($this,[settings]); }); }, destroy:function(){ return this.each(function(){ var $this = $(this); var settings = $this.data('cytoSlider'); if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the destroy method!"); // Destroy widget $this.unbind(".cytoSlider").removeClass("cytoSlider").data("cytoSlider",null).insertBefore(settings.widget.wrapper.element); settings.widget.wrapper.element.remove(); settings.events.destroy.apply($this,[settings]); }); }, refresh:function(){ return this.each(function(){ var $this = $(this); var settings = $this.data('cytoSlider'); if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the refresh method!"); // Destroy and reinit methods.destroy.apply($this); methods.init.apply($this,[settings,true]); $this.trigger('change.cytoSlider'); }); }, resize:function(){ return this.each(function(){ var $this = $(this); var settings = $this.data('cytoSlider'); if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the resize method!"); var w = settings.widget.wrapper.element.width(0); setTimeout(function(){ w.width("auto"); },1); }); }, setDimensions:function(n){ return this.each(function(){ var $this = $(this); var settings = $this.data('cytoSlider'); if (!$this.hasClass("cytoSlider") || settings==null) return console.warn("You must instanciate $.cytoSlider before you call the setDimensions method!"); // Reset sliders if (settings.widget.sliders.elements.length) settings.widget.sliders.elements.each(function(){$(this).remove()}); // Create sliders for (var i=0;i