summaryrefslogtreecommitdiff
path: root/bower_components/respond
diff options
context:
space:
mode:
authorThomas Park <thomas@thomaspark.me>2013-12-24 17:03:28 -0500
committerThomas Park <thomas@thomaspark.me>2013-12-24 17:03:28 -0500
commit9bf0a9d13e1d0938e47847db0487f0f0fce0d8b3 (patch)
tree6fdb29e14a983125ba18652546068a087244510f /bower_components/respond
parent046a20a5adabc15b6f910c2f3f66bb48a83067b7 (diff)
fixes #185, installs html5shiv/respond and downgrades jquery for ie8
Diffstat (limited to 'bower_components/respond')
-rw-r--r--bower_components/respond/.bower.json21
-rw-r--r--bower_components/respond/Gruntfile.js90
-rw-r--r--bower_components/respond/LICENSE-MIT22
-rw-r--r--bower_components/respond/README.md114
-rw-r--r--bower_components/respond/bower.json10
-rw-r--r--bower_components/respond/cross-domain/example.html24
-rw-r--r--bower_components/respond/cross-domain/respond-proxy.html96
-rw-r--r--bower_components/respond/cross-domain/respond.proxy.gifbin0 -> 35 bytes
-rw-r--r--bower_components/respond/cross-domain/respond.proxy.js127
-rw-r--r--bower_components/respond/dest/respond.matchmedia.addListener.min.js5
-rw-r--r--bower_components/respond/dest/respond.matchmedia.addListener.src.js273
-rw-r--r--bower_components/respond/dest/respond.min.js5
-rw-r--r--bower_components/respond/dest/respond.src.js224
-rw-r--r--bower_components/respond/package.json32
-rw-r--r--bower_components/respond/src/matchmedia.addListener.js76
-rw-r--r--bower_components/respond/src/matchmedia.polyfill.js36
-rw-r--r--bower_components/respond/src/respond.js341
17 files changed, 1496 insertions, 0 deletions
diff --git a/bower_components/respond/.bower.json b/bower_components/respond/.bower.json
new file mode 100644
index 00000000..1286c6c8
--- /dev/null
+++ b/bower_components/respond/.bower.json
@@ -0,0 +1,21 @@
+{
+ "name": "respond",
+ "version": "1.4.2",
+ "main": "dest/respond.src.js",
+ "description": "Fast and lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)",
+ "ignore": [
+ "**/.*",
+ "test"
+ ],
+ "homepage": "https://github.com/scottjehl/Respond",
+ "_release": "1.4.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v1.4.2",
+ "commit": "20b7f4a192bb910c8c7e067b961de38519d334e4"
+ },
+ "_source": "git://github.com/scottjehl/Respond.git",
+ "_target": "~1.4.2",
+ "_originalSource": "respond",
+ "_direct": true
+} \ No newline at end of file
diff --git a/bower_components/respond/Gruntfile.js b/bower_components/respond/Gruntfile.js
new file mode 100644
index 00000000..70d4f187
--- /dev/null
+++ b/bower_components/respond/Gruntfile.js
@@ -0,0 +1,90 @@
+module.exports = function(grunt) {
+ "use strict";
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ banner:
+ '/*! Respond.js v<%= pkg.version %>: <%= pkg.description %>' +
+ ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
+ ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
+ ' * <%= pkg.website %>' +
+ ' */\n\n',
+ uglify: {
+ nonMinMatchMedia: {
+ options: {
+ mangle: false,
+ compress: false,
+ preserveComments: 'some',
+ beautify: {
+ beautify: true,
+ indent_level: 2
+ }
+ },
+ files: {
+ 'dest/respond.src.js': ['src/matchmedia.polyfill.js', 'src/respond.js']
+ }
+ },
+ minMatchMedia: {
+ options: {
+ banner: '<%= banner %>'
+ },
+ files: {
+ 'dest/respond.min.js': ['src/matchmedia.polyfill.js', 'src/respond.js']
+ }
+ },
+ nonMinMatchMediaListener: {
+ options: {
+ mangle: false,
+ compress: false,
+ preserveComments: 'some',
+ beautify: {
+ beautify: true,
+ indent_level: 2
+ }
+ },
+ files: {
+ 'dest/respond.matchmedia.addListener.src.js': ['src/matchmedia.polyfill.js', 'src/matchmedia.addListener.js', 'src/respond.js']
+ }
+ },
+ minMatchMediaListener: {
+ options: {
+ banner: '<%= banner %>'
+ },
+ files: {
+ 'dest/respond.matchmedia.addListener.min.js': ['src/matchmedia.polyfill.js', 'src/matchmedia.addListener.js', 'src/respond.js']
+ }
+ }
+ },
+ jshint: {
+ files: ['src/respond.js', 'src/matchmedia.polyfill.js'],
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: false,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ boss: true,
+ eqnull: true,
+ smarttabs: true,
+ node: true,
+ es5: true,
+ strict: false
+ },
+ globals: {
+ Image: true,
+ window: true
+ }
+ }
+ });
+
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-contrib-uglify' );
+
+ // Default task.
+ grunt.registerTask('default', ['jshint', 'uglify']);
+
+};
diff --git a/bower_components/respond/LICENSE-MIT b/bower_components/respond/LICENSE-MIT
new file mode 100644
index 00000000..c7cf40db
--- /dev/null
+++ b/bower_components/respond/LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Scott Jehl
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/bower_components/respond/README.md b/bower_components/respond/README.md
new file mode 100644
index 00000000..2cdc7c29
--- /dev/null
+++ b/bower_components/respond/README.md
@@ -0,0 +1,114 @@
+# Respond.js
+### A fast & lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)
+
+ - Copyright 2011: Scott Jehl, scottjehl.com
+
+ - Licensed under the MIT license.
+
+The goal of this script is to provide a fast and lightweight (3kb minified / 1kb gzipped) script to enable [responsive web designs](http://www.alistapart.com/articles/responsive-web-design/) in browsers that don't support CSS3 Media Queries - in particular, Internet Explorer 8 and under. It's written in such a way that it will probably patch support for other non-supporting browsers as well (more information on that soon).
+
+If you're unfamiliar with the concepts surrounding Responsive Web Design, you can read up [here](http://www.alistapart.com/articles/responsive-web-design/) and also [here](http://filamentgroup.com/examples/responsive-images/)
+
+[Demo page](https://rawgithub.com/scottjehl/Respond/master/test/test.html) (the colors change to show media queries working)
+
+
+Usage Instructions
+======
+
+1. Craft your CSS with min/max-width media queries to adapt your layout from mobile (first) all the way up to desktop
+
+
+<pre>
+ @media screen and (min-width: 480px){
+ ...styles for 480px and up go here
+ }
+</pre>
+
+2. Reference the respond.min.js script (1kb min/gzipped) after all of your CSS (the earlier it runs, the greater chance IE users will not see a flash of un-media'd content)
+
+3. Crack open Internet Explorer and pump fists in delight
+
+
+CDN/X-Domain Setup
+======
+
+Respond.js works by requesting a pristine copy of your CSS via AJAX, so if you host your stylesheets on a CDN (or a subdomain), you'll need to upload a proxy page to enable cross-domain communication.
+
+See `cross-domain/example.html` for a demo:
+
+- Upload `cross-domain/respond-proxy.html` to your external domain
+- Upload `cross-domain/respond.proxy.gif` to your origin domain
+- Reference the file(s) via `<link />` element(s):
+
+<pre>
+ &lt;!-- Respond.js proxy on external server --&gt;
+ &lt;link href=&quot;http://externalcdn.com/respond-proxy.html&quot; id=&quot;respond-proxy&quot; rel=&quot;respond-proxy&quot; /&gt;
+
+ &lt;!-- Respond.js redirect location on local server --&gt;
+ &lt;link href=&quot;/path/to/respond.proxy.gif&quot; id=&quot;respond-redirect&quot; rel=&quot;respond-redirect&quot; /&gt;
+
+ &lt;!-- Respond.js proxy script on local server --&gt;
+ &lt;script src="/path/to/respond.proxy.js"&gt;&lt;/script&gt;
+</pre>
+
+If you are having problems with the cross-domain setup, make sure respond-proxy.html does not have a query string appended to it.
+
+Note: HUGE thanks to @doctyper for the contributions in the cross-domain proxy!
+
+
+Support & Caveats
+======
+
+Some notes to keep in mind:
+
+- This script's focus is purposely very narrow: only min-width and max-width media queries and all media types (screen, print, etc) are translated to non-supporting browsers. I wanted to keep things simple for filesize, maintenance, and performance, so I've intentionally limited support to queries that are essential to building a (mobile-first) responsive design. In the future, I may rework things a bit to include a hook for patching-in additional media query features - stay tuned!
+
+- Browsers that natively support CSS3 Media Queries are opted-out of running this script as quickly as possible. In testing for support, all other browsers are subjected to a quick test to determine whether they support media queries or not before proceeding to run the script. This test is now included separately at the top, and uses the window.matchMedia polyfill found here: https://github.com/paulirish/matchMedia.js . If you are already including this polyfill via Modernizr or otherwise, feel free to remove that part.
+
+- This script relies on no other scripts or frameworks (aside from the included matchMedia polyfill), and is optimized for mobile delivery (~1kb total filesize min/gzip)
+
+- As you might guess, this implementation is quite dumb in regards to CSS parsing rules. This is a good thing, because that allows it to run really fast, but its looseness may also cause unexpected behavior. For example: if you enclose a whole media query in a comment intending to disable its rules, you'll probably find that those rules will end up enabled in non-media-query-supporting browsers.
+
+- Respond.js doesn't parse CSS referenced via @import, nor does it work with media queries within style elements, as those styles can't be re-requested for parsing.
+
+- Due to security restrictions, some browsers may not allow this script to work on file:// urls (because it uses xmlHttpRequest). Run it on a web server.
+
+- If the request for the CSS file that includes MQ-specific styling is
+ behind a redirect, Respond.js will fail silently. CSS files should
+respond with a 200 status.
+
+- Currently, media attributes on link elements are supported, but only if the linked stylesheet contains no media queries. If it does contain queries, the media attribute will be ignored and the internal queries will be parsed normally. In other words, @media statements in the CSS take priority.
+
+- Reportedly, if CSS files are encoded in UTF-8 with Byte-Order-Mark (BOM), they will not work with Respond.js in IE7 or IE8. Noted in issue #97
+
+- WARNING: Including @font-face rules inside a media query will cause IE7 and IE8 to hang during load. To work around this, place @font-face rules in the wide open, as a sibling to other media queries.
+
+- If you have more than 32 stylesheets referenced, IE will throw an error, `Invalid procedure call or argument`. Concatenate your CSS and the issue should go away.
+
+- Sass/SCSS source maps are not supported; `@media -sass-debug-info` will break respond.js. Noted in issue [#148](https://github.com/scottjehl/Respond/issues/148)
+
+- Internet Explorer 9 supports css3 media queries, but not within frames when the CSS containing the media query is in an external file (this appears to be a bug in IE9 — see http://stackoverflow.com/questions/10316247/media-queries-fail-inside-ie9-iframe). See this commit for a fix if you're having this problem. https://github.com/NewSignature/Respond/commit/1c86c66075f0a2099451eb426702fc3540d2e603
+
+- Nested Media Queries are not supported
+
+
+How's it work?
+======
+Basically, the script loops through the CSS referenced in the page and runs a regular expression or two on their contents to find media queries and their associated blocks of CSS. In Internet Explorer, the content of the stylesheet is impossible to retrieve in its pre-parsed state (which in IE 8-, means its media queries are removed from the text), so Respond.js re-requests the CSS files using Ajax and parses the text response from there. Be sure to configure your CSS files' caching properly so that this re-request doesn't actually go to the server, hitting your browser cache instead.
+
+From there, each media query block is appended to the head in order via style elements, and those style elements are enabled and disabled (read: appended and removed from the DOM) depending on how their min/max width compares with the browser width. The media attribute on the style elements will match that of the query in the CSS, so it could be "screen", "projector", or whatever you want. Any relative paths contained in the CSS will be prefixed by their stylesheet's href, so image paths will direct to their proper destination
+
+API Options?
+======
+Sure, a couple:
+
+- respond.update() : rerun the parser (helpful if you added a stylesheet to the page and it needs to be translated)
+- respond.mediaQueriesSupported: set to true if the browser natively supports media queries.
+- respond.getEmValue() : returns the pixel value of one em
+
+
+Alternatives to this script
+======
+This isn't the only CSS3 Media Query polyfill script out there; but it damn well may be the fastest.
+
+If you're looking for more robust CSS3 Media Query support, you might check out http://code.google.com/p/css3-mediaqueries-js/. In testing, I've found that script to be noticeably slow when rendering complex responsive designs (both in filesize and performance), but it really does support a lot more media query features than this script. Big hat tip to the authors! :)
diff --git a/bower_components/respond/bower.json b/bower_components/respond/bower.json
new file mode 100644
index 00000000..b98e9646
--- /dev/null
+++ b/bower_components/respond/bower.json
@@ -0,0 +1,10 @@
+{
+ "name": "respond",
+ "version": "1.4.2",
+ "main": "dest/respond.src.js",
+ "description": "Fast and lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)",
+ "ignore": [
+ "**/.*",
+ "test"
+ ]
+}
diff --git a/bower_components/respond/cross-domain/example.html b/bower_components/respond/cross-domain/example.html
new file mode 100644
index 00000000..700224e7
--- /dev/null
+++ b/bower_components/respond/cross-domain/example.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8" />
+ <title>Respond JS Test Page</title>
+ <link href="https://rawgithub.com/scottjehl/Respond/master/test/test.css" rel="stylesheet"/>
+ <link href="https://rawgithub.com/scottjehl/Respond/master/test/test2.css" media="screen and (min-width: 600px)" rel="stylesheet"/>
+ <script src="../dest/respond.src.js"></script>
+
+ <!-- Respond.js proxy on external server -->
+ <link href="https://rawgithub.com/scottjehl/Respond/master/cross-domain/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
+ <link href="respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
+ <script src="respond.proxy.js"></script>
+</head>
+<body>
+ <p>This is a visual test file for cross-domain proxy.</p>
+
+ <p>The media queries in the included CSS file simply change the body's background color depending on the browser width. If you see any colors aside from black, then the media queries are working in your browser. You can resize your browser window to see it change on the fly.</p>
+
+
+ <p id="attribute-test">Media-attributes are working too! This should be visible above 600px.</p>
+
+</body>
+</html>
diff --git a/bower_components/respond/cross-domain/respond-proxy.html b/bower_components/respond/cross-domain/respond-proxy.html
new file mode 100644
index 00000000..f828a0a5
--- /dev/null
+++ b/bower_components/respond/cross-domain/respond-proxy.html
@@ -0,0 +1,96 @@
+<!-- Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs -->
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8" />
+ <title>Respond JS Proxy</title>
+</head>
+<body>
+ <script>
+ (function () {
+ var domain, css, query, getQueryString, ajax, xmlHttp;
+
+ /*
+ http://stackoverflow.com/questions/4963673/get-url-array-variables-in-javascript-jquery/4963817#4963817
+ */
+ getQueryString = function() {
+ var ret = {}, parts, i, p;
+
+ parts = (document.location.toString().split("?")[1]).split("&");
+
+ for (i = 0; i < parts.length; i++) {
+
+ p = parts[i].split("=");
+ // so strings will be correctly parsed:
+ p[1] = decodeURIComponent(p[1].replace(/\+/g, " "));
+
+ if (p[0].search(/\[\]/) >= 0) { // then it"s an array
+ p[0] = p[0].replace("[]", "");
+
+ if (typeof ret[p[0]] != "object") {
+ ret[p[0]] = [];
+ }
+ ret[p[0]].push(p[1]);
+ } else {
+ ret[p[0]] = p[1];
+ }
+ }
+ return ret;
+ };
+
+ ajax = function( url, callback ) {
+ var req = xmlHttp();
+ if (!req){
+ return;
+ }
+ req.open( "GET", url, true );
+ req.onreadystatechange = function () {
+ if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
+ return;
+ }
+ callback( req.responseText );
+ };
+ if ( req.readyState == 4 ){
+ return;
+ }
+ req.send();
+ };
+
+ //define ajax obj
+ xmlHttp = (function() {
+ var xmlhttpmethod = false,
+ attempts = [
+ function(){ return new XMLHttpRequest(); },
+ function(){ return new ActiveXObject("Microsoft.XMLHTTP"); },
+ function(){ return new ActiveXObject("MSXML2.XMLHTTP.3.0"); }
+ ],
+ al = attempts.length;
+
+ while( al-- ){
+ try {
+ xmlhttpmethod = attempts[ al ]();
+ }
+ catch(e) {
+ continue;
+ }
+ break;
+ }
+ return function(){
+ return xmlhttpmethod;
+ };
+ })();
+
+ query = getQueryString();
+ css = query["css"];
+ domain = query["url"];
+
+ if (css && domain) {
+ ajax(css, function (response) {
+ window.name = response;
+ window.location.href = domain;
+ });
+ }
+ }());
+ </script>
+</body>
+</html> \ No newline at end of file
diff --git a/bower_components/respond/cross-domain/respond.proxy.gif b/bower_components/respond/cross-domain/respond.proxy.gif
new file mode 100644
index 00000000..ced1c053
--- /dev/null
+++ b/bower_components/respond/cross-domain/respond.proxy.gif
Binary files differ
diff --git a/bower_components/respond/cross-domain/respond.proxy.js b/bower_components/respond/cross-domain/respond.proxy.js
new file mode 100644
index 00000000..e9422cb7
--- /dev/null
+++ b/bower_components/respond/cross-domain/respond.proxy.js
@@ -0,0 +1,127 @@
+/*! Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
+(function(win, doc, undefined){
+ var docElem = doc.documentElement,
+ proxyURL = doc.getElementById("respond-proxy").href,
+ redirectURL = (doc.getElementById("respond-redirect") || location).href,
+ baseElem = doc.getElementsByTagName("base")[0],
+ urls = [],
+ refNode;
+
+ function encode(url){
+ return win.encodeURIComponent(url);
+ }
+
+ function fakejax( url, callback ){
+
+ var iframe,
+ AXO;
+
+ // All hail Google http://j.mp/iKMI19
+ // Behold, an iframe proxy without annoying clicky noises.
+ if ( "ActiveXObject" in win ) {
+ AXO = new ActiveXObject( "htmlfile" );
+ AXO.open();
+ AXO.write( '<iframe id="x"></iframe>' );
+ AXO.close();
+ iframe = AXO.getElementById( "x" );
+ } else {
+ iframe = doc.createElement( "iframe" );
+ iframe.style.cssText = "position:absolute;top:-99em";
+ docElem.insertBefore(iframe, docElem.firstElementChild || docElem.firstChild );
+ }
+
+ iframe.src = checkBaseURL(proxyURL) + "?url=" + encode(redirectURL) + "&css=" + encode(checkBaseURL(url));
+
+ function checkFrameName() {
+ var cssText;
+
+ try {
+ cssText = iframe.contentWindow.name;
+ }
+ catch (e) { }
+
+ if (cssText) {
+ // We've got what we need. Stop the iframe from loading further content.
+ iframe.src = "about:blank";
+ iframe.parentNode.removeChild(iframe);
+ iframe = null;
+
+
+ // Per http://j.mp/kn9EPh, not taking any chances. Flushing the ActiveXObject
+ if (AXO) {
+ AXO = null;
+
+ if (win.CollectGarbage) {
+ win.CollectGarbage();
+ }
+ }
+
+ callback(cssText);
+ }
+ else{
+ win.setTimeout(checkFrameName, 100);
+ }
+ }
+
+ win.setTimeout(checkFrameName, 500);
+ }
+
+ function checkBaseURL(href) {
+ if (baseElem && href.indexOf(baseElem.href) === -1) {
+ bref = (/\/$/).test(baseElem.href) ? baseElem.href : (baseElem.href + "/");
+ href = bref + href;
+ }
+
+ return href;
+ }
+
+ function checkRedirectURL() {
+ // IE6 & IE7 don't build out absolute urls in <link /> attributes.
+ // So respond.proxy.gif remains relative instead of http://example.com/respond.proxy.gif.
+ // This trickery resolves that issue.
+ if (~ !redirectURL.indexOf(location.host)) {
+
+ var fakeLink = doc.createElement("div");
+
+ fakeLink.innerHTML = '<a href="' + redirectURL + '"></a>';
+ docElem.insertBefore(fakeLink, docElem.firstElementChild || docElem.firstChild );
+
+ // Grab the parsed URL from that dummy object
+ redirectURL = fakeLink.firstChild.href;
+
+ // Clean up
+ fakeLink.parentNode.removeChild(fakeLink);
+ fakeLink = null;
+ }
+ }
+
+ function buildUrls(){
+ var links = doc.getElementsByTagName( "link" );
+
+ for( var i = 0, linkl = links.length; i < linkl; i++ ){
+
+ var thislink = links[i],
+ href = links[i].href,
+ extreg = (/^([a-zA-Z:]*\/\/(www\.)?)/).test( href ),
+ ext = (baseElem && !extreg) || extreg;
+
+ //make sure it's an external stylesheet
+ if( thislink.rel.indexOf( "stylesheet" ) >= 0 && ext ){
+ (function( link ){
+ fakejax( href, function( css ){
+ link.styleSheet.rawCssText = css;
+ respond.update();
+ } );
+ })( thislink );
+ }
+ }
+
+
+ }
+
+ if( !respond.mediaQueriesSupported ){
+ checkRedirectURL();
+ buildUrls();
+ }
+
+})( window, document );
diff --git a/bower_components/respond/dest/respond.matchmedia.addListener.min.js b/bower_components/respond/dest/respond.matchmedia.addListener.min.js
new file mode 100644
index 00000000..50ac74c9
--- /dev/null
+++ b/bower_components/respond/dest/respond.matchmedia.addListener.min.js
@@ -0,0 +1,5 @@
+/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
+ * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
+ * */
+
+!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this); \ No newline at end of file
diff --git a/bower_components/respond/dest/respond.matchmedia.addListener.src.js b/bower_components/respond/dest/respond.matchmedia.addListener.src.js
new file mode 100644
index 00000000..31571cda
--- /dev/null
+++ b/bower_components/respond/dest/respond.matchmedia.addListener.src.js
@@ -0,0 +1,273 @@
+/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
+/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
+(function(w) {
+ "use strict";
+ w.matchMedia = w.matchMedia || function(doc, undefined) {
+ var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div");
+ div.id = "mq-test-1";
+ div.style.cssText = "position:absolute;top:-100em";
+ fakeBody.style.background = "none";
+ fakeBody.appendChild(div);
+ return function(q) {
+ div.innerHTML = '&shy;<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>';
+ docElem.insertBefore(fakeBody, refNode);
+ bool = div.offsetWidth === 42;
+ docElem.removeChild(fakeBody);
+ return {
+ matches: bool,
+ media: q
+ };
+ };
+ }(w.document);
+})(this);
+
+/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */
+(function(w) {
+ "use strict";
+ if (w.matchMedia && w.matchMedia("all").addListener) {
+ return false;
+ }
+ var localMatchMedia = w.matchMedia, hasMediaQueries = localMatchMedia("only all").matches, isListening = false, timeoutID = 0, queries = [], handleChange = function(evt) {
+ w.clearTimeout(timeoutID);
+ timeoutID = w.setTimeout(function() {
+ for (var i = 0, il = queries.length; i < il; i++) {
+ var mql = queries[i].mql, listeners = queries[i].listeners || [], matches = localMatchMedia(mql.media).matches;
+ if (matches !== mql.matches) {
+ mql.matches = matches;
+ for (var j = 0, jl = listeners.length; j < jl; j++) {
+ listeners[j].call(w, mql);
+ }
+ }
+ }
+ }, 30);
+ };
+ w.matchMedia = function(media) {
+ var mql = localMatchMedia(media), listeners = [], index = 0;
+ mql.addListener = function(listener) {
+ if (!hasMediaQueries) {
+ return;
+ }
+ if (!isListening) {
+ isListening = true;
+ w.addEventListener("resize", handleChange, true);
+ }
+ if (index === 0) {
+ index = queries.push({
+ mql: mql,
+ listeners: listeners
+ });
+ }
+ listeners.push(listener);
+ };
+ mql.removeListener = function(listener) {
+ for (var i = 0, il = listeners.length; i < il; i++) {
+ if (listeners[i] === listener) {
+ listeners.splice(i, 1);
+ }
+ }
+ };
+ return mql;
+ };
+})(this);
+
+/*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
+(function(w) {
+ "use strict";
+ var respond = {};
+ w.respond = respond;
+ respond.update = function() {};
+ var requestQueue = [], xmlHttp = function() {
+ var xmlhttpmethod = false;
+ try {
+ xmlhttpmethod = new w.XMLHttpRequest();
+ } catch (e) {
+ xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
+ }
+ return function() {
+ return xmlhttpmethod;
+ };
+ }(), ajax = function(url, callback) {
+ var req = xmlHttp();
+ if (!req) {
+ return;
+ }
+ req.open("GET", url, true);
+ req.onreadystatechange = function() {
+ if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
+ return;
+ }
+ callback(req.responseText);
+ };
+ if (req.readyState === 4) {
+ return;
+ }
+ req.send(null);
+ };
+ respond.ajax = ajax;
+ respond.queue = requestQueue;
+ respond.regex = {
+ media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
+ keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
+ urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
+ findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
+ only: /(only\s+)?([a-zA-Z]+)\s?/,
+ minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
+ maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
+ };
+ respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
+ if (respond.mediaQueriesSupported) {
+ return;
+ }
+ var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() {
+ var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false;
+ div.style.cssText = "position:absolute;font-size:1em;width:1em";
+ if (!body) {
+ body = fakeUsed = doc.createElement("body");
+ body.style.background = "none";
+ }
+ docElem.style.fontSize = "100%";
+ body.style.fontSize = "100%";
+ body.appendChild(div);
+ if (fakeUsed) {
+ docElem.insertBefore(body, docElem.firstChild);
+ }
+ ret = div.offsetWidth;
+ if (fakeUsed) {
+ docElem.removeChild(body);
+ } else {
+ body.removeChild(div);
+ }
+ docElem.style.fontSize = originalHTMLFontSize;
+ if (originalBodyFontSize) {
+ body.style.fontSize = originalBodyFontSize;
+ }
+ ret = eminpx = parseFloat(ret);
+ return ret;
+ }, applyMedia = function(fromResize) {
+ var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime();
+ if (fromResize && lastCall && now - lastCall < resizeThrottle) {
+ w.clearTimeout(resizeDefer);
+ resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
+ return;
+ } else {
+ lastCall = now;
+ }
+ for (var i in mediastyles) {
+ if (mediastyles.hasOwnProperty(i)) {
+ var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em";
+ if (!!min) {
+ min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
+ }
+ if (!!max) {
+ max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
+ }
+ if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
+ if (!styleBlocks[thisstyle.media]) {
+ styleBlocks[thisstyle.media] = [];
+ }
+ styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
+ }
+ }
+ }
+ for (var j in appendedEls) {
+ if (appendedEls.hasOwnProperty(j)) {
+ if (appendedEls[j] && appendedEls[j].parentNode === head) {
+ head.removeChild(appendedEls[j]);
+ }
+ }
+ }
+ appendedEls.length = 0;
+ for (var k in styleBlocks) {
+ if (styleBlocks.hasOwnProperty(k)) {
+ var ss = doc.createElement("style"), css = styleBlocks[k].join("\n");
+ ss.type = "text/css";
+ ss.media = k;
+ head.insertBefore(ss, lastLink.nextSibling);
+ if (ss.styleSheet) {
+ ss.styleSheet.cssText = css;
+ } else {
+ ss.appendChild(doc.createTextNode(css));
+ }
+ appendedEls.push(ss);
+ }
+ }
+ }, translate = function(styles, href, media) {
+ var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0;
+ href = href.substring(0, href.lastIndexOf("/"));
+ var repUrls = function(css) {
+ return css.replace(respond.regex.urls, "$1" + href + "$2$3");
+ }, useMedia = !ql && media;
+ if (href.length) {
+ href += "/";
+ }
+ if (useMedia) {
+ ql = 1;
+ }
+ for (var i = 0; i < ql; i++) {
+ var fullq, thisq, eachq, eql;
+ if (useMedia) {
+ fullq = media;
+ rules.push(repUrls(styles));
+ } else {
+ fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
+ rules.push(RegExp.$2 && repUrls(RegExp.$2));
+ }
+ eachq = fullq.split(",");
+ eql = eachq.length;
+ for (var j = 0; j < eql; j++) {
+ thisq = eachq[j];
+ mediastyles.push({
+ media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
+ rules: rules.length - 1,
+ hasquery: thisq.indexOf("(") > -1,
+ minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
+ maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
+ });
+ }
+ }
+ applyMedia();
+ }, makeRequests = function() {
+ if (requestQueue.length) {
+ var thisRequest = requestQueue.shift();
+ ajax(thisRequest.href, function(styles) {
+ translate(styles, thisRequest.href, thisRequest.media);
+ parsedSheets[thisRequest.href] = true;
+ w.setTimeout(function() {
+ makeRequests();
+ }, 0);
+ });
+ }
+ }, ripCSS = function() {
+ for (var i = 0; i < links.length; i++) {
+ var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
+ if (!!href && isCSS && !parsedSheets[href]) {
+ if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
+ translate(sheet.styleSheet.rawCssText, href, media);
+ parsedSheets[href] = true;
+ } else {
+ if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
+ if (href.substring(0, 2) === "//") {
+ href = w.location.protocol + href;
+ }
+ requestQueue.push({
+ href: href,
+ media: media
+ });
+ }
+ }
+ }
+ }
+ makeRequests();
+ };
+ ripCSS();
+ respond.update = ripCSS;
+ respond.getEmValue = getEmValue;
+ function callMedia() {
+ applyMedia(true);
+ }
+ if (w.addEventListener) {
+ w.addEventListener("resize", callMedia, false);
+ } else if (w.attachEvent) {
+ w.attachEvent("onresize", callMedia);
+ }
+})(this); \ No newline at end of file
diff --git a/bower_components/respond/dest/respond.min.js b/bower_components/respond/dest/respond.min.js
new file mode 100644
index 00000000..80a7b69d
--- /dev/null
+++ b/bower_components/respond/dest/respond.min.js
@@ -0,0 +1,5 @@
+/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
+ * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
+ * */
+
+!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this); \ No newline at end of file
diff --git a/bower_components/respond/dest/respond.src.js b/bower_components/respond/dest/respond.src.js
new file mode 100644
index 00000000..b1298d07
--- /dev/null
+++ b/bower_components/respond/dest/respond.src.js
@@ -0,0 +1,224 @@
+/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
+/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
+(function(w) {
+ "use strict";
+ w.matchMedia = w.matchMedia || function(doc, undefined) {
+ var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div");
+ div.id = "mq-test-1";
+ div.style.cssText = "position:absolute;top:-100em";
+ fakeBody.style.background = "none";
+ fakeBody.appendChild(div);
+ return function(q) {
+ div.innerHTML = '&shy;<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>';
+ docElem.insertBefore(fakeBody, refNode);
+ bool = div.offsetWidth === 42;
+ docElem.removeChild(fakeBody);
+ return {
+ matches: bool,
+ media: q
+ };
+ };
+ }(w.document);
+})(this);
+
+/*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
+(function(w) {
+ "use strict";
+ var respond = {};
+ w.respond = respond;
+ respond.update = function() {};
+ var requestQueue = [], xmlHttp = function() {
+ var xmlhttpmethod = false;
+ try {
+ xmlhttpmethod = new w.XMLHttpRequest();
+ } catch (e) {
+ xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
+ }
+ return function() {
+ return xmlhttpmethod;
+ };
+ }(), ajax = function(url, callback) {
+ var req = xmlHttp();
+ if (!req) {
+ return;
+ }
+ req.open("GET", url, true);
+ req.onreadystatechange = function() {
+ if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
+ return;
+ }
+ callback(req.responseText);
+ };
+ if (req.readyState === 4) {
+ return;
+ }
+ req.send(null);
+ };
+ respond.ajax = ajax;
+ respond.queue = requestQueue;
+ respond.regex = {
+ media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
+ keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
+ urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
+ findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
+ only: /(only\s+)?([a-zA-Z]+)\s?/,
+ minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
+ maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
+ };
+ respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
+ if (respond.mediaQueriesSupported) {
+ return;
+ }
+ var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() {
+ var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false;
+ div.style.cssText = "position:absolute;font-size:1em;width:1em";
+ if (!body) {
+ body = fakeUsed = doc.createElement("body");
+ body.style.background = "none";
+ }
+ docElem.style.fontSize = "100%";
+ body.style.fontSize = "100%";
+ body.appendChild(div);
+ if (fakeUsed) {
+ docElem.insertBefore(body, docElem.firstChild);
+ }
+ ret = div.offsetWidth;
+ if (fakeUsed) {
+ docElem.removeChild(body);
+ } else {
+ body.removeChild(div);
+ }
+ docElem.style.fontSize = originalHTMLFontSize;
+ if (originalBodyFontSize) {
+ body.style.fontSize = originalBodyFontSize;
+ }
+ ret = eminpx = parseFloat(ret);
+ return ret;
+ }, applyMedia = function(fromResize) {
+ var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime();
+ if (fromResize && lastCall && now - lastCall < resizeThrottle) {
+ w.clearTimeout(resizeDefer);
+ resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
+ return;
+ } else {
+ lastCall = now;
+ }
+ for (var i in mediastyles) {
+ if (mediastyles.hasOwnProperty(i)) {
+ var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em";
+ if (!!min) {
+ min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
+ }
+ if (!!max) {
+ max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
+ }
+ if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
+ if (!styleBlocks[thisstyle.media]) {
+ styleBlocks[thisstyle.media] = [];
+ }
+ styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
+ }
+ }
+ }
+ for (var j in appendedEls) {
+ if (appendedEls.hasOwnProperty(j)) {
+ if (appendedEls[j] && appendedEls[j].parentNode === head) {
+ head.removeChild(appendedEls[j]);
+ }
+ }
+ }
+ appendedEls.length = 0;
+ for (var k in styleBlocks) {
+ if (styleBlocks.hasOwnProperty(k)) {
+ var ss = doc.createElement("style"), css = styleBlocks[k].join("\n");
+ ss.type = "text/css";
+ ss.media = k;
+ head.insertBefore(ss, lastLink.nextSibling);
+ if (ss.styleSheet) {
+ ss.styleSheet.cssText = css;
+ } else {
+ ss.appendChild(doc.createTextNode(css));
+ }
+ appendedEls.push(ss);
+ }
+ }
+ }, translate = function(styles, href, media) {
+ var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0;
+ href = href.substring(0, href.lastIndexOf("/"));
+ var repUrls = function(css) {
+ return css.replace(respond.regex.urls, "$1" + href + "$2$3");
+ }, useMedia = !ql && media;
+ if (href.length) {
+ href += "/";
+ }
+ if (useMedia) {
+ ql = 1;
+ }
+ for (var i = 0; i < ql; i++) {
+ var fullq, thisq, eachq, eql;
+ if (useMedia) {
+ fullq = media;
+ rules.push(repUrls(styles));
+ } else {
+ fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
+ rules.push(RegExp.$2 && repUrls(RegExp.$2));
+ }
+ eachq = fullq.split(",");
+ eql = eachq.length;
+ for (var j = 0; j < eql; j++) {
+ thisq = eachq[j];
+ mediastyles.push({
+ media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
+ rules: rules.length - 1,
+ hasquery: thisq.indexOf("(") > -1,
+ minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
+ maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
+ });
+ }
+ }
+ applyMedia();
+ }, makeRequests = function() {
+ if (requestQueue.length) {
+ var thisRequest = requestQueue.shift();
+ ajax(thisRequest.href, function(styles) {
+ translate(styles, thisRequest.href, thisRequest.media);
+ parsedSheets[thisRequest.href] = true;
+ w.setTimeout(function() {
+ makeRequests();
+ }, 0);
+ });
+ }
+ }, ripCSS = function() {
+ for (var i = 0; i < links.length; i++) {
+ var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
+ if (!!href && isCSS && !parsedSheets[href]) {
+ if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
+ translate(sheet.styleSheet.rawCssText, href, media);
+ parsedSheets[href] = true;
+ } else {
+ if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
+ if (href.substring(0, 2) === "//") {
+ href = w.location.protocol + href;
+ }
+ requestQueue.push({
+ href: href,
+ media: media
+ });
+ }
+ }
+ }
+ }
+ makeRequests();
+ };
+ ripCSS();
+ respond.update = ripCSS;
+ respond.getEmValue = getEmValue;
+ function callMedia() {
+ applyMedia(true);
+ }
+ if (w.addEventListener) {
+ w.addEventListener("resize", callMedia, false);
+ } else if (w.attachEvent) {
+ w.attachEvent("onresize", callMedia);
+ }
+})(this); \ No newline at end of file
diff --git a/bower_components/respond/package.json b/bower_components/respond/package.json
new file mode 100644
index 00000000..42864b01
--- /dev/null
+++ b/bower_components/respond/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "Respond.js",
+ "description": "min/max-width media query polyfill",
+ "version": "1.4.2",
+ "homepage": "https://github.com/scottjehl/Respond",
+ "author": {
+ "name": "Scott Jehl",
+ "email": "scott@filamentgroup.com",
+ "url": "http://filamentgroup.com"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/scottjehl/Respond.git"
+ },
+ "bugs": {
+ "url": "https://github.com/scottjehl/Respond/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT"
+ }
+ ],
+ "devDependencies": {
+ "grunt-cli":"~0.1",
+ "grunt": "~0.4.0",
+ "grunt-contrib-jshint": "~0.2.0",
+ "grunt-contrib-qunit": "~0.3.0",
+ "grunt-contrib-uglify": "0.2.7"
+ }
+
+}
diff --git a/bower_components/respond/src/matchmedia.addListener.js b/bower_components/respond/src/matchmedia.addListener.js
new file mode 100644
index 00000000..82909157
--- /dev/null
+++ b/bower_components/respond/src/matchmedia.addListener.js
@@ -0,0 +1,76 @@
+/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */
+(function( w ){
+ "use strict";
+ // Bail out for browsers that have addListener support
+ if (w.matchMedia && w.matchMedia('all').addListener) {
+ return false;
+ }
+
+ var localMatchMedia = w.matchMedia,
+ hasMediaQueries = localMatchMedia('only all').matches,
+ isListening = false,
+ timeoutID = 0, // setTimeout for debouncing 'handleChange'
+ queries = [], // Contains each 'mql' and associated 'listeners' if 'addListener' is used
+ handleChange = function(evt) {
+ // Debounce
+ w.clearTimeout(timeoutID);
+
+ timeoutID = w.setTimeout(function() {
+ for (var i = 0, il = queries.length; i < il; i++) {
+ var mql = queries[i].mql,
+ listeners = queries[i].listeners || [],
+ matches = localMatchMedia(mql.media).matches;
+
+ // Update mql.matches value and call listeners
+ // Fire listeners only if transitioning to or from matched state
+ if (matches !== mql.matches) {
+ mql.matches = matches;
+
+ for (var j = 0, jl = listeners.length; j < jl; j++) {
+ listeners[j].call(w, mql);
+ }
+ }
+ }
+ }, 30);
+ };
+
+ w.matchMedia = function(media) {
+ var mql = localMatchMedia(media),
+ listeners = [],
+ index = 0;
+
+ mql.addListener = function(listener) {
+ // Changes would not occur to css media type so return now (Affects IE <= 8)
+ if (!hasMediaQueries) {
+ return;
+ }
+
+ // Set up 'resize' listener for browsers that support CSS3 media queries (Not for IE <= 8)
+ // There should only ever be 1 resize listener running for performance
+ if (!isListening) {
+ isListening = true;
+ w.addEventListener('resize', handleChange, true);
+ }
+
+ // Push object only if it has not been pushed already
+ if (index === 0) {
+ index = queries.push({
+ mql : mql,
+ listeners : listeners
+ });
+ }
+
+ listeners.push(listener);
+ };
+
+ mql.removeListener = function(listener) {
+ for (var i = 0, il = listeners.length; i < il; i++){
+ if (listeners[i] === listener){
+ listeners.splice(i, 1);
+ }
+ }
+ };
+
+ return mql;
+ };
+}( this ));
diff --git a/bower_components/respond/src/matchmedia.polyfill.js b/bower_components/respond/src/matchmedia.polyfill.js
new file mode 100644
index 00000000..12d2b95f
--- /dev/null
+++ b/bower_components/respond/src/matchmedia.polyfill.js
@@ -0,0 +1,36 @@
+/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
+/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
+
+(function(w){
+ "use strict";
+ w.matchMedia = w.matchMedia || (function( doc, undefined ) {
+
+ var bool,
+ docElem = doc.documentElement,
+ refNode = docElem.firstElementChild || docElem.firstChild,
+ // fakeBody required for <FF4 when executed in <head>
+ fakeBody = doc.createElement( "body" ),
+ div = doc.createElement( "div" );
+
+ div.id = "mq-test-1";
+ div.style.cssText = "position:absolute;top:-100em";
+ fakeBody.style.background = "none";
+ fakeBody.appendChild(div);
+
+ return function(q){
+
+ div.innerHTML = "&shy;<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
+
+ docElem.insertBefore( fakeBody, refNode );
+ bool = div.offsetWidth === 42;
+ docElem.removeChild( fakeBody );
+
+ return {
+ matches: bool,
+ media: q
+ };
+
+ };
+
+ }( w.document ));
+}( this ));
diff --git a/bower_components/respond/src/respond.js b/bower_components/respond/src/respond.js
new file mode 100644
index 00000000..7b77134f
--- /dev/null
+++ b/bower_components/respond/src/respond.js
@@ -0,0 +1,341 @@
+/*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
+(function( w ){
+
+ "use strict";
+
+ //exposed namespace
+ var respond = {};
+ w.respond = respond;
+
+ //define update even in native-mq-supporting browsers, to avoid errors
+ respond.update = function(){};
+
+ //define ajax obj
+ var requestQueue = [],
+ xmlHttp = (function() {
+ var xmlhttpmethod = false;
+ try {
+ xmlhttpmethod = new w.XMLHttpRequest();
+ }
+ catch( e ){
+ xmlhttpmethod = new w.ActiveXObject( "Microsoft.XMLHTTP" );
+ }
+ return function(){
+ return xmlhttpmethod;
+ };
+ })(),
+
+ //tweaked Ajax functions from Quirksmode
+ ajax = function( url, callback ) {
+ var req = xmlHttp();
+ if (!req){
+ return;
+ }
+ req.open( "GET", url, true );
+ req.onreadystatechange = function () {
+ if ( req.readyState !== 4 || req.status !== 200 && req.status !== 304 ){
+ return;
+ }
+ callback( req.responseText );
+ };
+ if ( req.readyState === 4 ){
+ return;
+ }
+ req.send( null );
+ };
+
+ //expose for testing
+ respond.ajax = ajax;
+ respond.queue = requestQueue;
+
+ // expose for testing
+ respond.regex = {
+ media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
+ keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
+ urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
+ findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
+ only: /(only\s+)?([a-zA-Z]+)\s?/,
+ minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
+ maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
+ };
+
+ //expose media query support flag for external use
+ respond.mediaQueriesSupported = w.matchMedia && w.matchMedia( "only all" ) !== null && w.matchMedia( "only all" ).matches;
+
+ //if media queries are supported, exit here
+ if( respond.mediaQueriesSupported ){
+ return;
+ }
+
+ //define vars
+ var doc = w.document,
+ docElem = doc.documentElement,
+ mediastyles = [],
+ rules = [],
+ appendedEls = [],
+ parsedSheets = {},
+ resizeThrottle = 30,
+ head = doc.getElementsByTagName( "head" )[0] || docElem,
+ base = doc.getElementsByTagName( "base" )[0],
+ links = head.getElementsByTagName( "link" ),
+
+ lastCall,
+ resizeDefer,
+
+ //cached container for 1em value, populated the first time it's needed
+ eminpx,
+
+ // returns the value of 1em in pixels
+ getEmValue = function() {
+ var ret,
+ div = doc.createElement('div'),
+ body = doc.body,
+ originalHTMLFontSize = docElem.style.fontSize,
+ originalBodyFontSize = body && body.style.fontSize,
+ fakeUsed = false;
+
+ div.style.cssText = "position:absolute;font-size:1em;width:1em";
+
+ if( !body ){
+ body = fakeUsed = doc.createElement( "body" );
+ body.style.background = "none";
+ }
+
+ // 1em in a media query is the value of the default font size of the browser
+ // reset docElem and body to ensure the correct value is returned
+ docElem.style.fontSize = "100%";
+ body.style.fontSize = "100%";
+
+ body.appendChild( div );
+
+ if( fakeUsed ){
+ docElem.insertBefore( body, docElem.firstChild );
+ }
+
+ ret = div.offsetWidth;
+
+ if( fakeUsed ){
+ docElem.removeChild( body );
+ }
+ else {
+ body.removeChild( div );
+ }
+
+ // restore the original values
+ docElem.style.fontSize = originalHTMLFontSize;
+ if( originalBodyFontSize ) {
+ body.style.fontSize = originalBodyFontSize;
+ }
+
+
+ //also update eminpx before returning
+ ret = eminpx = parseFloat(ret);
+
+ return ret;
+ },
+
+ //enable/disable styles
+ applyMedia = function( fromResize ){
+ var name = "clientWidth",
+ docElemProp = docElem[ name ],
+ currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp,
+ styleBlocks = {},
+ lastLink = links[ links.length-1 ],
+ now = (new Date()).getTime();
+
+ //throttle resize calls
+ if( fromResize && lastCall && now - lastCall < resizeThrottle ){
+ w.clearTimeout( resizeDefer );
+ resizeDefer = w.setTimeout( applyMedia, resizeThrottle );
+ return;
+ }
+ else {
+ lastCall = now;
+ }
+
+ for( var i in mediastyles ){
+ if( mediastyles.hasOwnProperty( i ) ){
+ var thisstyle = mediastyles[ i ],
+ min = thisstyle.minw,
+ max = thisstyle.maxw,
+ minnull = min === null,
+ maxnull = max === null,
+ em = "em";
+
+ if( !!min ){
+ min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
+ }
+ if( !!max ){
+ max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
+ }
+
+ // if there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
+ if( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){
+ if( !styleBlocks[ thisstyle.media ] ){
+ styleBlocks[ thisstyle.media ] = [];
+ }
+ styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] );
+ }
+ }
+ }
+
+ //remove any existing respond style element(s)
+ for( var j in appendedEls ){
+ if( appendedEls.hasOwnProperty( j ) ){
+ if( appendedEls[ j ] && appendedEls[ j ].parentNode === head ){
+ head.removeChild( appendedEls[ j ] );
+ }
+ }
+ }
+ appendedEls.length = 0;
+
+ //inject active styles, grouped by media type
+ for( var k in styleBlocks ){
+ if( styleBlocks.hasOwnProperty( k ) ){
+ var ss = doc.createElement( "style" ),
+ css = styleBlocks[ k ].join( "\n" );
+
+ ss.type = "text/css";
+ ss.media = k;
+
+ //originally, ss was appended to a documentFragment and sheets were appended in bulk.
+ //this caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
+ head.insertBefore( ss, lastLink.nextSibling );
+
+ if ( ss.styleSheet ){
+ ss.styleSheet.cssText = css;
+ }
+ else {
+ ss.appendChild( doc.createTextNode( css ) );
+ }
+
+ //push to appendedEls to track for later removal
+ appendedEls.push( ss );
+ }
+ }
+ },
+ //find media blocks in css text, convert to style blocks
+ translate = function( styles, href, media ){
+ var qs = styles.replace( respond.regex.keyframes, '' ).match( respond.regex.media ),
+ ql = qs && qs.length || 0;
+
+ //try to get CSS path
+ href = href.substring( 0, href.lastIndexOf( "/" ) );
+
+ var repUrls = function( css ){
+ return css.replace( respond.regex.urls, "$1" + href + "$2$3" );
+ },
+ useMedia = !ql && media;
+
+ //if path exists, tack on trailing slash
+ if( href.length ){ href += "/"; }
+
+ //if no internal queries exist, but media attr does, use that
+ //note: this currently lacks support for situations where a media attr is specified on a link AND
+ //its associated stylesheet has internal CSS media queries.
+ //In those cases, the media attribute will currently be ignored.
+ if( useMedia ){
+ ql = 1;
+ }
+
+ for( var i = 0; i < ql; i++ ){
+ var fullq, thisq, eachq, eql;
+
+ //media attr
+ if( useMedia ){
+ fullq = media;
+ rules.push( repUrls( styles ) );
+ }
+ //parse for styles
+ else{
+ fullq = qs[ i ].match( respond.regex.findStyles ) && RegExp.$1;
+ rules.push( RegExp.$2 && repUrls( RegExp.$2 ) );
+ }
+
+ eachq = fullq.split( "," );
+ eql = eachq.length;
+
+ for( var j = 0; j < eql; j++ ){
+ thisq = eachq[ j ];
+ mediastyles.push( {
+ media : thisq.split( "(" )[ 0 ].match( respond.regex.only ) && RegExp.$2 || "all",
+ rules : rules.length - 1,
+ hasquery : thisq.indexOf("(") > -1,
+ minw : thisq.match( respond.regex.minw ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
+ maxw : thisq.match( respond.regex.maxw ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
+ } );
+ }
+ }
+
+ applyMedia();
+ },
+
+ //recurse through request queue, get css text
+ makeRequests = function(){
+ if( requestQueue.length ){
+ var thisRequest = requestQueue.shift();
+
+ ajax( thisRequest.href, function( styles ){
+ translate( styles, thisRequest.href, thisRequest.media );
+ parsedSheets[ thisRequest.href ] = true;
+
+ // by wrapping recursive function call in setTimeout
+ // we prevent "Stack overflow" error in IE7
+ w.setTimeout(function(){ makeRequests(); },0);
+ } );
+ }
+ },
+
+ //loop stylesheets, send text content to translate
+ ripCSS = function(){
+
+ for( var i = 0; i < links.length; i++ ){
+ var sheet = links[ i ],
+ href = sheet.href,
+ media = sheet.media,
+ isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
+
+ //only links plz and prevent re-parsing
+ if( !!href && isCSS && !parsedSheets[ href ] ){
+ // selectivizr exposes css through the rawCssText expando
+ if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
+ translate( sheet.styleSheet.rawCssText, href, media );
+ parsedSheets[ href ] = true;
+ } else {
+ if( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base) ||
+ href.replace( RegExp.$1, "" ).split( "/" )[0] === w.location.host ){
+ // IE7 doesn't handle urls that start with '//' for ajax request
+ // manually add in the protocol
+ if ( href.substring(0,2) === "//" ) { href = w.location.protocol + href; }
+ requestQueue.push( {
+ href: href,
+ media: media
+ } );
+ }
+ }
+ }
+ }
+ makeRequests();
+ };
+
+ //translate CSS
+ ripCSS();
+
+ //expose update for re-running respond later on
+ respond.update = ripCSS;
+
+ //expose getEmValue
+ respond.getEmValue = getEmValue;
+
+ //adjust on resize
+ function callMedia(){
+ applyMedia( true );
+ }
+
+ if( w.addEventListener ){
+ w.addEventListener( "resize", callMedia, false );
+ }
+ else if( w.attachEvent ){
+ w.attachEvent( "onresize", callMedia );
+ }
+})(this);