diff --git a/js/README.txt b/js/README.txt index 9b72e0a..3d44050 100644 --- a/js/README.txt +++ b/js/README.txt @@ -5,7 +5,7 @@ Versions of Internet Explorer before IE9 don't understand HTML5 or CSS3 media queries, two technologies that modern web design depend on. Fortunately, there are JavaScript shims that can add a degree of compatibility back into IE. -The html5-respond.js script that is included by Zen is a combination of the +The html5.js script that is included by Zen is a combination of the following scripts: - HTML5 shim: IE does not recognize HTML5 elements and will not allow them to be @@ -19,5 +19,7 @@ following scripts: some glue code so that jQuery will utilize it "automatically". http://drupal.org/node/1180142 +The Respond.js script adds support for min/max-width queries. + - Respond.js: IE doesn't understand CSS3 media queries. This script adds support for min/max-width queries. https://github.com/scottjehl/Respond diff --git a/js/html5-respond.js b/js/html5-respond.js deleted file mode 100644 index ea7a5a2..0000000 --- a/js/html5-respond.js +++ /dev/null @@ -1,10 +0,0 @@ -// html5shiv @rem remysharp.com/html5-enabling-script -// iepp v1.6.2 @jon_neal iecss.com/print-protector -// Dual licensed under the MIT or GPL Version 2 licenses -/*@cc_on(function(a,b){function r(a){var b=-1;while(++b";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d"}var c,e=document,j,g="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");return function(d,i){if(!c&&(c=e.createElement("div"),c.innerHTML="",j=c.childNodes.length!==1)){for(var b=e.createDocumentFragment(),f=g.length;f--;)b.createElement(g[f]);b.appendChild(c)}d=d.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace(/)<[^<]*)*<\/script>/gi,"").replace(/(<([\w:]+)[^>]*?)\/>/g,h);c.innerHTML=(b=d.match(/^<(tbody|tr|td|col|colgroup|thead|tfoot)/i))?""+d+"
":d;b=b?c.getElementsByTagName(b[1])[0].parentNode:c;if(i===!1)return b.childNodes;for(var f=e.createDocumentFragment(),k=b.childNodes.length;k--;)f.appendChild(b.firstChild);return f}}(); -// Monkeypatch the innerShiv in the ajax insert method. -(function(){var a=Drupal.ajax.prototype.commands.insert;Drupal.ajax.prototype.commands.insert=function(b,c,d){c.data=innerShiv(c.data,false);a(b,c,d)}})() -/*! Respond.js: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ -(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=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(null)},c=(function(){var v=false;try{v=new XMLHttpRequest()}catch(w){v=new ActiveXObject("Microsoft.XMLHTTP")}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='_';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)); \ No newline at end of file diff --git a/js/html5.js b/js/html5.js index 0e1b36e..bc6808a 100644 --- a/js/html5.js +++ b/js/html5.js @@ -2,7 +2,14 @@ // iepp v1.6.2 @jon_neal iecss.com/print-protector // Dual licensed under the MIT or GPL Version 2 licenses /*@cc_on(function(a,b){function r(a){var b=-1;while(++b";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d"}var c,e=document,j,g="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");return function(d,i){if(!c&&(c=e.createElement("div"),c.innerHTML="",j=c.childNodes.length!==1)){for(var b=e.createDocumentFragment(),f=g.length;f--;)b.createElement(g[f]);b.appendChild(c)}d=d.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace(/)<[^<]*)*<\/script>/gi,"").replace(/(<([\w:]+)[^>]*?)\/>/g,h);c.innerHTML=(b=d.match(/^<(tbody|tr|td|col|colgroup|thead|tfoot)/i))?""+d+"
":d;b=b?c.getElementsByTagName(b[1])[0].parentNode:c;if(i===!1)return b.childNodes;for(var f=e.createDocumentFragment(),k=b.childNodes.length;k--;)f.appendChild(b.firstChild);return f}}(); -// Monkeypatch the innerShiv in the ajax insert method. -(function(){var a=Drupal.ajax.prototype.commands.insert;Drupal.ajax.prototype.commands.insert=function(b,c,d){c.data=innerShiv(c.data,false);a(b,c,d)}})() + +// Monkeypatch the innerShiv in the ajax insert method. This will allow browsers +// who aren't natively capable of rendering unknown elements when they are +// created outside of the active DOM. +(function(){var _insert=Drupal.ajax.prototype.commands.insert;Drupal.ajax.prototype.commands.insert=function(ajax,response,status){response.data=innerShiv(response.data,false);_insert(ajax,response,status);}})(); \ No newline at end of file diff --git a/js/html5.min.js b/js/html5.min.js deleted file mode 100644 index b87a4e5..0000000 --- a/js/html5.min.js +++ /dev/null @@ -1,4 +0,0 @@ -// html5shiv @rem remysharp.com/html5-enabling-script -// iepp v1.6.2 @jon_neal iecss.com/print-protector -// Dual licensed under the MIT or GPL Version 2 licenses -/*@cc_on(function(a,b){function r(a){var b=-1;while(++b";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d"}var c,e=document,j,g="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");return function(d,i){if(!c&&(c=e.createElement("div"),c.innerHTML="",j=c.childNodes.length!==1)){for(var b=e.createDocumentFragment(),f=g.length;f--;)b.createElement(g[f]);b.appendChild(c)}d=d.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace(/)<[^<]*)*<\/script>/gi,"").replace(/(<([\w:]+)[^>]*?)\/>/g,h);c.innerHTML=(b=d.match(/^<(tbody|tr|td|col|colgroup|thead|tfoot)/i))?""+d+"
":d;b=b?c.getElementsByTagName(b[1])[0].parentNode:c;if(i===!1)return b.childNodes;for(var f=e.createDocumentFragment(),k=b.childNodes.length;k--;)f.appendChild(b.firstChild);return f}}(); diff --git a/js/innershiv.src.js b/js/innershiv.src.js deleted file mode 100644 index 89441d7..0000000 --- a/js/innershiv.src.js +++ /dev/null @@ -1,87 +0,0 @@ -/* innerShiv: makes HTML5shim work on innerHTML & jQuery - * http://jdbartlett.github.com/innershiv - * - * This program is free software. It comes without any warranty, to - * the extent permitted by applicable law. You can redistribute it - * and/or modify it under the terms of the Do What The Fuck You Want - * To Public License, Version 2, as published by Sam Hocevar. See - * http://sam.zoy.org/wtfpl/COPYING for more details. - */ -window.innerShiv = (function () { - var div; - var doc = document; - var needsShiv; - - // Array of elements that are new in HTML5 - var html5 = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' '); - - // Used to idiot-proof self-closing tags - function fcloseTag(all, front, tag) { - return (/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i).test(tag) ? all : front + '>'; - } - - return function ( - html, /* string */ - returnFrag /* optional false bool */ - ) { - if (!div) { - div = doc.createElement('div'); - - // needsShiv if can't use HTML5 elements with innerHTML outside the DOM - div.innerHTML = ''; - needsShiv = div.childNodes.length !== 1; - - if (needsShiv) { - // MSIE allows you to create elements in the context of a document - // fragment. Jon Neal first discovered this trick and used it in his - // own shimprove: http://www.iecss.com/shimprove/ - var shimmedFrag = doc.createDocumentFragment(); - var i = html5.length; - while (i--) { - shimmedFrag.createElement(html5[i]); - } - - shimmedFrag.appendChild(div); - } - } - - html = html - // Trim whitespace to avoid unexpected text nodes in return data: - .replace(/^\s\s*/, '').replace(/\s\s*$/, '') - // Strip any scripts: - .replace(/)<[^<]*)*<\/script>/gi, '') - // Fix misuses of self-closing tags: - .replace(/(<([\w:]+)[^>]*?)\/>/g, fcloseTag) - ; - - // Fix for using innerHTML in a table - var tabled; - if (tabled = html.match(/^<(tbody|tr|td|th|col|colgroup|thead|tfoot)[\s\/>]/i)) { - div.innerHTML = '' + html + '
'; - } else { - div.innerHTML = html; - } - - // Avoid returning the tbody or tr when fixing for table use - var scope; - if (tabled) { - scope = div.getElementsByTagName(tabled[1])[0].parentNode; - } else { - scope = div; - } - - // If not in jQuery return mode, return child nodes array - if (returnFrag === false) { - return scope.childNodes; - } - - // ...otherwise, build a fragment to return - var returnedFrag = doc.createDocumentFragment(); - var j = scope.childNodes.length; - while (j--) { - returnedFrag.appendChild(scope.firstChild); - } - - return returnedFrag; - }; -}()); \ No newline at end of file diff --git a/js/jquery-innershiv-monkeypatch.min.js b/js/jquery-innershiv-monkeypatch.min.js deleted file mode 100644 index 6a2ada1..0000000 --- a/js/jquery-innershiv-monkeypatch.min.js +++ /dev/null @@ -1,2 +0,0 @@ -// Monkeypatch the innerShiv in the ajax insert method. -(function(){var a=Drupal.ajax.prototype.commands.insert;Drupal.ajax.prototype.commands.insert=function(b,c,d){c.data=innerShiv(c.data,false);a(b,c,d)}})() diff --git a/js/jquery-innershiv-monkeypatch.src.js b/js/jquery-innershiv-monkeypatch.src.js deleted file mode 100644 index b7e3977..0000000 --- a/js/jquery-innershiv-monkeypatch.src.js +++ /dev/null @@ -1,2 +0,0 @@ -// Monkeypatch the innerShiv in the ajax insert method. -(function(){var _insert=Drupal.ajax.prototype.commands.insert;Drupal.ajax.prototype.commands.insert=function(ajax,response,status){response.data=innerShiv(response.data,false);_insert(ajax,response,status);}})(); diff --git a/templates/html.tpl.php b/templates/html.tpl.php index 8adf6cd..2230ca6 100644 --- a/templates/html.tpl.php +++ b/templates/html.tpl.php @@ -82,9 +82,12 @@ $html_attributes = 'lang="' . $language->language . '" dir="' . $language->dir . + >