Match TFS Changeset 303362

This commit is contained in:
2022-02-01 19:56:15 -07:00
parent 306279760c
commit 053c873d6b
151 changed files with 49858 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,520 @@
/**
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.2';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?: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;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
/*------------------------------- Print Shiv -------------------------------*/
/** Used to filter media types */
var reMedia = /^$|\b(?:all|print)\b/;
/** Used to namespace printable elements */
var shivNamespace = 'html5shiv';
/** Detect whether the browser supports shivable style sheets */
var supportsShivableSheets = !supportsUnknownElements && (function() {
// assign a false negative if unable to shiv
var docEl = document.documentElement;
return !(
typeof document.namespaces == 'undefined' ||
typeof document.parentWindow == 'undefined' ||
typeof docEl.applyElement == 'undefined' ||
typeof docEl.removeNode == 'undefined' ||
typeof window.attachEvent == 'undefined'
);
}());
/*--------------------------------------------------------------------------*/
/**
* Wraps all HTML5 elements in the given document with printable elements.
* (eg. the "header" element is wrapped with the "html5shiv:header" element)
* @private
* @param {Document} ownerDocument The document.
* @returns {Array} An array wrappers added.
*/
function addWrappers(ownerDocument) {
var node,
nodes = ownerDocument.getElementsByTagName('*'),
index = nodes.length,
reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
result = [];
while (index--) {
node = nodes[index];
if (reElements.test(node.nodeName)) {
result.push(node.applyElement(createWrapper(node)));
}
}
return result;
}
/**
* Creates a printable wrapper for the given element.
* @private
* @param {Element} element The element.
* @returns {Element} The wrapper.
*/
function createWrapper(element) {
var node,
nodes = element.attributes,
index = nodes.length,
wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);
// copy element attributes to the wrapper
while (index--) {
node = nodes[index];
node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
}
// copy element styles to the wrapper
wrapper.style.cssText = element.style.cssText;
return wrapper;
}
/**
* Shivs the given CSS text.
* (eg. header{} becomes html5shiv\:header{})
* @private
* @param {String} cssText The CSS text to shiv.
* @returns {String} The shived CSS text.
*/
function shivCssText(cssText) {
var pair,
parts = cssText.split('{'),
index = parts.length,
reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
replacement = '$1' + shivNamespace + '\\:$2';
while (index--) {
pair = parts[index] = parts[index].split('}');
pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
parts[index] = pair.join('}');
}
return parts.join('{');
}
/**
* Removes the given wrappers, leaving the original elements.
* @private
* @params {Array} wrappers An array of printable wrappers.
*/
function removeWrappers(wrappers) {
var index = wrappers.length;
while (index--) {
wrappers[index].removeNode();
}
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document for print.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces,
ownerWindow = ownerDocument.parentWindow;
if (!supportsShivableSheets || ownerDocument.printShived) {
return ownerDocument;
}
if (typeof namespaces[shivNamespace] == 'undefined') {
namespaces.add(shivNamespace);
}
function removeSheet() {
clearTimeout(data._removeSheetTimer);
if (shivedSheet) {
shivedSheet.removeNode(true);
}
shivedSheet= null;
}
ownerWindow.attachEvent('onbeforeprint', function() {
removeSheet();
var imports,
length,
sheet,
collection = ownerDocument.styleSheets,
cssText = [],
index = collection.length,
sheets = Array(index);
// convert styleSheets collection to an array
while (index--) {
sheets[index] = collection[index];
}
// concat all style sheet CSS text
while ((sheet = sheets.pop())) {
// IE does not enforce a same origin policy for external style sheets...
// but has trouble with some dynamically created stylesheets
if (!sheet.disabled && reMedia.test(sheet.media)) {
try {
imports = sheet.imports;
length = imports.length;
} catch(er){
length = 0;
}
for (index = 0; index < length; index++) {
sheets.push(imports[index]);
}
try {
cssText.push(sheet.cssText);
} catch(er){}
}
}
// wrap all HTML5 elements with printable elements and add the shived style sheet
cssText = shivCssText(cssText.reverse().join(''));
wrappers = addWrappers(ownerDocument);
shivedSheet = addStyleSheet(ownerDocument, cssText);
});
ownerWindow.attachEvent('onafterprint', function() {
// remove wrappers, leaving the original elements, and remove the shived style sheet
removeWrappers(wrappers);
clearTimeout(data._removeSheetTimer);
data._removeSheetTimer = setTimeout(removeSheet, 500);
});
ownerDocument.printShived = true;
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
// expose API
html5.type += ' print';
html5.shivPrint = shivPrint;
// shiv for print
shivPrint(document);
}(this, document));

