coffee-shop
Version:
Coffee Web Framework.
8 lines (7 loc) • 2.42 kB
JavaScript
var templates=function anonymous(n,g) {
var o="";var c={},p="partial",l="layout",content_for=function(s,f){c[s]=f},yields=function(s){var b=c[s];b&&((c[s]="")||b())},z=function(g){var y=o,n;if(g&&g.l&&(n=g.l.pop())){c["content"]=function(){o+=y};o="";g[p](n,g);}},__if=function(v,f){v&&v.length!==0&&f()},each=function(o,f){for (var k in o)o.hasOwnProperty(k)&&f.apply(o[k],[k,o[k]])};g=g||{};g.l=[g[l]];g[l]=function(n){g.l.push(n)};g[p]=function(n,e){e=e||{};for(var k in g){e[k]=e[k]||g[k]};var q=g.l;g.l=[];with(e){var w=function(f,a){o="";f.apply({},a);return o},t={
"shared/layouts/application":function(){return w(content_for,["head",function(){o+="\n <link media=\"all\" rel=\"stylesheet\" href=\""+w(cdn_url,["/assets/application.css",function(s){o+=s}])+"\"/>\n"}])+"\n<section id=\"flashes\">\n "+w(__if,[flash.alert,function(){o+="\n <div class=\"flash flash-alert\">"+flash.alert+"</div>\n "}])+"\n "+w(__if,[flash.notice,function(){o+="\n <div class=\"flash flash-notice\">"+flash.notice+"</div>\n "}])+"\n</section>\n<section id=\"content\">\n "+w(yields,["content"])+"\n</section>\n"+w(content_for,["foot",function(){o+="\n <script src=\""+w(cdn_url,["/assets/templates.js",function(s){o+=s}])+"\"><"+"/script>\n <script src=\""+w(cdn_url,["/assets/application.js",function(s){o+=s}])+"\"></script>\n"}])+"\n"+w(layout,["shared/layouts/html5"])},
"shared/layouts/html5":function(){return "<!doctype html>\n<!--[if IE7]>\n <html class=\"no-js ie7\" lang=\"en\"></html>\n<![endif]-->\n<!--[if IE8]>\n <html class=\"no-js ie8\" lang=\"en\"></html>\n<![endif]-->\n<!--[if IE9]>\n <html class=\"no-js ie9\" lang=\"en\"></html>\n<![endif]-->\n<!--[if gt IE9]>\n <html class=\"no-js\" lang=\"en\">\n<![endif]-->\n <head>\n <title>"+settings.title+"</title>\n <meta charset=\"utf-8\"/>\n <link rel=\"icon\" type=\"image/png\" href=\""+w(cdn_url,["/favicon.png",function(s){o+=s}])+"\"/>\n <!--[if lt IE9]>\n <script src=\""+w(cdn_url,["/vendor/html5shiv.js",function(s){o+=s}])+"\"><"+"/script>\n <![endif]-->\n "+w(yields,["head"])+"\n "+w(yields,["head2"])+"\n </head>\n <body class=\""+body_class+"\">\n "+w(yields,["content"])+"\n "+w(yields,["foot"])+"\n </body>\n</html>\n"},
"shared/pages/home":function(){return "<h1>Now you're baking with CoffeeShop.</h1>\n<img src=\"/images/coffee-shop.png\"/>\n"},
}};o+=t[n]();z(g);g.l=q};g[p](n,g);z(g);return o
}