o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1360699656.85662: @value"û{I" class:EFI"ProcessedAsset;FI"logical_path;FI"cytoplasm/cytoTable.js;FI" pathname;FI"f/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoTable.js.erb;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-02-12T15:07:35-05:00;FI" length;Fi©I" digest;F"%2c571bd8ccfe1d8ec442a9ad931ba14fI" source;FI"©// CytoTable v0.1 // By MacKinley Smith (function($){ var defaults = { widget:{ table:{ cell:{ padding:0, spacing:0, }, css:{ width:"100%", "margin-bottom":15, "box-shadow":"0px 0px 10px rgba(0,0,0,0.5)" }, element:false, tr:{ css:{}, elements:[], td:{ css:{ padding:10 }, elements:[], types:{ header:{ css:{}, tag:{ css:{ margin:0, padding:0 }, type:"h3" } }, icon:{ css:{ width:16, cursor:'pointer' }, hover:{ backgroundOffset:"-=0.1", css:{} }, img:{ css:{ opacity:0.5 }, hover:{ css:{opacity:0.8} } } }, info:{ css:{} }, label:{ css:{} } } } } } }, events:{ onCreate:function(cy){}, onChange:function(cy,event){}, onDestroy:function(cy){}, onResize:function(cy){} } }; var methods = { init:function(options){ return this.each(function(){ var $this = $(this); if (!$this.is('table')) return console.warn("$.cytoTable expects a table!"); var settings = $.extend(true,{},defaults,options); // Setup table settings.widget.table.element = $(this).addClass('cytoTable') .attr({cellpadding:settings.widget.table.cell.padding,cellspacing:settings.widget.table.cell.spacing}) .css(settings.widget.table.css); // Setup tr var colspan = 0; settings.widget.table.tr.elements = settings.widget.table.element.find("tr").each(function(){ var tds = $(this).css(settings.widget.table.tr.css).find("td"); if (tds.length > colspan) colspan = tds.length; tds.each(function(){settings.widget.table.tr.td.elements.push($(this));}); }); // Setup td $.each(settings.widget.table.tr.td.elements,function(i,td){ td.css(settings.widget.table.tr.td.css); $.each(settings.widget.table.tr.td.types,function(type,opts){if (td.hasClass(type+'cell')) td.attr('data-type',type);}); if (td.data("type")!=null) { var type = td.data('type'); td.css(settings.widget.table.tr.td.types[type].css); switch (type) { case "header": td.attr('colspan',colspan); var tag = settings.widget.table.tr.td.types.header.tag; if (td.data('tag')!=null) tag = td.data('tag'); // Find or create tag if (!td.children(tag).length) { tag = $('<'+tag+'>').html(td.html()) td.html("").append(tag); } else tag = td.children(tag); // Apply styling tag.css({margin:0,padding:0}); break; case "icon": var img = td.children("img").css(settings.widget.table.tr.td.types.icon.img.css); // Calculate darkened background color var oBg, currentParent = td; while (true) { oBg = currentParent.css("background-color"); if (oBg!="transparent") break; currentParent = currentParent.parent(); } oBg = $.Color(oBg); var dBg = oBg.lightness(settings.widget.table.tr.td.types.icon.hover.backgroundOffset); td.hover(function(e){ td.css("background-color",dBg).css(settings.widget.table.tr.td.types.icon.hover.css); img.css(settings.widget.table.tr.td.types.icon.img.hover.css); },function(e){ td.css("background-color",oBg).css(settings.widget.table.tr.td.types.icon.css); img.css(settings.widget.table.tr.td.types.icon.img.css); }); break; case "info": td.attr('colspan',colspan); break; case "label": break; } } }); $this.data('cytoTable',settings); }); }, setIconClick:function(icon,click){ if (typeof icon != "string") return console.warn("$.CytoTable's setIconClick method requires a string to be passed as the first parameter!"); if (typeof click != "function") return console.warn("$.CytoTable's setIconClick method requires a function to be passed as the second parameter!"); return $(this).each(function(){ var $this = $(this); var settings = $this.data('cytoTable',settings); if (settings==null) return console.warn("You must initialize $.CytoTable before you can call the setIconClick method!"); // Attempt to find the iconcell var iconcell = $this.find('td[data-type=icon][title="'+icon+'"]'); if (!iconcell.is("*")) return console.warn("This CytoTable does not have a '"+icon+"' icon."); // Assign the click handler iconcell.unbind("click.cytoTable-iconClick").bind("click.cytoTable-iconClick",click); }); }, setIconClicks:function(icons){ if (typeof icons != "object") return console.warn("$.CytoTable's setIconClicks method requires an object to be passed as the first parameter!"); return this.each(function(){ var $this = $(this); var settings = $this.data('cytoTable',settings); if (settings==null) return console.warn("You must initialize $.CytoTable before you can call the setIconClicks method!"); $.each(icons,function(icon,click){methods.setIconClick.apply($this,[icon,click]);}); }); }, resize:function(width){ if (width==null) width = "100%"; return this.each(function(){ var $this = $(this); var settings = $this.data('cytoTable'); if (!$this.hasClass('cytoTable') || settings==null) return console.warn("You must instanciate $.cytoTable before calling the resize method!"); var w = settings.widget.wrapper.element.css({opacity:0}); setTimeout(function(){ settings.events.beforeResize.apply($this,[settings]); w.width(width).css({opacity:1}); settings.events.onResize.apply($this,[settings]); },1); }); }, destroy:function(){ return this.each(function(){ }); } }; $.fn.cytoTable=function(method){ if (methods[method]) return methods[method].apply(this,Array.prototype.slice.call(arguments,1)); else if (typeof method == 'object' || !method) return methods.init.apply(this,arguments); else $.error('Method ' + method + ' does not exist on $.cytoTable!'); }; $(window).resize(function(){$('.cytoTable').cytoTable('resize');}); $.Cytoplasm("ready",function(){ $.Cytoplasm("addStyles","cytotable_styles",{ 'table.cytoTable':{ background:$.Cytoplasm("vars","colors.plugins.cytoTable.background"), table:{ 'margin-bottom':'0px', "font-family":$.Cytoplasm("vars","fonts.faces.light"), "font-weight":($.Cytoplasm("vars","fonts.faces.light")==$.Cytoplasm("vars","fonts.faces.regular"))?"lighter":"normal" }, td:{ border:$.Cytoplasm("vars","colors.plugins.cytoTable.border"), "&[data-type=label]":{"width":"100px"}, "&[data-type=label],&[data-type=info]":{"font":$.Cytoplasm("vars","fonts.sizes.small")+" "+$.Cytoplasm("vars","fonts.faces.light")} } } }); $('.cytoTable').cytoTable(); }); })(jQuery); ;FI"dependency_digest;F"%88922f7e9ed3286bdbf665c4bfbaa56aI"required_paths;F[I"f/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoTable.js.erb;FI"dependency_paths;F[{I" path;FI"f/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoTable.js.erb;FI" mtime;FI"2013-02-12T15:07:35-05:00;FI" digest;F"%710eb695131904539b18071ec7f774baI" _version;F"%6776f581a4329e299531e1d52aa59832