View File

@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.2",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?: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,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b)}(this,document);

View File

@ -0,0 +1,322 @@
/**
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.2';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?: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;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
}(this, document));

View File

@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?: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,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);

View File

@ -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));

View File

@ -0,0 +1,4 @@
(function(n){"use strict";if(n.matchMedia&&n.matchMedia("all").addListener)return!1;var i=n.matchMedia,f=i("only all").matches,r=!1,u=0,t=[],e=function(){n.clearTimeout(u);u=n.setTimeout(function(){for(var f,h,r=0,e=t.length;r<e;r++){var u=t[r].mql,o=t[r].listeners||[],s=i(u.media).matches;if(s!==u.matches)for(u.matches=s,f=0,h=o.length;f<h;f++)o[f].call(n,u)}},30)};n.matchMedia=function(u){var s=i(u),o=[],h=0;return s.addListener=function(i){f&&(r||(r=!0,n.addEventListener("resize",e,!0)),h===0&&(h=t.push({mql:s,listeners:o})),o.push(i))},s.removeListener=function(n){for(var t=0,i=o.length;t<i;t++)o[t]===n&&o.splice(t,1)},s}})(this);
/*
//# sourceMappingURL=matchmedia.addListener.min.js.map
*/

View File

@ -0,0 +1,8 @@
{
"version":3,
"file":"matchmedia.addListener.min.js",
"lineCount":1,
"mappings":"CACC,QAAS,CAACA,CAAD,CAAI,CACV,Y,CAEA,GAAIA,CAACC,WAAY,EAAGD,CAACC,WAAW,CAAC,KAAD,CAAOC,aACnC,MAAO,CAAA,CACX,CAEA,IAAIC,EAAkBH,CAACC,YACzBG,EAAkBD,CAAe,CAAC,UAAD,CAAYE,SAC7CC,EAAc,CAAA,EACdC,EAAY,EACZC,EAAU,CAAA,EACVC,EAAe,QAAS,CAAA,CAAM,CAE1BT,CAACU,aAAa,CAACH,CAAD,CAAW,CAEzBA,CAAU,CAAEP,CAACW,WAAW,CAAC,QAAS,CAAA,CAAG,CACjC,IAAK,IAUYC,EAAOC,EAVfC,EAAI,EAAGC,EAAKP,CAAOQ,OAAO,CAAEF,CAAE,CAAEC,CAAE,CAAED,CAAC,EAA9C,CAAkD,CAC9C,IAAIG,EAAMT,CAAQ,CAAAM,CAAA,CAAEG,KAC5BC,EAAYV,CAAQ,CAAAM,CAAA,CAAEI,UAAW,EAAG,CAAA,EACpCb,EAAUF,CAAe,CAACc,CAAGE,MAAJ,CAAWd,QAAQ,CAIpC,GAAIA,CAAQ,GAAIY,CAAGZ,SAGf,IAFAY,CAAGZ,QAAS,CAAEA,CAAO,CAEZO,CAAE,CAAE,C,CAAGC,CAAG,CAAEK,CAASF,OAAO,CAAEJ,CAAE,CAAEC,CAAE,CAAED,CAAC,EAAhD,CACIM,CAAU,CAAAN,CAAA,CAAEQ,KAAK,CAACpB,CAAC,CAAEiB,CAAJ,CAXqB,CADjB,CAgBpC,CAAE,EAhBqB,CAJE,CAqB7B,CAECjB,CAACC,WAAY,CAAEoB,QAAS,CAACF,CAAD,CAAQ,CAC5B,IAAIF,EAAMd,CAAe,CAACgB,CAAD,EAC9BD,EAAY,CAAA,EACZI,EAAQ,CAAC,CAkCJ,OAhCAL,CAAGf,YAAa,CAAEqB,QAAS,CAACC,CAAD,CAAW,CAE7BpB,C,GAMAE,C,GACDA,CAAY,CAAE,CAAA,CAAI,CAClBN,CAACyB,iBAAiB,CAAC,QAAQ,CAAEhB,CAAY,CAAE,CAAA,CAAzB,EAA8B,CAIhDa,CAAM,GAAI,C,GACVA,CAAM,CAAEd,CAAOkB,KAAK,CAAC,CACjB,GAAG,CAAET,CAAG,CACR,SAAS,CAAEC,CAFM,CAAD,EAGlB,CAGNA,CAASQ,KAAK,CAACF,CAAD,EArBoB,CAsBrC,CAEDP,CAAGU,eAAgB,CAAEC,QAAS,CAACJ,CAAD,CAAW,CACrC,IAAK,IAAIV,EAAI,EAAGC,EAAKG,CAASF,OAAO,CAAEF,CAAE,CAAEC,CAAE,CAAED,CAAC,EAAhD,CACQI,CAAU,CAAAJ,CAAA,CAAG,GAAIU,C,EACjBN,CAASW,OAAO,CAACf,CAAC,CAAE,CAAJ,CAHa,CAMxC,CAEMG,CArCqB,CAnCtB,EA0Eb,CAAC,IAAD,C",
"sources":["matchmedia.addListener.js"],
"names":["w","matchMedia","addListener","localMatchMedia","hasMediaQueries","matches","isListening","timeoutID","queries","handleChange","clearTimeout","setTimeout","j","jl","i","il","length","mql","listeners","media","call","w.matchMedia","index","mql.addListener","listener","addEventListener","push","removeListener","mql.removeListener","splice"]
}

