html5-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in html5-rails.gemspec
4
+ gemspec
data/LICENSE.rb ADDED
@@ -0,0 +1,3 @@
1
+ Copyright (c) 2010-2011 Peter Gumeson
2
+
3
+ http://creativecommons.org/licenses/by/3.0/
data/README.md ADDED
@@ -0,0 +1,6 @@
1
+ Html5 Rails
2
+ =========================
3
+
4
+ Rewrite of compass-html5-boilerplate that decouples the compass CSS library and adds Rails asset pipeline integration.
5
+
6
+ (More soon)
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1 @@
1
+ //= require html5/boilerplate
@@ -0,0 +1,3 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+ //= require ./plugins
@@ -0,0 +1,16 @@
1
+
2
+ // usage: log('inside coolFunc', this, arguments);
3
+ // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
4
+ window.log = function(){
5
+ log.history = log.history || []; // store logs to an array for reference
6
+ log.history.push(arguments);
7
+ if(this.console) {
8
+ arguments.callee = arguments.callee.caller;
9
+ console.log( Array.prototype.slice.call(arguments) );
10
+ }
11
+ };
12
+ // make it safe to use console.log always
13
+ (function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
14
+
15
+
16
+ // place any jQuery/helper plugins in here, instead of separate, slower script files.
@@ -0,0 +1,2 @@
1
+ //= require modernizr.min
2
+ //= require respond.min
@@ -0,0 +1 @@
1
+ //= require html5/boilerplate/polyfills
@@ -0,0 +1,64 @@
1
+ module BoilerplateHelpers
2
+
3
+ # Create a named haml tag to wrap IE conditional around a block
4
+ # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
5
+ def ie_tag(name=:body, attrs={}, &block)
6
+ attrs.symbolize_keys!
7
+ haml_concat("<!--[if lt IE 7]> #{ tag(name, add_class('ie6', attrs), true) } <![endif]-->".html_safe)
8
+ haml_concat("<!--[if IE 7]> #{ tag(name, add_class('ie7', attrs), true) } <![endif]-->".html_safe)
9
+ haml_concat("<!--[if IE 8]> #{ tag(name, add_class('ie8', attrs), true) } <![endif]-->".html_safe)
10
+ haml_concat("<!--[if gt IE 8]><!-->".html_safe)
11
+ haml_tag name, attrs do
12
+ haml_concat("<!--<![endif]-->".html_safe)
13
+ block.call
14
+ end
15
+ end
16
+
17
+ def ie_html(attrs={}, &block)
18
+ ie_tag(:html, attrs, &block)
19
+ end
20
+
21
+ def ie_body(attrs={}, &block)
22
+ ie_tag(:body, attrs, &block)
23
+ end
24
+
25
+ def google_account_id
26
+ ENV['GOOGLE_ACCOUNT_ID'] || google_config(:google_account_id)
27
+ end
28
+
29
+ def google_api_key
30
+ ENV['GOOGLE_API_KEY'] || google_config(:google_api_key)
31
+ end
32
+
33
+ def remote_jquery(version)
34
+ if Rails.env == 'development'
35
+ "'jquery', '#{version}', {uncompressed:true}"
36
+ else
37
+ "'jquery', '#{version}'"
38
+ end
39
+ end
40
+
41
+ def local_jquery(version)
42
+ if Rails.env == 'development'
43
+ "#{version}/jquery.js"
44
+ else
45
+ "#{version}/jquery.min.js"
46
+ end
47
+ end
48
+
49
+ private
50
+
51
+ def add_class(name, attrs)
52
+ classes = attrs[:class] || ''
53
+ classes.strip!
54
+ classes = ' ' + classes if !classes.blank?
55
+ classes = name + classes
56
+ attrs.merge(:class => classes)
57
+ end
58
+
59
+ def google_config(key)
60
+ configs = YAML.load_file(File.join(Rails.root, 'config', 'google.yml'))[Rails.env.to_sym] rescue {}
61
+ configs[key]
62
+ end
63
+
64
+ end
@@ -0,0 +1,4 @@
1
+ #flash
2
+ - flash.each do |key, value|
3
+ .message{ :class => key }
4
+ %p= value
@@ -0,0 +1,2 @@
1
+ %small.copyright
2
+ Copyright &copy; #{Date.today.year}
@@ -0,0 +1,24 @@
1
+ %meta{ :charset => "utf-8" }/
2
+
3
+ -# Always force latest IE rendering engine (even in intranet) & Chrome Frame
4
+ -# Remove this if you use the .htaccess
5
+ %meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1" }/
6
+
7
+ %meta{ :name => "description", :content => "" }/
8
+ %meta{ :name => "author", :content => "" }/
9
+
10
+ -# Mobile viewport optimized: j.mp/bplateviewport
11
+ %meta{ :name => "viewport", :content => "width=device-width, initial-scale=1.0" }/
12
+
13
+ %title
14
+ == #{ controller.controller_name.titleize } - #{ controller.action_name.titleize }
15
+
16
+ -# Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons
17
+
18
+ = render "stylesheets"
19
+
20
+ -# All JavaScript at the bottom, except for Modernizr and Respond.
21
+ -# Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
22
+ = javascript_include_tag "polyfills"
23
+
24
+ = csrf_meta_tag
@@ -0,0 +1 @@
1
+ %h1 Header
@@ -0,0 +1,27 @@
1
+ -# Grab Google CDN's jQuery, with a protocol relative URL
2
+ -# Looks for google_api_key first in ENV['GOOGLE_API_KEY'] then in config/google.yml
3
+ -# remote_jquery and local_jquery helpers use minified jquery unless Rails.env is development
4
+ -# - if !google_api_key.blank?
5
+ -# = javascript_include_tag "//www.google.com/jsapi?key=#{google_api_key}"
6
+ -# :javascript
7
+ -# google.load(#{ remote_jquery("1.6") });
8
+ -# - else
9
+ -# = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/#{ local_jquery("1.6") }"
10
+
11
+ -# fall back to local jQuery if necessary
12
+ -# :javascript
13
+ -# window.jQuery || document.write("<script src='/javascripts/jquery.min.js'>\x3C/script>")
14
+
15
+ = javascript_include_tag "application"
16
+
17
+ -# Append your own using content_for :javascripts
18
+ = yield :javascripts
19
+
20
+ -# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
21
+ -# Looks for google_account_id first in ENV['GOOGLE_ACCOUNT_ID'] then in config/google.yml
22
+ - if !google_account_id.blank?
23
+ :javascript
24
+ var _gaq=[["_setAccount","#{google_account_id}"],["_trackPageview"],["_trackPageLoadTime"]];
25
+ (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
26
+ g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
27
+ s.parentNode.insertBefore(g,s)}(document,"script"));
@@ -0,0 +1,5 @@
1
+ -# CSS: implied media="all"
2
+ = stylesheet_link_tag 'application', :media => 'all'
3
+
4
+ -# Append your own using content_for :stylesheets
5
+ = yield :stylesheets
@@ -0,0 +1,20 @@
1
+ !!! 5
2
+ -# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
3
+ -ie_html :class => 'no-js', :lang => 'en' do
4
+ %head
5
+ = render "head"
6
+
7
+ %body{ :class => "#{controller.controller_name}" }
8
+ #container
9
+ %header#header
10
+ = render "header"
11
+
12
+ #main{ :role => 'main' }
13
+ = render "flashes"
14
+ = yield
15
+
16
+ %footer#footer
17
+ = render "footer"
18
+
19
+ -# Javascript at the bottom for fast page loading
20
+ = render "javascripts"
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "html5/rails/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "html5-rails"
7
+ s.version = Html5::Rails::VERSION
8
+ s.authors = ["Peter Gumeson"]
9
+ s.email = ["gumeson@gmail.com"]
10
+ s.homepage = "http://rubygems.org/gems/html5-rails"
11
+ s.summary = %q{Rails support for the new compass-html5 gem.}
12
+ s.description = %q{}
13
+
14
+ s.rubyforge_project = "html5-rails"
15
+
16
+ s.add_dependency "compass-html5", "~> 0.0.1"
17
+ s.add_dependency "railties", "~> 3.1.0.rc4"
18
+ s.add_dependency "thor", "~> 0.14"
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
+ s.require_paths = ["lib"]
24
+ end
@@ -0,0 +1 @@
1
+ require "html5/rails"
@@ -0,0 +1,8 @@
1
+ require "html5/rails/version"
2
+ require "html5/rails/engine"
3
+
4
+ module Html5
5
+ module Rails
6
+ autoload :BoilerplateHelpers, 'html5/rails/boilerplate_helpers'
7
+ end
8
+ end
@@ -0,0 +1,68 @@
1
+ module Html5
2
+ module Rails
3
+ module BoilerplateHelpers
4
+
5
+ # Create a named haml tag to wrap IE conditional around a block
6
+ # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
7
+ def ie_tag(name=:body, attrs={}, &block)
8
+ attrs.symbolize_keys!
9
+ haml_concat("<!--[if lt IE 7]> #{ tag(name, add_class('ie6', attrs), true) } <![endif]-->".html_safe)
10
+ haml_concat("<!--[if IE 7]> #{ tag(name, add_class('ie7', attrs), true) } <![endif]-->".html_safe)
11
+ haml_concat("<!--[if IE 8]> #{ tag(name, add_class('ie8', attrs), true) } <![endif]-->".html_safe)
12
+ haml_concat("<!--[if gt IE 8]><!-->".html_safe)
13
+ haml_tag name, attrs do
14
+ haml_concat("<!--<![endif]-->".html_safe)
15
+ block.call
16
+ end
17
+ end
18
+
19
+ def ie_html(attrs={}, &block)
20
+ ie_tag(:html, attrs, &block)
21
+ end
22
+
23
+ def ie_body(attrs={}, &block)
24
+ ie_tag(:body, attrs, &block)
25
+ end
26
+
27
+ def google_account_id
28
+ ENV['GOOGLE_ACCOUNT_ID'] || google_config(:google_account_id)
29
+ end
30
+
31
+ def google_api_key
32
+ ENV['GOOGLE_API_KEY'] || google_config(:google_api_key)
33
+ end
34
+
35
+ def remote_jquery(version)
36
+ if Rails.env == 'development'
37
+ "'jquery', '#{version}', {uncompressed:true}"
38
+ else
39
+ "'jquery', '#{version}'"
40
+ end
41
+ end
42
+
43
+ def local_jquery(version)
44
+ if Rails.env == 'development'
45
+ "#{version}/jquery.js"
46
+ else
47
+ "#{version}/jquery.min.js"
48
+ end
49
+ end
50
+
51
+ private
52
+
53
+ def add_class(name, attrs)
54
+ classes = attrs[:class] || ''
55
+ classes.strip!
56
+ classes = ' ' + classes if !classes.blank?
57
+ classes = name + classes
58
+ attrs.merge(:class => classes)
59
+ end
60
+
61
+ def google_config(key)
62
+ configs = YAML.load_file(File.join(Rails.root, 'config', 'google.yml'))[Rails.env.to_sym] rescue {}
63
+ configs[key]
64
+ end
65
+
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,24 @@
1
+ module Html5
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+
5
+ # initializer "html5_rails_engine.helper" do |app|
6
+ # ActiveSupport.on_load(:action_controller) do
7
+ # include Html5::Rails::BoilerplateHelpers
8
+ # end
9
+ # end
10
+
11
+ initializer 'html5_rails_engine.helper' do |app|
12
+ #ActionView::Base.send :include, Html5::Rails::BoilerplateHelpers
13
+ ActionController::Base.helper(Html5::Rails::BoilerplateHelpers)
14
+ end
15
+
16
+ # initializer 'html5_rails_engine.controller' do |app|
17
+ # ActiveSupport.on_load(:action_controller) do
18
+ # include Html5RailsEngineActionControllerExtension
19
+ # end
20
+ # end
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ module Html5
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ COMPASS_HTML5_VERSION = "0.0.1"
5
+ JQUERY_VERSION = "1.6.1"
6
+ MODERNIZER_VERSION = "2.0"
7
+ RESPOND_VERSION = "625d77dc1aed97baf0ae"
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ /* Modernizr 2.0 (Custom Build) | MIT & BSD
2
+ * Contains: fontface | backgroundsize | borderimage | borderradius | boxshadow | flexbox | hsla | multiplebgs | opacity | rgba | textshadow | cssanimations | csscolumns | generatedcontent | cssgradients | cssreflections | csstransforms | csstransforms3d | csstransitions | applicationcache | canvas | canvastext | draganddrop | hashchange | history | audio | video | indexeddb | input | inputtypes | localstorage | postmessage | sessionstorage | websockets | websqldatabase | webworkers | geolocation | inlinesvg | smil | svg | svgclippaths | touch | webgl | iepp | mq | cssclasses | teststyles | testprop | testallprops | hasevent | prefixes | domprefixes | load
3
+ */
4
+ ;window.Modernizr=function(a,b,c){function I(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=a[b]in l;return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function G(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return F(d,b)}function F(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b){return!!~(""+a).indexOf(b)}function D(a,b){return typeof a===b}function C(a,b){return B(o.join(a+";")+(b||""))}function B(a){k.cssText=a}var d="2.0",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},w=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;v("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y,z={}.hasOwnProperty,A;!D(z,c)&&!D(z.call,c)?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],c)};var H=function(c,d){var f=c.join(""),g=d.length;v(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f.cssText||f.cssRules[0].cssText,i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||j.touch.offsetTop===9,e.csstransforms3d=j.csstransforms3d.offsetLeft===9,e.generatedcontent=j.generatedcontent.offsetHeight>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("//:")}',["@media (",o.join("touch-enabled),("),i,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",o.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',m,'"}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!D(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b].toLowerCase()+"IndexedDB"])return!0;return!!a.indexedDB},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b]+"WebSocket"])return!0;return"WebSocket"in a},r.rgba=function(){B("background-color:rgba(150,255,150,.5)");return E(k.backgroundColor,"rgba")},r.hsla=function(){B("background-color:hsla(120,40%,100%,.5)");return E(k.backgroundColor,"rgba")||E(k.backgroundColor,"hsla")},r.multiplebgs=function(){B("background:url(//:),url(//:),red url(//:)");return/(url\s*\(.*?){3}/.test(k.background)},r.backgroundsize=function(){return G("backgroundSize")},r.borderimage=function(){return G("borderImage")},r.borderradius=function(){return G("borderRadius")},r.boxshadow=function(){return G("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){C("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return G("animationName")},r.csscolumns=function(){return G("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";B((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return E(k.backgroundImage,"gradient")},r.cssreflections=function(){return G("boxReflect")},r.csstransforms=function(){return!!F(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!F(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a},r.csstransitions=function(){return G("transitionProperty")},r.fontface=function(){return e.fontface},r.generatedcontent=function(){return e.generatedcontent},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}catch(d){}return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webworkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var J in r)A(r,J)&&(y=J.toLowerCase(),e[y]=r[J](),u.push((e[y]?"":"no-")+y));e.input||I(),B(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d,e._prefixes=o,e._domPrefixes=p,e.mq=w,e.hasEvent=x,e.testProp=function(a){return F([a])},e.testAllProps=G,e.testStyles=v,g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+u.join(" "):"");return e}(this,this.document),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css",!a.e&&(w||r)?function a(b){m(function(){if(!d)try{b.sheet.cssRules.length?(d=1,j()):a(b)}catch(c){c.code==1e3||c.message=="security"||c.message=="denied"?(d=1,m(function(){j()},0)):a(b)}},0)}(c):(c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload()),m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return typeof a=="object"},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}function e(a,b,e,g,h){var i=f(a),j=i.autoCallback;if(!i.bypass){b&&(b=D(b)?b:b[a]||b[g]||b[a.split("/").pop().split("?")[0]]);if(i.instead)return i.instead(a,b,e,g,h);e.load(i.url,i.forceCSS||!i.forceJS&&/css$/.test(i.url)?"c":c,i.noexec),(D(b)||D(j))&&e.load(function(){d(),b&&b(i.origUrl,h,g),j&&j(i.origUrl,h,g)})}}function b(a,b){function c(a){if(C(a))e(a,h,b,0,d);else if(B(a))for(i in a)a.hasOwnProperty(i)&&e(a[i],h,b,i,d)}var d=!!a.test,f=d?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}var g,h,i=this.yepnope.loader;if(C(a))e(a,0,i,0);else if(A(a))for(g=0;g<a.length;g++)h=a[g],C(h)?e(h,0,i,0):A(h)?H(h):B(h)&&b(h,i);else B(a)&&b(a,i)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=d()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
@@ -0,0 +1,2 @@
1
+ /*! Respond.js: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
2
+ (function(e,h){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=h;if(h){return}var u=e.document,r=u.documentElement,i=[],k=[],p=[],o={},g=30,f=u.getElementsByTagName("head")[0]||r,b=f.getElementsByTagName("link"),d=[],a=function(){var B=b,w=B.length,z=0,y,x,A,v;for(;z<w;z++){y=B[z],x=y.href,A=y.media,v=y.rel&&y.rel.toLowerCase()==="stylesheet";if(!!x&&v&&!o[x]){if(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(x)||x.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:x,media:A})}else{o[x]=true}}}t()},t=function(){if(d.length){var v=d.shift();n(v.href,function(w){m(w,v.href,v.media);o[v.href]=true;t()})}},m=function(G,v,x){var E=G.match(/@media[^\{]+\{([^\{\}]+\{[^\}\{]+\})+/gi),H=E&&E.length||0,v=v.substring(0,v.lastIndexOf("/")),w=function(I){return I.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+v+"$2$3")},y=!H&&x,B=0,A,C,D,z,F;if(v.length){v+="/"}if(y){H=1}for(;B<H;B++){A=0;if(y){C=x;k.push(w(G))}else{C=E[B].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&w(RegExp.$2))}z=C.split(",");F=z.length;for(;A<F;A++){D=z[A];i.push({media:D.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:k.length-1,minw:D.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:D.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}}j()},l,q,j=function(E){var v="clientWidth",x=r[v],D=u.compatMode==="CSS1Compat"&&x||u.body[v]||x,z={},C=u.createDocumentFragment(),B=b[b.length-1],w=(new Date()).getTime();if(E&&l&&w-l<g){clearTimeout(q);q=setTimeout(j,g);return}else{l=w}for(var y in i){var F=i[y];if(!F.minw&&!F.maxw||(!F.minw||F.minw&&D>=F.minw)&&(!F.maxw||F.maxw&&D<=F.maxw)){if(!z[F.media]){z[F.media]=[]}z[F.media].push(k[F.rules])}}for(var y in p){if(p[y]&&p[y].parentNode===f){f.removeChild(p[y])}}for(var y in z){var G=u.createElement("style"),A=z[y].join("\n");G.type="text/css";G.media=y;if(G.styleSheet){G.styleSheet.cssText=A}else{G.appendChild(u.createTextNode(A))}C.appendChild(G);p.push(G)}f.insertBefore(C,B.nextSibling)},n=function(v,x){var w=c();if(!w){return}w.open("GET",v,true);w.onreadystatechange=function(){if(w.readyState!=4||w.status!=200&&w.status!=304){return}x(w.responseText)};if(w.readyState==4){return}w.send()},c=(function(){var v=false,w=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest()}],y=w.length;while(y--){try{v=w[y]()}catch(x){continue}break}return function(){return v}})();a();respond.update=a;function s(){j(true)}if(e.addEventListener){e.addEventListener("resize",s,false)}else{if(e.attachEvent){e.attachEvent("onresize",s)}}})(this,(function(f){if(f.matchMedia){return true}var e,i=document,c=i.documentElement,g=c.firstElementChild||c.firstChild,h=!i.body,d=i.body||i.createElement("body"),b=i.createElement("div"),a="only all";b.id="mq-test-1";b.style.cssText="position:absolute;top:-99em";d.appendChild(b);b.innerHTML='_<style media="'+a+'"> #mq-test-1 { width: 9px; }</style>';if(h){c.insertBefore(d,g)}b.removeChild(b.firstChild);e=b.offsetWidth==9;if(h){c.removeChild(d)}else{d.removeChild(b)}return e})(this));
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: html5-rails
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Peter Gumeson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-20 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: compass-html5
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.1
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: railties
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 3.1.0.rc4
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: thor
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: "0.14"
47
+ type: :runtime
48
+ version_requirements: *id003
49
+ description: ""
50
+ email:
51
+ - gumeson@gmail.com
52
+ executables: []
53
+
54
+ extensions: []
55
+
56
+ extra_rdoc_files: []
57
+
58
+ files:
59
+ - .gitignore
60
+ - Gemfile
61
+ - LICENSE.rb
62
+ - README.md
63
+ - Rakefile
64
+ - app/assets/javascripts/application.js
65
+ - app/assets/javascripts/html5/boilerplate/index.js
66
+ - app/assets/javascripts/html5/boilerplate/plugins.js
67
+ - app/assets/javascripts/html5/boilerplate/polyfills.js
68
+ - app/assets/javascripts/polyfills.js
69
+ - app/helpers/boilerplate_helpers.rb
70
+ - app/views/application/_flashes.html.haml
71
+ - app/views/application/_footer.html.haml
72
+ - app/views/application/_head.html.haml
73
+ - app/views/application/_header.html.haml
74
+ - app/views/application/_javascripts.html.haml
75
+ - app/views/application/_stylesheets.html.haml
76
+ - app/views/layouts/application.html.haml
77
+ - html5-rails.gemspec
78
+ - lib/html5-rails.rb
79
+ - lib/html5/rails.rb
80
+ - lib/html5/rails/boilerplate_helpers.rb
81
+ - lib/html5/rails/engine.rb
82
+ - lib/html5/rails/version.rb
83
+ - vendor/assets/javascripts/modernizr.min.js
84
+ - vendor/assets/javascripts/respond.min.js
85
+ has_rdoc: true
86
+ homepage: http://rubygems.org/gems/html5-rails
87
+ licenses: []
88
+
89
+ post_install_message:
90
+ rdoc_options: []
91
+
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: "0"
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: "0"
106
+ requirements: []
107
+
108
+ rubyforge_project: html5-rails
109
+ rubygems_version: 1.6.2
110
+ signing_key:
111
+ specification_version: 3
112
+ summary: Rails support for the new compass-html5 gem.
113
+ test_files: []
114
+