o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1360694815.877747:@value"ò{I"
class:EFI"BundledAsset; FI"logical_path; FI"cytoplasm/cytoMenu.js; FI"
pathname; FI"e/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoMenu.js.erb; FI"content_type; FI"application/javascript; FI"
mtime; FI"2013-02-12T13:46:55-05:00; FI"length; FiI"digest; F"%e815b623220edc4ddd1793632097647dI"source; FI"(function($){
var defaults = {
autoOpen:true,
events:{
onCreate:function(){},
onDestroy:function(){},
onOpen:function(){},
onShut:function(){}
},
options:{}, // Hash of options for the menu. Syntax: {html:click}
positioning:{
to:'bottom left',
offset:{
top:0,
left:0,
bottom:0,
right:0
}
},
transition:{
effect:"blind",
options:{
open:{},
shut:{}
},
speed:250
},
widget:{
list:{
css:{
margin:0,
padding:0,
overflow:'hidden'
},
element:false,
li:{
css:{
'list-style':'none',
'margin':0,
'padding':"5px 10px",
'background':'#555',
'border':'1px solid #444',
'color':'white',
'cursor':'pointer',
'font':'13px TitilliumTextThin'
},
hover:{
background:"hsl(100,100%,75%)",
color:'black'
},
elements:[]
}
},
wrapper:{
css:{
position:'absolute',
'box-shadow':'0px 0px 10px rgba(0,0,0,0.5)'
},
element:false
}
}
};
var methods = {
init:function(options){
return this.each(function(){
// Initialize
var $this = $(this).addClass('CytoMenu-parent');
var settings = $.extend(true,{},defaults,options);
// Generate Widget
settings.widget.wrapper.element = $('
').addClass('CytoMenu-wrapper').css(settings.widget.wrapper.css).appendTo('body').hide();
settings.widget.list.element = $('').addClass('CytoMenu-list').css(settings.widget.list.css).appendTo(settings.widget.wrapper.element);
// Generate Options
$.each(settings.options,function(html,click){
var li = $('').html(html).css(settings.widget.list.li.css).appendTo(settings.widget.wrapper.element).click(click).hover(function(){
$(this).css(settings.widget.list.li.hover);
},function(){
$(this).css(settings.widget.list.li.css);
});
settings.widget.list.li.elements.push(li);
});
// Save settings
$this.data("CytoMenu",settings).data("CytoMenu-state","shut");
// Positioning
methods.reposition.apply($this);
// Finalize
settings.events.onCreate.apply($this);
if (settings.autoOpen) methods.open.apply($this);
});
},
destroy:function(){
return this.each(function(){
var $this = $(this);
var settings = $this.data('CytoMenu');
if (settings==null) return console.warn("You must instantiate $.CytoMenu before calling the destroy method!");
settings.events.onDestroy.apply($this);
})
},
reposition:function(){
return this.each(function(){
var $this = $(this);
var settings = $this.data('CytoMenu');
if (settings==null) return console.warn("You must instantiate $.CytoMenu before calling the reposition method!");
// Position to
var to = settings.positioning.to;
if (to.indexOf("top")>-1) settings.widget.wrapper.element.css("top",$this.offset().top);
else if (to.indexOf("bottom")>-1) settings.widget.wrapper.element.css("top",$this.offset().top+$this.outerHeight());
if (to.indexOf("left")>-1) settings.widget.wrapper.element.css("left",$this.offset().left);
else if (to.indexOf("right")>-1) settings.widget.wrapper.element.css("left",$this.offset().left+$this.outerWidth()-settings.widget.wrapper.element.outerWidth());
// Apply offsets
settings.widget.wrapper.element.css({
top:parseInt(settings.widget.wrapper.element.css("top")) + settings.positioning.offset.top - settings.positioning.offset.bottom,
left:parseInt(settings.widget.wrapper.element.css("left")) + settings.positioning.offset.left - settings.positioning.offset.right
});
});
},
open:function(){
return this.each(function(){
var $this = $(this);
var settings = $this.data('CytoMenu');
if (settings==null) return console.warn("You must instantiate $.CytoMenu before calling the open method!");
settings.widget.wrapper.element.show(settings.transition.effect,settings.transition.options.open,settings.transition.speed,function(){
$this.data("CytoMenu",settings).data("CytoMenu-state","open");
settings.events.onOpen.apply($this);
$(document).bind("click.CytoMenu-open",function(e){
e.preventDefault();
$(document).unbind(e);
methods.shut.apply($this);
});
});
});
},
shut:function(){
return this.each(function(){
var $this = $(this);
var settings = $this.data('CytoMenu');
if (settings==null) return console.warn("You must instantiate $.CytoMenu before calling the shut method!");
settings.widget.wrapper.element.hide(settings.transition.effect,settings.transition.options.shut,settings.transition.speed,function(){
$this.data("CytoMenu",settings).data("CytoMenu-state","shut");
settings.events.onShut.apply($this);
$(document).unbind("click.CytoMenu-open");
});
});
},
toggle:function(){
return this.each(function(){
var $this = $(this);
var settings = $this.data('CytoMenu');
if (settings==null) return console.warn("You must instantiate $.CytoMenu before calling the toggle method!");
methods[(($this.data('CytoMenu-state')=="open")?'shut':'open')].apply($this);
});
}
};
$.fn.CytoMenu = function(method){
if (methods[method]) return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
else if (typeof method == 'object' || !method) return methods[((this.hasClass('CytoMenu-parent'))?'toggle':'init')].apply(this,arguments);
else $.error('Method ' + method + ' does not exist on $.CytoMenu!');
};
$.Cytoplasm("ready",function(){
});
})(jQuery);
; FI"required_assets_digest; F"%3d4e8f9b79374e8b168fc5b8f2654912I"
_version; F"%6776f581a4329e299531e1d52aa59832