View File

@ -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));

View File

@ -0,0 +1,4 @@
(function(n){"use strict";n.matchMedia=n.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=t.offsetWidth===42,i.removeChild(r),{matches:u,media:n}}}(n.document)})(this);
/*
//# sourceMappingURL=matchmedia.polyfill.min.js.map
*/

View File

@ -0,0 +1,8 @@
{
"version":3,
"file":"matchmedia.polyfill.min.js",
"lineCount":1,
"mappings":"CAGC,QAAS,CAACA,CAAD,CAAI,CACV,Y,CACAA,CAACC,WAAY,CAAED,CAACC,WAAY,EAAI,QAAS,CAACC,CAAD,CAAiB,CAEtD,IAAIC,EACTC,EAAUF,CAAGG,iBACbC,EAAUF,CAAOG,kBAAmB,EAAGH,CAAOI,YAE9CC,EAAWP,CAAGQ,cAAc,CAAC,MAAD,EAC5BC,EAAMT,CAAGQ,cAAc,CAAC,KAAD,CAAO,CAOzB,OALAC,CAAGC,GAAI,CAAE,WAAW,CACpBD,CAAGE,MAAMC,QAAS,CAAE,8BAA8B,CAClDL,CAAQI,MAAME,WAAY,CAAE,MAAM,CAClCN,CAAQO,YAAY,CAACL,CAAD,CAAK,CAElB,QAAS,CAACM,CAAD,CAAI,CAQhB,OANAN,CAAGO,UAAW,CAAE,qBAAuB,CAAED,CAAE,CAAE,yCAAyC,CAEtFb,CAAOe,aAAa,CAACV,CAAQ,CAAEH,CAAX,CAAmB,CACvCH,CAAK,CAAEQ,CAAGS,YAAa,GAAI,EAAE,CAC7BhB,CAAOiB,YAAY,CAACZ,CAAD,CAAU,CAEtB,CACH,OAAO,CAAEN,CAAI,CACb,KAAK,CAAEc,CAFJ,CARS,CAdkC,CA6BzD,CAACjB,CAACsB,SAAF,CA/BS,EAgCb,CAAC,IAAD,C",
"sources":["matchmedia.polyfill.js"],
"names":["w","matchMedia","doc","bool","docElem","documentElement","refNode","firstElementChild","firstChild","fakeBody","createElement","div","id","style","cssText","background","appendChild","q","innerHTML","insertBefore","offsetWidth","removeChild","document"]
}

