window.$FlowPaper = window.getDocViewer = window["$FlowPaper"] = function (id) { var instance = (id === "undefined") ? "" : id; if (window['ViewerMode'] == 'flash') { return window["FlowPaperViewer_Instance" + instance].getApi(); } else if (window['ViewerMode'] == 'html') { return window["FlowPaperViewer_Instance" + instance]; } }; window.FlowPaperViewerEmbedding = window.$f = function (id, args) { this.id = id; var userAgent = navigator.userAgent.toLowerCase(); var browser = window["eb.browser"] = { version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], safari: (/webkit/.test(userAgent) || /applewebkit/.test(userAgent)) && !(/chrome/.test(userAgent)), opera: /opera/.test(userAgent), msie: /msie/.test(userAgent) && !/opera/.test(userAgent), mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent), seamonkey: /seamonkey/.test(userAgent), chrome: /chrome/.test(userAgent) }; browser.detected = browser.safari || browser.opera || browser.msie || browser.mozilla || browser.seamonkey || browser.chrome; if (!browser.detected || !browser.version) { browser.chrome = true; browser.version = "500.00"; } var platform = window["eb.platform"] = { win: /win/.test(userAgent), mac: /mac/.test(userAgent), touchdevice: (function () { try { return 'ontouchstart' in document.documentElement; } catch (e) { return false; } })(), android: (userAgent.indexOf("android") > -1), ios: ((userAgent.match(/iphone/i)) || (userAgent.match(/ipod/i)) || (userAgent.match(/ipad/i))), iphone: (userAgent.match(/iphone/i)) || (userAgent.match(/ipod/i)), ipad: (userAgent.match(/ipad/i)), winphone: userAgent.match(/Windows Phone/i), blackberry: userAgent.match(/BlackBerry/i) || userAgent.match(/BB10/i), webos: userAgent.match(/webOS/i) }; platform.touchonlydevice = platform.touchdevice && (platform.android || platform.ios || platform.winphone || platform.blackberry || platform.webos); var config = args.config; var _SWFFile, _PDFFile, _IMGFiles, _SVGFiles, _IMGFiles_thumbs = "", _IMGFiles_highres = "", _JSONFile = "", _jsDirectory = "", _cssDirectory = "", _localeDirectory = ""; _WMode = (config.WMode != null || config.wmode != null ? config.wmode || config.WMode : "direct"); var _uDoc = ((config.DOC != null) ? unescape(config.DOC) : null); var instance = "FlowPaperViewer_Instance" + ((id === "undefined") ? "" : id); var _JSONDataType = (config.JSONDataType != null) ? config.JSONDataType : "json"; if (_uDoc != null) { _SWFFile = FLOWPAPER.translateUrlByFormat(_uDoc, "swf"); _PDFFile = FLOWPAPER.translateUrlByFormat(_uDoc, "pdf"); _JSONFile = FLOWPAPER.translateUrlByFormat(_uDoc, _JSONDataType); _IMGFiles = FLOWPAPER.translateUrlByFormat(_uDoc, "jpg"); _SVGFiles = FLOWPAPER.translateUrlByFormat(_uDoc, "svg"); _IMGFiles_thumbs = FLOWPAPER.translateUrlByFormat(_uDoc, "jpg"); _IMGFiles_highres = FLOWPAPER.translateUrlByFormat(_uDoc, "jpgpageslice"); } _SWFFile = (config.SwfFile != null ? config.SwfFile : _SWFFile); _SWFFile = (config.SWFFile != null ? config.SWFFile : _SWFFile); _PDFFile = (config.PDFFile != null ? config.PDFFile : _PDFFile); _IMGFiles = (config.IMGFiles != null ? config.IMGFiles : _IMGFiles); _IMGFiles = (config.PageImagePattern != null ? config.PageImagePattern : _IMGFiles); _SVGFiles = (config.SVGFiles != null ? config.SVGFiles : _SVGFiles); _IMGFiles_thumbs = (config.ThumbIMGFiles != null ? config.ThumbIMGFiles : _IMGFiles_thumbs); _IMGFiles_highres = (config.HighResIMGFiles != null ? config.HighResIMGFiles : _IMGFiles_highres); _JSONFile = (config.JSONFile != null ? config.JSONFile : _JSONFile); _jsDirectory = (config.jsDirectory != null ? config.jsDirectory : FLOWPAPER.detectjsdir()); _cssDirectory = (config.cssDirectory != null ? config.cssDirectory : FLOWPAPER.detectcssdir()); _localeDirectory = (config.localeDirectory != null ? config.localeDirectory : "locale/"); if (_SWFFile != null && _SWFFile.indexOf("{") == 0 && _SWFFile.indexOf("[*,") > 0 && _SWFFile.indexOf("]") > 0) { _SWFFile = escape(_SWFFile); } if (FLOWPAPER.getLocationHashParameter) { var pageFromHash = FLOWPAPER.getLocationHashParameter('page'); if (pageFromHash != null) { config.StartAtPage = pageFromHash; } } if (FLOWPAPER.getLocationHashParameter) { var previewModeFromHash = FLOWPAPER.getLocationHashParameter('PreviewMode'); if (previewModeFromHash != null) { config.PreviewMode = previewModeFromHash; } } if (config.PreviewMode == "FrontPage" && ((_IMGFiles != null && _IMGFiles.length > 0) || (_IMGFiles_thumbs != null && _IMGFiles_thumbs.length > 0))) { FLOWPAPER.initFrontPagePreview(id, args, (_IMGFiles_thumbs != null && _IMGFiles_thumbs.length > 0) ? _IMGFiles_thumbs : _IMGFiles); return; } window[instance] = flashembed(id, { src: _jsDirectory + "../FlowPaperViewer.swf", version: [11, 0], expressInstall: "js/expressinstall.swf", wmode: _WMode }, { ElementId: id, SwfFile: _SWFFile, PdfFile: _PDFFile, IMGFiles: _IMGFiles, SVGFiles: _SVGFiles, JSONFile: _JSONFile, ThumbIMGFiles: _IMGFiles_thumbs, HighResIMGFiles: _IMGFiles_highres, useCustomJSONFormat: config.useCustomJSONFormat, JSONPageDataFormat: config.JSONPageDataFormat, JSONDataType: _JSONDataType, Scale: (config.Scale != null) ? config.Scale : 0.8, ZoomTransition: (config.ZoomTransition != null) ? config.ZoomTransition : 'easeOut', ZoomTime: (config.ZoomTime != null) ? config.ZoomTime : 0.5, ZoomInterval: (config.ZoomInterval) ? config.ZoomInterval : 0.1, FitPageOnLoad: (config.FitPageOnLoad != null) ? config.FitPageOnLoad : false, FitWidthOnLoad: (config.FitWidthOnLoad != null) ? config.FitWidthOnLoad : false, FullScreenAsMaxWindow: (config.FullScreenAsMaxWindow != null) ? config.FullScreenAsMaxWindow : false, ProgressiveLoading: (config.ProgressiveLoading != null) ? config.ProgressiveLoading : false, MinZoomSize: (config.MinZoomSize != null) ? config.MinZoomSize : 0.2, MaxZoomSize: (config.MaxZoomSize != null) ? config.MaxZoomSize : 5, SearchMatchAll: (config.SearchMatchAll != null) ? config.SearchMatchAll : false, SearchServiceUrl: config.SearchServiceUrl, InitViewMode: config.InitViewMode, DisableOverflow: config.DisableOverflow, DisplayRange: config.DisplayRange, TouchInitViewMode: config.TouchInitViewMode, PreviewMode: config.PreviewMode, PublicationTitle: config.PublicationTitle, LoaderImage: config.LoaderImage, MixedMode: config.MixedMode, EnableWebGL: config.EnableWebGL, AutoDetectLinks: config.AutoDetectLinks, ImprovedAccessibility: config.ImprovedAccessibility, BitmapBasedRendering: (config.BitmapBasedRendering != null) ? config.BitmapBasedRendering : false, StartAtPage: (config.StartAtPage != null && config.StartAtPage.toString().length > 0 && !isNaN(config.StartAtPage)) ? config.StartAtPage : 1, PrintPaperAsBitmap: (config.PrintPaperAsBitmap != null) ? config.PrintPaperAsBitmap : ((browser.safari || browser.mozilla) ? true : false), PrintFn: config.PrintFn, AutoAdjustPrintSize: (config.AutoAdjustPrintSize != null) ? config.AutoAdjustPrintSize : true, EnableSearchAbstracts: ((config.EnableSearchAbstracts != null) ? config.EnableSearchAbstracts : true), EnableCornerDragging: ((config.EnableCornerDragging != null) ? config.EnableCornerDragging : true), BackgroundColor: config.BackgroundColor, PanelColor: config.PanelColor, BackgroundAlpha: config.BackgroundAlpha, UIConfig: config.UIConfig, PageIndexAdjustment: config.PageIndexAdjustment, SharingUrl: config.SharingUrl, BrandingLogo: config.BrandingLogo, BrandingUrl: config.BrandingUrl, ViewModeToolsVisible: ((config.ViewModeToolsVisible != null) ? config.ViewModeToolsVisible : true), ZoomToolsVisible: ((config.ZoomToolsVisible != null) ? config.ZoomToolsVisible : true), NavToolsVisible: ((config.NavToolsVisible != null) ? config.NavToolsVisible : true), CursorToolsVisible: ((config.CursorToolsVisible != null) ? config.CursorToolsVisible : true), SearchToolsVisible: ((config.SearchToolsVisible != null) ? config.SearchToolsVisible : true), AnnotationToolsVisible: ((config.AnnotationToolsVisible != null) ? config.AnnotationToolsVisible : true), StickyTools: config.StickyTools, UserCollaboration: config.UserCollaboration, CurrentUser: config.CurrentUser, Toolbar: config.Toolbar, BottomToolbar: config.BottomToolbar, DocSizeQueryService: config.DocSizeQueryService, RenderingOrder: config.RenderingOrder, TrackingNumber: config.TrackingNumber, localeChain: (config.localeChain != null) ? config.localeChain : "en_US", jsDirectory: _jsDirectory, cssDirectory: _cssDirectory, localeDirectory: _localeDirectory, signature: config.signature, key: config.key }); if (config.TrackingNumber && config.TrackingNumber.length > 0) { var _trackSWFFile = _SWFFile; if (_trackSWFFile) { _trackSWFFile = (_trackSWFFile.indexOf("/") > 0 ? _trackSWFFile.substr(_trackSWFFile.lastIndexOf("/") + 1) : _trackSWFFile); _trackSWFFile = _trackSWFFile.replace("_[*,0]", ""); _trackSWFFile = _trackSWFFile.replace(".swf", ".pdf"); _trackSWFFile = (_trackSWFFile.indexOf("}") > 0 ? _trackSWFFile.substr(0, _trackSWFFile.lastIndexOf(",")) : _trackSWFFile); } var _trackPDFFile = _PDFFile; if (_trackPDFFile) { _trackPDFFile = (_trackPDFFile.indexOf("/") > 0 ? _trackPDFFile.substr(_trackPDFFile.lastIndexOf("/") + 1) : _trackPDFFile); _trackPDFFile = _trackPDFFile.replace("_[*,0]", "").replace("_[*,2]", ""); } var _trackJSONFile = _JSONFile; if (_JSONFile) { _trackJSONFile = (_trackJSONFile.indexOf("/") > 0 ? _trackJSONFile.substr(_trackJSONFile.lastIndexOf("/") + 1) : _trackJSONFile); _trackJSONFile = _trackJSONFile.replace("{page}", ""); _trackJSONFile = _trackJSONFile.replace(".js", ".pdf"); } jQuery('#' + id).data('TrackingDocument', (_trackPDFFile || _trackSWFFile || _trackJSONFile)); jQuery('#' + id).data('TrackingNumber', config.TrackingNumber); } }; (function () { if (!window.FLOWPAPER) { window.FLOWPAPER = {}; } FLOWPAPER.detectjsdir = function () { if (jQuery('script[src$="flowpaper.js"]').length > 0) { return jQuery('script[src$="flowpaper.js"]').attr('src').replace('flowpaper.js', ''); } else { return "js/" } }; FLOWPAPER.detectcssdir = function () { if (jQuery('link[href$="flowpaper.css"]').length > 0) { return jQuery('link[href$="flowpaper.css"]').attr('href').replace('flowpaper.css', ''); } else { return "css/" } }; FLOWPAPER.getLocationHashParameter = function (param) { var hash = location.hash.substr(1); if (hash.indexOf(param + '=') >= 0) { var value = hash.substr(hash.indexOf(param + '=')).split('&')[0].split('=')[1]; return value; } return null; }; FLOWPAPER.translateUrlByFormat = function (url, format) { if (url.indexOf("{") == 0 && format != "swf") { url = url.substring(1, url.lastIndexOf(",")); if (format != "pdf") { url = url.replace("[*,0]", "{page}") url = url.replace("[*,2]", "{page}") } } else if (format == "swf" && url.indexOf("{") != 0) { url = url.replace("{page}", ""); url = url.replace(/&/g, '%26'); url = url.replace(/ /g, '%20'); } if (format == "jpgpageslice") { url = url + "§or={sector}"; } url = (url != null && url.indexOf('{format}') > 0 ? url.replace("{format}", format) : null); return url; }; FLOWPAPER.translateUrlByDocument = function (url, document) { return (url != null && url.indexOf('{doc}') > 0 ? url.replace("{doc}", document) : null); }; FLOWPAPER.animateDenyEffect = function (obj, margin, time, cycles, dir) { window.setTimeout(function () { var speed = time / ((2 * cycles) + 1); var margRat = 1 + (60 / (cycles * cycles)); $(obj).stop(true, true); for (var i = 0; i <= cycles; i++) { for (var j = -1; j <= 1; j += 2) $(obj).animate({ marginLeft: (i != cycles) * j * margin }, { duration: speed, queue: true }); margin /= margRat; } }, 500); }; FLOWPAPER.initFrontPagePreview = function initFrontPagePreview(viewerid, args, IMGFiles) { var animate = true; jQuery(document.body).css('background-color', jQuery('#' + viewerid).css('background-color')); var img = new Image(); jQuery(img).bind('load', function () { jQuery(document.body).append("
Click on the icon below to download the latest version of Adobe Flash" + "
"; if (root.tagName == 'A') { root.onclick = function () { location.href = URL; }; }
}
if (opts.onFail) { var ret = opts.onFail.call(this); if (typeof ret == 'string') { root.innerHTML = ret; } }
}
}
jQuery(window).bind('hashchange', (function () { var page = FLOWPAPER.getLocationHashParameter('page'); if (page) { $FlowPaper(viewerId).gotoPage(page); } })); if (IE) { window[opts.id] = document.getElementById(opts.id); }
extend(this, { getRoot: function () { return root; }, getOptions: function () { return opts; }, getConf: function () { return conf; }, getApi: function () { return root.firstChild; } });
}
if (JQUERY) { jQuery.fn.flashembed = function (opts, conf) { return this.each(function () { jQuery(this).data("flashembed", flashembed(this, opts, conf)); }); }; jQuery.fn.FlowPaperViewer = function (args) { jQuery('#' + this.attr('id')).empty(); var embed = new FlowPaperViewerEmbedding(this.attr('id'), args); this.element = jQuery('#' + embed.id); return this.element; }; } else { throw new Error("jQuery missing!"); }
})(); function getIEversion() {
var rv = -1; if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(ua) != null)
rv = parseFloat(RegExp.$1);
}
return rv;
}
if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; }
window.unsupportedPDFJSieversion = getIEversion() > 0 && getIEversion() < 9; (function checkTypedArrayCompatibility() {
if (typeof Uint8Array !== 'undefined') {
if (typeof Uint8Array.prototype.subarray === 'undefined') { Uint8Array.prototype.subarray = function subarray(start, end) { return new Uint8Array(this.slice(start, end)); }; Float32Array.prototype.subarray = function subarray(start, end) { return new Float32Array(this.slice(start, end)); }; }
if (typeof Float64Array === 'undefined') { window.Float64Array = Float32Array; }
return;
}
function subarray(start, end) { return new TypedArray(this.slice(start, end)); }
function setArrayOffset(array, offset) {
if (arguments.length < 2) { offset = 0; }
for (var i = 0, n = array.length; i < n; ++i, ++offset) { this[offset] = array[i] & 0xFF; }
}
function TypedArray(arg1) {
var result, i, n; if (typeof arg1 === 'number') { result = []; for (i = 0; i < arg1; ++i) { result[i] = 0; } } else if ('slice' in arg1) { result = arg1.slice(0); } else { result = []; for (i = 0, n = arg1.length; i < n; ++i) { result[i] = arg1[i]; } }
result.subarray = subarray; result.buffer = result; result.byteLength = result.length; result.set = setArrayOffset; if (typeof arg1 === 'object' && arg1.buffer) { result.buffer = arg1.buffer; }
return result;
}
window.Uint8Array = TypedArray; window.Int8Array = TypedArray; window.Uint32Array = TypedArray; window.Int32Array = TypedArray; window.Uint16Array = TypedArray; window.Float32Array = TypedArray; window.Float64Array = TypedArray;
})(); (function normalizeURLObject() { if (!window.URL) { window.URL = window.webkitURL; } })(); (function checkObjectDefinePropertyCompatibility() {
if (window.unsupportedPDFJSieversion) { return; }
if (typeof Object.defineProperty !== 'undefined') {
var definePropertyPossible = true; try { Object.defineProperty(new Image(), 'id', { value: 'test' }); eval("var Test = function Test() {};Test.prototype = { get id() { } };Object.defineProperty(new Test(), 'id',{ value: '', configurable: true, enumerable: true, writable: false });"); } catch (e) { definePropertyPossible = false; }
if (definePropertyPossible) { return; }
}
Object.defineProperty = function objectDefineProperty(obj, name, def) {
delete obj[name]; if ('get' in def) { obj.__defineGetter__(name, def['get']); }
if ('set' in def) { obj.__defineSetter__(name, def['set']); }
if ('value' in def) { obj.__defineSetter__(name, function objectDefinePropertySetter(value) { this.__defineGetter__(name, function objectDefinePropertyGetter() { return value; }); return value; }); obj[name] = def.value; }
};
})(); (function checkXMLHttpRequestResponseCompatibility() {
if (window.unsupportedPDFJSieversion) { return; }
var xhrPrototype = XMLHttpRequest.prototype; var xhr = new XMLHttpRequest(); if (!('overrideMimeType' in xhr)) { Object.defineProperty(xhrPrototype, 'overrideMimeType', { value: function xmlHttpRequestOverrideMimeType(mimeType) { } }); }
if ('responseType' in xhr) { return; }
PDFJS.disableWorker = true; Object.defineProperty(xhrPrototype, 'responseType', { get: function xmlHttpRequestGetResponseType() { return this._responseType || 'text'; }, set: function xmlHttpRequestSetResponseType(value) { if (value === 'text' || value === 'arraybuffer') { this._responseType = value; if (value === 'arraybuffer' && typeof this.overrideMimeType === 'function') { this.overrideMimeType('text/plain; charset=x-user-defined'); } } } }); if (typeof VBArray !== 'undefined') { Object.defineProperty(xhrPrototype, 'response', { get: function xmlHttpRequestResponseGet() { if (this.responseType === 'arraybuffer') { return new Uint8Array(new VBArray(this.responseBody).toArray()); } else { return this.responseText; } } }); return; }
Object.defineProperty(xhrPrototype, 'response', {
get: function xmlHttpRequestResponseGet() {
if (this.responseType !== 'arraybuffer') { return this.responseText; }
var text = this.responseText; var i, n = text.length; var result = new Uint8Array(n); for (i = 0; i < n; ++i) { result[i] = text.charCodeAt(i) & 0xFF; }
return result.buffer;
}
});
})(); (function checkWindowBtoaCompatibility() {
if ('btoa' in window) { return; }
var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; window.btoa = function windowBtoa(chars) {
var buffer = ''; var i, n; for (i = 0, n = chars.length; i < n; i += 3) {
var b1 = chars.charCodeAt(i) & 0xFF; var b2 = chars.charCodeAt(i + 1) & 0xFF; var b3 = chars.charCodeAt(i + 2) & 0xFF; var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; var d4 = i + 2 < n ? (b3 & 0x3F) : 64; buffer += (digits.charAt(d1) + digits.charAt(d2) +
digits.charAt(d3) + digits.charAt(d4));
}
return buffer;
};
})(); (function checkWindowAtobCompatibility() {
if ('atob' in window) { return; }
var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; window.atob = function (input) {
input = input.replace(/=+$/, ''); if (input.length % 4 === 1) { throw new Error('bad atob input'); }
for (var bc = 0, bs, buffer, idx = 0, output = ''; buffer = input.charAt(idx++) ; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) { buffer = digits.indexOf(buffer); }
return output;
};
})(); (function checkFunctionPrototypeBindCompatibility() {
if (typeof Function.prototype.bind !== 'undefined') { return; }
Function.prototype.bind = function functionPrototypeBind(obj) { var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); var bound = function functionPrototypeBindBound() { var args = headArgs.concat(Array.prototype.slice.call(arguments)); return fn.apply(obj, args); }; return bound; };
})(); (function checkDatasetProperty() {
if (window.unsupportedPDFJSieversion) { return; }
var div = document.createElement('div'); if ('dataset' in div) { return; }
Object.defineProperty(HTMLElement.prototype, 'dataset', {
get: function () {
if (this._dataset) { return this._dataset; }
var dataset = {}; for (var j = 0, jj = this.attributes.length; j < jj; j++) {
var attribute = this.attributes[j]; if (attribute.name.substring(0, 5) !== 'data-') { continue; }
var key = attribute.name.substring(5).replace(/\-([a-z])/g, function (all, ch) { return ch.toUpperCase(); }); dataset[key] = attribute.value;
}
Object.defineProperty(this, '_dataset', { value: dataset, writable: false, enumerable: false }); return dataset;
}, enumerable: true
});
})(); (function checkClassListProperty() {
if (window.unsupportedPDFJSieversion) { return; }
var div = document.createElement('div'); if ('classList' in div) { return; }
function changeList(element, itemName, add, remove) {
var s = element.className || ''; var list = s.split(/\s+/g); if (list[0] === '') { list.shift(); }
var index = list.indexOf(itemName); if (index < 0 && add) { list.push(itemName); }
if (index >= 0 && remove) { list.splice(index, 1); }
element.className = list.join(' '); return (index >= 0);
}
var classListPrototype = { add: function (name) { changeList(this.element, name, true, false); }, contains: function (name) { return changeList(this.element, name, false, false); }, remove: function (name) { changeList(this.element, name, false, true); }, toggle: function (name) { changeList(this.element, name, true, true); } }; Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function () {
if (this._classList) { return this._classList; }
var classList = Object.create(classListPrototype, { element: { value: this, writable: false, enumerable: true } }); Object.defineProperty(this, '_classList', { value: classList, writable: false, enumerable: false }); return classList;
}, enumerable: true
});
})(); (function checkConsoleCompatibility() {
if (window.unsupportedPDFJSieversion) { return; }
if (!('console' in window)) { window.console = { log: function () { }, error: function () { }, warn: function () { } }; } else if (!('bind' in console.log)) { console.log = (function (fn) { return function (msg) { return fn(msg); }; })(console.log); console.error = (function (fn) { return function (msg) { return fn(msg); }; })(console.error); console.warn = (function (fn) { return function (msg) { return fn(msg); }; })(console.warn); }
})(); (function checkOnClickCompatibility() {
function ignoreIfTargetDisabled(event) { if (isDisabled(event.target)) { event.stopPropagation(); } }
function isDisabled(node) { return node.disabled || (node.parentNode && isDisabled(node.parentNode)); }
if (navigator.userAgent.indexOf('Opera') !== -1) { document.addEventListener('click', ignoreIfTargetDisabled, true); }
})(); (function checkOnBlobSupport() { if (navigator.userAgent.indexOf('Trident') >= 0) { PDFJS.disableCreateObjectURL = true; } })(); (function checkNavigatorLanguage() {
if ('language' in navigator && /^[a-z]+(-[A-Z]+)?$/.test(navigator.language)) { return; }
function formatLocale(locale) {
var split = locale.split(/[-_]/); split[0] = split[0].toLowerCase(); if (split.length > 1) { split[1] = split[1].toUpperCase(); }
return split.join('-');
}
var language = navigator.language || navigator.userLanguage || 'en-US'; PDFJS.locale = formatLocale(language);
})(); (function checkRangeRequests() { var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; var regex = /Android\s[0-2][^\d]/; var isOldAndroid = regex.test(navigator.userAgent); if (isSafari || isOldAndroid) { PDFJS.disableRange = true; PDFJS.disableStream = true; } })(); (function checkHistoryManipulation() { if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) { PDFJS.disableHistory = true; } })(); (function checkSetPresenceInImageData() {
if (window.CanvasPixelArray) { if (typeof window.CanvasPixelArray.prototype.set !== 'function') { window.CanvasPixelArray.prototype.set = function (arr) { for (var i = 0, ii = this.length; i < ii; i++) { this[i] = arr[i]; } }; } } else {
var polyfill = false, versionMatch; if (navigator.userAgent.indexOf('Chrom') >= 0) { versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); polyfill = versionMatch && parseInt(versionMatch[2]) < 21; } else if (navigator.userAgent.indexOf('Android') >= 0) { polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent); } else if (navigator.userAgent.indexOf('Safari') >= 0) { versionMatch = navigator.userAgent.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); polyfill = versionMatch && parseInt(versionMatch[1]) < 6; }
if (polyfill) { var contextPrototype = window.CanvasRenderingContext2D.prototype; contextPrototype._createImageData = contextPrototype.createImageData; contextPrototype.createImageData = function (w, h) { var imageData = this._createImageData(w, h); imageData.data.set = function (arr) { for (var i = 0, ii = this.length; i < ii; i++) { this[i] = arr[i]; } }; return imageData; }; }
}
})(); (function checkRequestAnimationFrame() {
function fakeRequestAnimationFrame(callback) { window.setTimeout(callback, 20); }
var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); if ('requestAnimationFrame' in window) { return; }
window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || fakeRequestAnimationFrame;
})(); (function checkCanvasSizeLimitation() { var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); var isAndroid = /Android/g.test(navigator.userAgent); if (isIOS || isAndroid) { PDFJS.maxCanvasPixels = 5242880; } })(); (function checkFullscreenSupport() { var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 && window.parent !== window); if (isEmbeddedIE) { PDFJS.disableFullscreen = true; } })();