From 472744fc875cf4ca5787d36facf97b6c232ad3fe Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 21 Mar 2012 15:51:55 +0800 Subject: [PATCH] Changes for IE9 with html5 --- app/assets/javascripts/html5.js | 3 +++ app/views/layouts/admin.html.erb | 2 +- app/views/layouts/devise.html.erb | 2 +- app/views/layouts/module_widget.html.erb | 2 +- app/views/layouts/new_admin.html.erb | 2 +- app/views/layouts/site_editor.html.erb | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 app/assets/javascripts/html5.js diff --git a/app/assets/javascripts/html5.js b/app/assets/javascripts/html5.js new file mode 100644 index 00000000..5c92911e --- /dev/null +++ b/app/assets/javascripts/html5.js @@ -0,0 +1,3 @@ +/*! HTML5 Shiv pre3.5 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed + Uncompressed source: https://github.com/aFarkas/html5shiv */ +(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){l.shivMethods||c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return b[a]=c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}function p(a){var b,c=a.getElementsByTagName("*"),d=c.length,e=RegExp("^(?:"+i().join("|")+")$","i"),f=[];while(d--)b=c[d],e.test(b.nodeName)&&f.push(b.applyElement(q(b)));return f}function q(a){var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(n+":"+a.nodeName);while(d--)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function r(a){var b,c=a.split("{"),d=c.length,e=RegExp("(^|[\\s,>+~])("+i().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),f="$1"+n+"\\:$2";while(d--)b=c[d]=c[d].split("}"),b[b.length-1]=b[b.length-1].replace(e,f),c[d]=b.join("}");return c.join("{")}function s(a){var b=a.length;while(b--)a[b].removeNode()}function t(a){var b,c,d=a.namespaces,e=a.parentWindow;return!o||a.printShived?a:(typeof d[n]=="undefined"&&d.add(n),e.attachEvent("onbeforeprint",function(){var d,e,f,g=a.styleSheets,i=[],j=g.length,k=Array(j);while(j--)k[j]=g[j];while(f=k.pop())if(!f.disabled&&m.test(f.media)){for(d=f.imports,j=0,e=d.length;j",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b);var m=/^$|\b(?:all|print)\b/,n="html5shiv",o=!g&&function(){var c=b.documentElement;return typeof b.namespaces!="undefined"&&typeof b.parentWindow!="undefined"&&typeof c.applyElement!="undefined"&&typeof c.removeNode!="undefined"&&typeof a.attachEvent!="undefined"}();l.type+=" print",l.shivPrint=t,t(b)})(this,document) \ No newline at end of file diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index d800ab5d..4adce7a5 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -5,7 +5,7 @@ <%= @title || APP_CONFIG['orbit'] %> <%= stylesheet_link_tag "admin" %> <%= javascript_include_tag "admin" %> diff --git a/app/views/layouts/devise.html.erb b/app/views/layouts/devise.html.erb index 976b5422..d1a3512c 100644 --- a/app/views/layouts/devise.html.erb +++ b/app/views/layouts/devise.html.erb @@ -4,7 +4,7 @@ <%= @title || APP_CONFIG['orbit'] %> <%= stylesheet_link_tag "devise" %> <%= javascript_include_tag "devise" %> diff --git a/app/views/layouts/module_widget.html.erb b/app/views/layouts/module_widget.html.erb index 254ac4e9..44a2be85 100644 --- a/app/views/layouts/module_widget.html.erb +++ b/app/views/layouts/module_widget.html.erb @@ -2,7 +2,7 @@ <%#= stylesheet_link_tag "module_widget" %> <%= javascript_include_tag "module_widget" %> diff --git a/app/views/layouts/new_admin.html.erb b/app/views/layouts/new_admin.html.erb index 3ae7a2a2..b6156c5d 100644 --- a/app/views/layouts/new_admin.html.erb +++ b/app/views/layouts/new_admin.html.erb @@ -4,7 +4,7 @@ <%= @title || APP_CONFIG['orbit'] %> <%= stylesheet_link_tag "new_admin" %> <%= javascript_include_tag "new_admin" %> diff --git a/app/views/layouts/site_editor.html.erb b/app/views/layouts/site_editor.html.erb index f4df75c4..efcc54ca 100644 --- a/app/views/layouts/site_editor.html.erb +++ b/app/views/layouts/site_editor.html.erb @@ -5,7 +5,7 @@ <%= @title || APP_CONFIG['orbit'] %> <%= stylesheet_link_tag "site_editor" %> <%= javascript_include_tag "site_editor" %>