From cea9c55632086bed90205ebace9abccf4c7968bc Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Tue, 21 Jan 2014 16:00:54 +0100 Subject: [PATCH] Make HTML5 shiv a local resource Including the HTML5 shiv directly from googlecode.com is considered bad practice: 1) It causes an additional DNS lookup 2) The ressource from SVN is not cacheable and not served compressed. see: http://zoompf.com/blog/2012/05/html5shiv-and-serving-content-from-code-repositories Former-commit-id: 493e41f512cb162600db177b6722bf45bde2a0b1 --- .../BaikalAdmin/Resources/Templates/Page/index.html | 6 +++--- Core/Frameworks/BaikalAdmin/Resources/html5.js | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 Core/Frameworks/BaikalAdmin/Resources/html5.js diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html b/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html index ca941a0..4761777 100755 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html @@ -16,13 +16,13 @@ {{ head }} {{ navbar }} - +
{{ Payload }}
@@ -52,4 +52,4 @@ {{ javascript }} -{% endautoescape %} \ No newline at end of file +{% endautoescape %} diff --git a/Core/Frameworks/BaikalAdmin/Resources/html5.js b/Core/Frameworks/BaikalAdmin/Resources/html5.js new file mode 100644 index 0000000..448cebd --- /dev/null +++ b/Core/Frameworks/BaikalAdmin/Resources/html5.js @@ -0,0 +1,8 @@ +/* + HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); +a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); +if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d