test/dummy/tmp/cache/assets/D0E/7D0/sprockets%2F89200785fe2710582a6c1b8d04ae7fbe in cytoplasm-0.1.5 vs test/dummy/tmp/cache/assets/D0E/7D0/sprockets%2F89200785fe2710582a6c1b8d04ae7fbe in cytoplasm-0.1.6

- old
+ new

@@ -1,8 +1,8 @@ -o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1357768041.093502: @value"Ô-{I" +o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1358019185.271787: @value"1{I" class:EFI"BundledAsset;FI"logical_path;FI"cytoplasm/cytoplasm.js;FI" pathname;FI"f/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoplasm.js.erb;FI"content_type;FI"application/javascript;FI" -mtime;FI"2013-01-09T16:47:20-05:00;FI" length;Fiç+I" digest;F"%cd9580ac090e2bea673ef7a02d0f5027I" source;FI"ç+// CytoPlasm jQuery Setup v0.1 +mtime;FI"2013-01-12T14:33:05-05:00;FI" length;Fi/I" digest;F"%1a785e1947ef338e0d36fe55f58ac058I" source;FI"/// CytoPlasm jQuery Setup v0.1 // By MacKinley Smith // Initialize global JS variables var Cytoplasm; @@ -15,16 +15,11 @@ var header = $("header").find('h1').click(function(){window.location = "/";}).end(); // Setup callback messages $.each(["success","sending","error"],function(i,v){ var $this = $('#'+v+'_message'); - if (!$this.is('*')) { - $this = $('<p />').addClass('callback_message').attr("id",v+"_message"); - //if (header.children(':first-child').is('h1')) $this.insertAfter(header.children(':first-child')); - //else $this.prependTo(header); - $this.hide().appendTo(header); - } + if (!$this.is('*')) $this = $('<p />').addClass('callback_message').attr("id",v+"_message").hide().appendTo(header); }); }); })(jQuery); // Cytoplasm plugin @@ -33,11 +28,18 @@ var defaults = { }; var conf = {}; var vars = {}; - var ready = false; + var ready = false, readyFunctions = [ + function(){ + var allexceptheader = $('body').children(':not(header)').animate({opacity:1},250,function(){ + $('body').css('overflow-y','scroll'); + $(window).bind('beforeunload',function(){allexceptheader.animate({opacity:0},100);}); + }); + } + ]; // Gradient manipulation library var parseGradient = function(grad,reverse){ // Return untouched if not gradient if (grad.indexOf("gradient")==-1) return grad; @@ -136,16 +138,23 @@ init:function(options){ var settings = $.extend(true,{},defaults,options); $('body').css("overflow","hidden").children(':not(header)').css("opacity",0); // Fetch latest settings via AJAX - $.cytoAjax("/cytoplasm/settings/fetch",{},function(data){ - conf = data.conf; - vars = data.vars; - $('body').data('cytoplasm',settings); - methods.setStyles.apply(this); - ready = true; + $.ajax("/cytoplasm/settings/fetch",{ + type:"POST", + success:function(data){ + data = $.parseJSON(data); + conf = data.conf; + vars = data.vars; + $(document).ready(function(){ + $('body').data('cytoplasm',settings); + methods.setStyles.apply(); + ready = true; + $.each(readyFunctions,function(i,f){f.apply();}); + }); + } }); }, setStyles:function(){ // Remove existing cytoplasm styles if ($('#cytoplasm_dynamic_styles').is("*")) $('#cytoplasm_dynamic_styles').remove(); @@ -156,11 +165,12 @@ var styletag = ""; var styles = { body:{ background:vars.colors.global.background, font:vars.fonts.sizes.normal+" "+vars.fonts.faces.regular, - color:vars.colors.global.text + color:vars.colors.global.text, + padding:vars.layout.padding }, '::selection':{ background:vars.colors.global.accent, color:"contrast("+vars.colors.global.accent+",black,white)" }, @@ -179,10 +189,12 @@ 'h2,h4,h6,table.cytoTable,.cytoButton':{ "font-family":vars.fonts.faces.light, "font-weight":lightweight }, header:{ + margin:vars.layout.header.margin, + padding:vars.layout.header.padding, '#logo':{ position:vars.layout.header.logo.position, top:vars.layout.header.logo.y+10 }, h1:{ @@ -190,10 +202,18 @@ "&:hover":{ color:vars.colors.global.accent } } }, + '#main_content':{ + margin:vars.layout.content.margin, + padding:vars.layout.content.padding + }, + 'footer':{ + margin:vars.layout.footer.margin, + padding:vars.layout.footer.padding + }, 'table.cytoTable':{ background:vars.colors.plugins.cytoTable.background, td:{ border:vars.colors.plugins.cytoTable.border, "&.labelcell":{"font-size":vars.fonts.sizes.small} @@ -286,29 +306,36 @@ }, destroy:function(){ $('body').data('cytoplasm',null); }, - ready:function(callback){ + ready:function(func){ + if (typeof func != "function") return console.warn("$.Cytoplasm's ready method requires a function to be passed as its first and only argument."); + if (ready==true) return func.apply(); + else readyFunctions.push(func); + + /* + var interval = setInterval(function(){ - if (ready) { + if (ready==true) { clearInterval(interval); var allexceptheader = $('body').children(':not(header)').animate({opacity:1},250,function(){ $('body').css('overflow-y','scroll'); $(window).bind('beforeunload',function(){allexceptheader.animate({opacity:0},100);}); - callback.apply(); + func.apply(); }); } },10); + */ } }; $.Cytoplasm = 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 jQuery.Cytoplasm!'); }; - $(document).ready(function(){$.Cytoplasm()}); + $.Cytoplasm(); })(jQuery); -;FI"required_assets_digest;F"%5663d59a4529c7d316af0624a1f731c8I" _version;F"%6776f581a4329e299531e1d52aa59832 +;FI"required_assets_digest;F"%9c5e437132a6da6b022681128c8df6f6I" _version;F"%6776f581a4329e299531e1d52aa59832 \ No newline at end of file