diff --git a/attachment_preview/static/lib/ViewerJS/compatibility.js b/attachment_preview/static/lib/ViewerJS/compatibility.js
index 967e312a..06f54bff 100644
--- a/attachment_preview/static/lib/ViewerJS/compatibility.js
+++ b/attachment_preview/static/lib/ViewerJS/compatibility.js
@@ -447,20 +447,10 @@ if (typeof PDFJS === 'undefined') {
// Checks if navigator.language is supported
(function checkNavigatorLanguage() {
- if ('language' in navigator &&
- /^[a-z]+(-[A-Z]+)?$/.test(navigator.language)) {
+ if ('language' in navigator) {
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);
+ PDFJS.locale = navigator.userLanguage || 'en-US';
})();
(function checkRangeRequests() {
@@ -479,7 +469,10 @@ if (typeof PDFJS === 'undefined') {
var regex = /Android\s[0-2][^\d]/;
var isOldAndroid = regex.test(navigator.userAgent);
- if (isSafari || isOldAndroid) {
+ // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318
+ var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(navigator.userAgent);
+
+ if (isSafari || isOldAndroid || isChromeWithRangeBug) {
PDFJS.disableRange = true;
PDFJS.disableStream = true;
}
@@ -572,3 +565,13 @@ if (typeof PDFJS === 'undefined') {
PDFJS.maxCanvasPixels = 5242880;
}
})();
+
+// Disable fullscreen support for certain problematic configurations.
+// Support: IE11+ (when embedded).
+(function checkFullscreenSupport() {
+ var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 &&
+ window.parent !== window);
+ if (isEmbeddedIE) {
+ PDFJS.disableFullscreen = true;
+ }
+})();
diff --git a/attachment_preview/static/lib/ViewerJS/index.html b/attachment_preview/static/lib/ViewerJS/index.html
index c7496ceb..2eb1fd47 100644
--- a/attachment_preview/static/lib/ViewerJS/index.html
+++ b/attachment_preview/static/lib/ViewerJS/index.html
@@ -39,43 +39,41 @@ along with ViewerJS. If not, see
c?a[k++]=c:(2048>c?a[k++]=192|c>>>6:(65536>c?a[k++]=224|c>>>12:(a[k++]=
-240|c>>>18,a[k++]=128|c>>>12&63),a[k++]=128|c>>>6&63),a[k++]=128|c&63);return a};b.buf2binstring=function(d){return k(d,d.length)};b.binstring2buf=function(d){for(var a=new f.Buf8(d.length),c=0,b=a.length;cg)q[h++]=g;else if(f=d[g],4 b.length&&(b.head.comment+=String.fromCharCode(O));while(O&&D<
-p);b.flags&512&&(b.check=s(b.check,h,D,g));p-=D;g+=D;if(O)break a}else b.head&&(b.head.comment=null);b.mode=9;case 9:if(b.flags&512){for(;16>r;){if(0===p)break a;p--;n+=h[g++]<