@@ -13983,6 +13983,7 @@ function extend() {
13983
13983
},{}]},{},[1])(1)
13984
13984
});
13985
13985
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.manifold = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
13986
+ (function (global){
13986
13987
var Manifold;
13987
13988
(function (Manifold) {
13988
13989
var StringValue = (function () {
@@ -14039,34 +14040,36 @@ var Manifold;
14039
14040
Bootstrapper.prototype.bootstrap = function () {
14040
14041
var that = this;
14041
14042
return new Promise(function (resolve, reject) {
14042
- var msie = that._msieversion();
14043
- // if not a recent version of IE
14044
- if (msie > 0 && msie < 11) {
14045
- if (msie === 9) {
14046
- // CORS not available, use jsonp
14047
- var settings = {
14048
- url: that._options.iiifResourceUri,
14049
- type: 'GET',
14050
- dataType: 'jsonp',
14051
- jsonp: 'callback',
14052
- jsonpCallback: 'manifestCallback'
14053
- };
14054
- $.ajax(settings);
14055
- window.manifestCallback = function (json) {
14056
- that._loaded(that, JSON.stringify(json), resolve, reject);
14057
- };
14058
- }
14059
- else if (msie === 10) {
14060
- $.getJSON(that._options.iiifResourceUri, function (json) {
14061
- that._loaded(that, JSON.stringify(json), resolve, reject);
14062
- });
14063
- }
14064
- }
14065
- else {
14043
+ var msie = that._detectIE();
14044
+ if (msie === false) {
14066
14045
manifesto.loadManifest(that._options.iiifResourceUri).then(function (json) {
14067
14046
that._loaded(that, json, resolve, reject);
14068
14047
});
14069
14048
}
14049
+ else {
14050
+ // if not a recent version of IE
14051
+ if (msie > 0) {
14052
+ if (msie === 9) {
14053
+ // CORS not available, use jsonp
14054
+ var settings = {
14055
+ url: that._options.iiifResourceUri,
14056
+ type: 'GET',
14057
+ dataType: 'jsonp',
14058
+ jsonp: 'callback',
14059
+ jsonpCallback: 'manifestCallback'
14060
+ };
14061
+ $.ajax(settings);
14062
+ global.manifestCallback = function (json) {
14063
+ that._loaded(that, JSON.stringify(json), resolve, reject);
14064
+ };
14065
+ }
14066
+ else {
14067
+ $.getJSON(that._options.iiifResourceUri, function (json) {
14068
+ that._loaded(that, JSON.stringify(json), resolve, reject);
14069
+ });
14070
+ }
14071
+ }
14072
+ }
14070
14073
});
14071
14074
};
14072
14075
Bootstrapper.prototype._loaded = function (bootstrapper, json, resolve, reject) {
@@ -14115,15 +14118,35 @@ var Manifold;
14115
14118
resolve(helper);
14116
14119
}
14117
14120
};
14118
- Bootstrapper.prototype._msieversion = function () {
14121
+ Bootstrapper.prototype._detectIE = function () {
14119
14122
var ua = window.navigator.userAgent;
14120
- var msie = ua.indexOf("MSIE ");
14123
+ // Test values; Uncomment to check result …
14124
+ // IE 10
14125
+ // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
14126
+ // IE 11
14127
+ // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
14128
+ // Edge 12 (Spartan)
14129
+ // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';
14130
+ // Edge 13
14131
+ // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';
14132
+ var msie = ua.indexOf('MSIE ');
14121
14133
if (msie > 0) {
14122
- return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
14134
+ // IE 10 or older => return version number
14135
+ return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
14123
14136
}
14124
- else {
14125
- return 0;
14137
+ var trident = ua.indexOf('Trident/');
14138
+ if (trident > 0) {
14139
+ // IE 11 => return version number
14140
+ var rv = ua.indexOf('rv:');
14141
+ return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
14142
+ }
14143
+ var edge = ua.indexOf('Edge/');
14144
+ if (edge > 0) {
14145
+ // Edge (IE 12+) => return version number
14146
+ return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
14126
14147
}
14148
+ // other browser
14149
+ return false;
14127
14150
};
14128
14151
return Bootstrapper;
14129
14152
}());
@@ -15093,6 +15116,7 @@ var Manifold;
15093
15116
Manifold.UriLabeller = UriLabeller;
15094
15117
})(Manifold || (Manifold = {}));
15095
15118
15119
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15096
15120
},{}]},{},[1])(1)
15097
15121
});
15098
15122
(function(t,e,o){"use strict";function r(t,e,r,p){r=r||"width";var n,l,m,c=(e.match(s)||[])[2],f="px"===c?1:d[c+"toPx"],u=/r?em/i;if(f||u.test(c)&&!p)t=f?t:"rem"===c?i:"fontSize"===r?t.parentNode||t:t,f=f||parseFloat(a(t,"fontSize")),m=parseFloat(e)*f;else{n=t.style,l=n[r];try{n[r]=e}catch(x){return 0}m=n[r]?parseFloat(a(t,r)):0,n[r]=l!==o?l:null}return m}function a(t,e){var o,n,i,l,d,c=/^top|bottom/,f=["paddingTop","paddingBottom","borderTop","borderBottom"],u=4;if(o=m?m(t)[e]:(n=t.style["pixel"+e.charAt(0).toUpperCase()+e.slice(1)])?n+"px":"fontSize"===e?r(t,"1em","left",1)+"px":t.currentStyle[e],i=(o.match(s)||[])[2],"%"===i&&p)if(c.test(e)){for(l=(d=t.parentNode||t).offsetHeight;u--;)l-=parseFloat(a(d,f[u]));o=parseFloat(o)/100*l+"px"}else o=r(t,o);else("auto"===o||i&&"px"!==i)&&m?o=0:i&&"px"!==i&&!m&&(o=r(t,o)+"px");return o}var p,n=e.createElement("test"),i=e.documentElement,l=e.defaultView,m=l&&l.getComputedStyle,s=/^(-?[\d+\.\-]+)([a-z]+|%)$/i,d={},c=[1/25.4,1/2.54,1/72,1/6],f=["mm","cm","pt","pc","in","mozmm"],u=6;for(i.appendChild(n),m&&(n.style.marginTop="1%",p="1%"===m(n).marginTop);u--;)d[f[u]+"toPx"]=c[u]?c[u]*d.inToPx:r(n,"1"+f[u]);i.removeChild(n),n=o,t.Length={toPx:r}})(this,this.document);
0 commit comments