View File

@ -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);

View File

@ -0,0 +1,4 @@
(function(n){"use strict";function nt(){y(!0)}var t={};n.respond=t;t.update=function(){};var f=[],tt=function(){var t=!1;try{t=new n.XMLHttpRequest}catch(i){t=new n.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),p=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){i.readyState===4&&(i.status===200||i.status===304)&&t(i.responseText)},i.readyState!==4)&&i.send(null)};if(t.ajax=p,t.queue=f,t.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]*\)/},t.mediaQueriesSupported=n.matchMedia&&n.matchMedia("only all")!==null&&n.matchMedia("only all").matches,!t.mediaQueriesSupported){var i=n.document,r=i.documentElement,e=[],o=[],u=[],c={},w=30,s=i.getElementsByTagName("head")[0]||r,it=i.getElementsByTagName("base")[0],h=s.getElementsByTagName("link"),l,b,a,v=function(){var f,t=i.createElement("div"),n=i.body,o=r.style.fontSize,e=n&&n.style.fontSize,u=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=u=i.createElement("body"),n.style.background="none"),r.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),u&&r.insertBefore(n,r.firstChild),f=t.offsetWidth,u?r.removeChild(n):n.removeChild(t),r.style.fontSize=o,e&&(n.style.fontSize=e),a=parseFloat(f)},y=function(t){var rt="clientWidth",ut=r[rt],ft=i.compatMode==="CSS1Compat"&&ut||i.body[rt]||ut,p={},ct=h[h.length-1],et=(new Date).getTime(),tt,g,nt,f,it;if(t&&l&&et-l<w){n.clearTimeout(b);b=n.setTimeout(y,w);return}l=et;for(tt in e)if(e.hasOwnProperty(tt)){var c=e[tt],k=c.minw,d=c.maxw,ot=k===null,st=d===null,ht="em";!k||(k=parseFloat(k)*(k.indexOf(ht)>-1?a||v():1));!d||(d=parseFloat(d)*(d.indexOf(ht)>-1?a||v():1));c.hasquery&&(ot&&st||!(ot||ft>=k)||!(st||ft<=d))||(p[c.media]||(p[c.media]=[]),p[c.media].push(o[c.rules]))}for(g in u)u.hasOwnProperty(g)&&u[g]&&u[g].parentNode===s&&s.removeChild(u[g]);u.length=0;for(nt in p)p.hasOwnProperty(nt)&&(f=i.createElement("style"),it=p[nt].join("\n"),f.type="text/css",f.media=nt,s.insertBefore(f,ct.nextSibling),f.styleSheet?f.styleSheet.cssText=it:f.appendChild(i.createTextNode(it)),u.push(f))},k=function(n,i,r){var h=n.replace(t.regex.keyframes,"").match(t.regex.media),c=h&&h.length||0,l,a,f,v,u,p,w,s;for(i=i.substring(0,i.lastIndexOf("/")),l=function(n){return n.replace(t.regex.urls,"$1"+i+"$2$3")},a=!c&&r,i.length&&(i+="/"),a&&(c=1),f=0;f<c;f++)for(a?(v=r,o.push(l(n))):(v=h[f].match(t.regex.findStyles)&&RegExp.$1,o.push(RegExp.$2&&l(RegExp.$2))),p=v.split(","),w=p.length,s=0;s<w;s++)u=p[s],e.push({media:u.split("(")[0].match(t.regex.only)&&RegExp.$2||"all",rules:o.length-1,hasquery:u.indexOf("(")>-1,minw:u.match(t.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:u.match(t.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});y()},d=function(){if(f.length){var t=f.shift();p(t.href,function(i){k(i,t.href,t.media);c[t.href]=!0;n.setTimeout(function(){d()},0)})}},g=function(){for(var r=0;r<h.length;r++){var i=h[r],t=i.href,u=i.media,e=i.rel&&i.rel.toLowerCase()==="stylesheet";!t||!e||c[t]||(i.styleSheet&&i.styleSheet.rawCssText?(k(i.styleSheet.rawCssText,t,u),c[t]=!0):(/^([a-zA-Z:]*\/\/)/.test(t)||it)&&t.replace(RegExp.$1,"").split("/")[0]!==n.location.host||(t.substring(0,2)==="//"&&(t=n.location.protocol+t),f.push({href:t,media:u})))}d()};g();t.update=g;t.getEmValue=v;n.addEventListener?n.addEventListener("resize",nt,!1):n.attachEvent&&n.attachEvent("onresize",nt)}})(this);
/*
//# sourceMappingURL=respond.min.js.map
*/

