Bootstrap is maintained by the founding team and a small group of invaluable core contributors, with the massive support and involvement of our community.
-
+
-
+
diff --git a/docs-assets/js/jszip.js b/docs-assets/js/jszip.js
index 4be4e6a40a..79a7654a4d 100644
--- a/docs-assets/js/jszip.js
+++ b/docs-assets/js/jszip.js
@@ -58,8 +58,62 @@ JSZip.defaults = {
compression: null
};
+/*
+ * List features that require a modern browser, and if the current browser support them.
+ */
+JSZip.support = {
+ // contains true if JSZip can read/generate ArrayBuffer, false otherwise.
+ arraybuffer : (function(){
+ return typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
+ })(),
+ // contains true if JSZip can read/generate nodejs Buffer, false otherwise.
+ nodebuffer : (function(){
+ return typeof Buffer !== "undefined";
+ })(),
+ // contains true if JSZip can read/generate Uint8Array, false otherwise.
+ uint8array : (function(){
+ return typeof Uint8Array !== "undefined";
+ })(),
+ // contains true if JSZip can read/generate Blob, false otherwise.
+ blob : (function(){
+ // the spec started with BlobBuilder then replaced it with a construtor for Blob.
+ // Result : we have browsers that :
+ // * know the BlobBuilder (but with prefix)
+ // * know the Blob constructor
+ // * know about Blob but not about how to build them
+ // About the "=== 0" test : if given the wrong type, it may be converted to a string.
+ // Instead of an empty content, we will get "[object Uint8Array]" for example.
+ if (typeof ArrayBuffer === "undefined") {
+ return false;
+ }
+ var buffer = new ArrayBuffer(0);
+ try {
+ return new Blob([buffer], { type: "application/zip" }).size === 0;
+ }
+ catch(e) {}
+
+ try {
+ var builder = new (window.BlobBuilder || window.WebKitBlobBuilder ||
+ window.MozBlobBuilder || window.MSBlobBuilder)();
+ builder.append(buffer);
+ return builder.getBlob('application/zip').size === 0;
+ }
+ catch(e) {}
+
+ return false;
+ })()
+};
JSZip.prototype = (function () {
+ var textEncoder, textDecoder;
+ if (
+ JSZip.support.uint8array &&
+ typeof TextEncoder === "function" &&
+ typeof TextDecoder === "function"
+ ) {
+ textEncoder = new TextEncoder("utf-8");
+ textDecoder = new TextDecoder("utf-8");
+ }
/**
* Returns the raw data of a ZipObject, decompress the content if necessary.
@@ -97,8 +151,8 @@ JSZip.prototype = (function () {
if (!file.options.binary) {
// unicode text !
// unicode string => binary string is a painful process, check if we can avoid it.
- if (JSZip.support.uint8array && typeof TextEncoder === "function") {
- return TextEncoder("utf-8").encode(result);
+ if (textEncoder) {
+ return textEncoder.encode(result);
}
if (JSZip.support.nodebuffer) {
return new Buffer(result, "utf-8");
@@ -557,7 +611,7 @@ JSZip.prototype = (function () {
*/
file : function(name, data, o) {
if (arguments.length === 1) {
- if (name instanceof RegExp) {
+ if (JSZip.utils.isRegExp(name)) {
var regexp = name;
return this.filter(function(relativePath, file) {
return !file.options.dir && regexp.test(relativePath);
@@ -584,7 +638,7 @@ JSZip.prototype = (function () {
return this;
}
- if (arg instanceof RegExp) {
+ if (JSZip.utils.isRegExp(arg)) {
return this.filter(function(relativePath, file) {
return file.options.dir && arg.test(relativePath);
});
@@ -854,8 +908,8 @@ JSZip.prototype = (function () {
// TextEncoder + Uint8Array to binary string is faster than checking every bytes on long strings.
// http://jsperf.com/utf8encode-vs-textencoder
// On short strings (file names for example), the TextEncoder API is (currently) slower.
- if (JSZip.support.uint8array && typeof TextEncoder === "function") {
- var u8 = TextEncoder("utf-8").encode(string);
+ if (textEncoder) {
+ var u8 = textEncoder.encode(string);
return JSZip.utils.transformTo("string", u8);
}
if (JSZip.support.nodebuffer) {
@@ -898,8 +952,8 @@ JSZip.prototype = (function () {
// check if we can use the TextDecoder API
// see http://encoding.spec.whatwg.org/#api
- if (JSZip.support.uint8array && typeof TextDecoder === "function") {
- return TextDecoder("utf-8").decode(
+ if (textDecoder) {
+ return textDecoder.decode(
JSZip.utils.transformTo("uint8array", input)
);
}
@@ -960,52 +1014,6 @@ JSZip.compressions = {
}
};
-/*
- * List features that require a modern browser, and if the current browser support them.
- */
-JSZip.support = {
- // contains true if JSZip can read/generate ArrayBuffer, false otherwise.
- arraybuffer : (function(){
- return typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
- })(),
- // contains true if JSZip can read/generate nodejs Buffer, false otherwise.
- nodebuffer : (function(){
- return typeof Buffer !== "undefined";
- })(),
- // contains true if JSZip can read/generate Uint8Array, false otherwise.
- uint8array : (function(){
- return typeof Uint8Array !== "undefined";
- })(),
- // contains true if JSZip can read/generate Blob, false otherwise.
- blob : (function(){
- // the spec started with BlobBuilder then replaced it with a construtor for Blob.
- // Result : we have browsers that :
- // * know the BlobBuilder (but with prefix)
- // * know the Blob constructor
- // * know about Blob but not about how to build them
- // About the "=== 0" test : if given the wrong type, it may be converted to a string.
- // Instead of an empty content, we will get "[object Uint8Array]" for example.
- if (typeof ArrayBuffer === "undefined") {
- return false;
- }
- var buffer = new ArrayBuffer(0);
- try {
- return new Blob([buffer], { type: "application/zip" }).size === 0;
- }
- catch(e) {}
-
- try {
- var builder = new (window.BlobBuilder || window.WebKitBlobBuilder ||
- window.MozBlobBuilder || window.MSBlobBuilder)();
- builder.append(buffer);
- return builder.getBlob('application/zip').size === 0;
- }
- catch(e) {}
-
- return false;
- })()
-};
-
(function () {
JSZip.utils = {
/**
@@ -1120,12 +1128,36 @@ JSZip.support = {
var chunk = 65536;
var result = [], len = array.length, type = JSZip.utils.getTypeOf(array), k = 0;
+ var canUseApply = true;
+ try {
+ switch(type) {
+ case "uint8array":
+ String.fromCharCode.apply(null, new Uint8Array(0));
+ break;
+ case "nodebuffer":
+ String.fromCharCode.apply(null, new Buffer(0));
+ break;
+ }
+ } catch(e) {
+ canUseApply = false;
+ }
+
+ // no apply : slow and painful algorithm
+ // default browser on android 4.*
+ if (!canUseApply) {
+ var resultStr = "";
+ for(var i = 0; i < array.length;i++) {
+ resultStr += String.fromCharCode(array[i]);
+ }
+ return resultStr;
+ }
+
while (k < len && chunk > 1) {
try {
if (type === "array" || type === "nodebuffer") {
- result.push(String.fromCharCode.apply(null, array.slice(k, Math.max(k + chunk, len))));
+ result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));
} else {
- result.push(String.fromCharCode.apply(null, array.subarray(k, k + chunk)));
+ result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));
}
k += chunk;
} catch (e) {
@@ -1263,7 +1295,7 @@ JSZip.support = {
if (typeof input === "string") {
return "string";
}
- if (input instanceof Array) {
+ if (Object.prototype.toString.call(input) === "[object Array]") {
return "array";
}
if (JSZip.support.nodebuffer && Buffer.isBuffer(input)) {
@@ -1277,6 +1309,16 @@ JSZip.support = {
}
};
+ /**
+ * Cross-window, cross-Node-context regular expression detection
+ * @param {Object} object Anything
+ * @return {Boolean} true if the object is a regular expression,
+ * false otherwise
+ */
+ JSZip.utils.isRegExp = function (object) {
+ return Object.prototype.toString.call(object) === "[object RegExp]";
+ };
+
/**
* Throw an exception if the type is not supported.
* @param {String} type the type to check.
diff --git a/docs-assets/js/respond.min.js b/docs-assets/js/respond.min.js
deleted file mode 100644
index e3dc2c0d60..0000000000
--- a/docs-assets/js/respond.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/*! 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 */
-window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
-
-/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
-(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();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))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this);
diff --git a/examples/carousel/index.html b/examples/carousel/index.html
index 7142317128..84c7aa5e68 100644
--- a/examples/carousel/index.html
+++ b/examples/carousel/index.html
@@ -16,7 +16,7 @@
diff --git a/examples/grid/index.html b/examples/grid/index.html
index 419ea02d86..3d34e75ed3 100644
--- a/examples/grid/index.html
+++ b/examples/grid/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/jumbotron-narrow/index.html b/examples/jumbotron-narrow/index.html
index 6c6c10344d..07764ed57d 100644
--- a/examples/jumbotron-narrow/index.html
+++ b/examples/jumbotron-narrow/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/jumbotron/index.html b/examples/jumbotron/index.html
index ea1c76a616..f4a0a667cb 100644
--- a/examples/jumbotron/index.html
+++ b/examples/jumbotron/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/justified-nav/index.html b/examples/justified-nav/index.html
index ac5bb31124..dce853a0d1 100644
--- a/examples/justified-nav/index.html
+++ b/examples/justified-nav/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/navbar-fixed-top/index.html b/examples/navbar-fixed-top/index.html
index 56496db5be..a79bcee9e4 100644
--- a/examples/navbar-fixed-top/index.html
+++ b/examples/navbar-fixed-top/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/navbar-static-top/index.html b/examples/navbar-static-top/index.html
index 864f48e57b..162214897c 100644
--- a/examples/navbar-static-top/index.html
+++ b/examples/navbar-static-top/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/navbar/index.html b/examples/navbar/index.html
index 78ca192152..c3df945a29 100644
--- a/examples/navbar/index.html
+++ b/examples/navbar/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/non-responsive/index.html b/examples/non-responsive/index.html
index 6db2d0bb51..f096462438 100644
--- a/examples/non-responsive/index.html
+++ b/examples/non-responsive/index.html
@@ -21,7 +21,7 @@
diff --git a/examples/offcanvas/index.html b/examples/offcanvas/index.html
index 62ac8ef2b5..b077bf168b 100644
--- a/examples/offcanvas/index.html
+++ b/examples/offcanvas/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/signin/index.html b/examples/signin/index.html
index 46ba71c7ab..9f0631e9f9 100644
--- a/examples/signin/index.html
+++ b/examples/signin/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/starter-template/index.html b/examples/starter-template/index.html
index e6527ccbca..5fd1d0052b 100644
--- a/examples/starter-template/index.html
+++ b/examples/starter-template/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/sticky-footer-navbar/index.html b/examples/sticky-footer-navbar/index.html
index 12a4fb1a24..69fad06044 100644
--- a/examples/sticky-footer-navbar/index.html
+++ b/examples/sticky-footer-navbar/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/sticky-footer/index.html b/examples/sticky-footer/index.html
index c8da90cc9c..ab462cece1 100644
--- a/examples/sticky-footer/index.html
+++ b/examples/sticky-footer/index.html
@@ -19,7 +19,7 @@
diff --git a/examples/theme/index.html b/examples/theme/index.html
index 7cd41b6921..b036cb7518 100644
--- a/examples/theme/index.html
+++ b/examples/theme/index.html
@@ -21,7 +21,7 @@
diff --git a/getting-started.html b/getting-started.html
index b610d09e06..c088a2b2c5 100644
--- a/getting-started.html
+++ b/getting-started.html
@@ -110,10 +110,11 @@ bootstrap/
-
+
+
@@ -702,7 +703,15 @@ bootstrap/
Unofficially, Bootstrap should look and behave well enough in Chromium and Chrome for Linux, Firefox for Linux, and Internet Explorer 7, though they are not officially supported.
Internet Explorer 8 and 9
-
Internet Explorer 8 and 9 are also supported, however, please be aware that some CSS3 properties and HTML5 elements are not fully supported by these browsers. In addition, Internet Explorer 8 requires the use of respond.js to enable media query support.
+
Internet Explorer 8 and 9 are also supported, however, please be aware that some CSS3 properties and HTML5 elements are not fully supported by these browsers. In addition, Internet Explorer 8 requires the use of Respond.js to enable media query support.
+
+
Respond.js and cross-domain CSS
+
Using Respond.js with CSS hosted on a different (sub)domain (for example, on a CDN) requires some additional setup. See the Respond.js docs for details.
+
+
+
Respond.js and file://
+
Due to browser security rules, Respond.js doesn't work with pages viewed via the file:// protocol (like when opening a local HTML file). To test responsive features in IE8, view your pages over HTTP(S). See the Respond.js docs for details.