From 9bf0a9d13e1d0938e47847db0487f0f0fce0d8b3 Mon Sep 17 00:00:00 2001 From: Thomas Park Date: Tue, 24 Dec 2013 17:03:28 -0500 Subject: fixes #185, installs html5shiv/respond and downgrades jquery for ie8 --- bower_components/respond/cross-domain/example.html | 24 ++++ .../respond/cross-domain/respond-proxy.html | 96 ++++++++++++++++ .../respond/cross-domain/respond.proxy.gif | Bin 0 -> 35 bytes .../respond/cross-domain/respond.proxy.js | 127 +++++++++++++++++++++ 4 files changed, 247 insertions(+) create mode 100644 bower_components/respond/cross-domain/example.html create mode 100644 bower_components/respond/cross-domain/respond-proxy.html create mode 100644 bower_components/respond/cross-domain/respond.proxy.gif create mode 100644 bower_components/respond/cross-domain/respond.proxy.js (limited to 'bower_components/respond/cross-domain') 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 @@ + + + + + Respond JS Test Page + + + + + + + + + + +

This is a visual test file for cross-domain proxy.

+ +

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.

+ + +

Media-attributes are working too! This should be visible above 600px.

+ + + 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 Proxy + + + + + \ 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 Binary files /dev/null and b/bower_components/respond/cross-domain/respond.proxy.gif 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( '' ); + 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 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 = ''; + 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 ); -- cgit v1.2.3