File diff suppressed because one or more lines are too long

View File

@ -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);

View File

@ -0,0 +1,4 @@
(function(n,t){function f(t){return n.encodeURIComponent(t)}function s(r,s){function l(){var t;try{t=h.contentWindow.name}catch(i){}t?(h.src="about:blank",h.parentNode.removeChild(h),h=null,c&&(c=null,n.CollectGarbage&&n.CollectGarbage()),s(t)):n.setTimeout(l,100)}var h,c;"ActiveXObject"in n?(c=new ActiveXObject("htmlfile"),c.open(),c.write('<iframe id="x"><\/iframe>'),c.close(),h=c.getElementById("x")):(h=t.createElement("iframe"),h.style.cssText="position:absolute;top:-99em",i.insertBefore(h,i.firstElementChild||i.firstChild));h.src=e(o)+"?url="+f(u)+"&css="+f(e(r));n.setTimeout(l,500)}function e(n){return r&&n.indexOf(r.href)===-1&&(bref=/\/$/.test(r.href)?r.href:r.href+"/",n=bref+n),n}function h(){if(~!u.indexOf(location.host)){var n=t.createElement("div");n.innerHTML='<a href="'+u+'"><\/a>';i.insertBefore(n,i.firstElementChild||i.firstChild);u=n.firstChild.href;n.parentNode.removeChild(n);n=null}}function c(){for(var i=t.getElementsByTagName("link"),n=0,o=i.length;n<o;n++){var u=i[n],f=i[n].href,e=/^([a-zA-Z:]*\/\/(www\.)?)/.test(f),h=r&&!e||e;u.rel.indexOf("stylesheet")>=0&&h&&function(n){s(f,function(t){n.styleSheet.rawCssText=t;respond.update()})}(u)}}var i=t.documentElement,o=t.getElementById("respond-proxy").href,u=(t.getElementById("respond-redirect")||location).href,r=t.getElementsByTagName("base")[0];respond.mediaQueriesSupported||(h(),c())})(window,document);
/*
//# sourceMappingURL=respond.proxy.min.js.map
*/

View File

@ -0,0 +1,8 @@
{
"version":3,
"file":"respond.proxy.min.js",
"lineCount":1,
"mappings":"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",
"sources":["respond.proxy.js"],
"names":["win","doc","encode","url","encodeURIComponent","fakejax","callback","checkFrameName","cssText","iframe","contentWindow","name","e","src","parentNode","removeChild","AXO","CollectGarbage","setTimeout","ActiveXObject","open","write","close","getElementById","createElement","style","docElem","insertBefore","firstElementChild","firstChild","checkBaseURL","proxyURL","redirectURL","href","baseElem","indexOf","bref","test","checkRedirectURL","location","host","fakeLink","innerHTML","buildUrls","links","getElementsByTagName","i","linkl","length","thislink","extreg","ext","rel","link","css","styleSheet","rawCssText","respond","update","documentElement","mediaQueriesSupported","window","document"]
}

View File

@ -0,0 +1,4 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.