From 0fab3c8a3a8b96c509ece5a65288ebad496c171d Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sat, 13 Jun 2015 14:19:02 +0200 Subject: [PATCH] Updated ViewerJS. Fixed build.xml --- build.xml | 3 +- external/ViewerJS/compatibility.js | 29 +- .../ViewerJS/images/toolbarButton-print.png | Bin 0 -> 257 bytes external/ViewerJS/index.html | 88 ++-- external/ViewerJS/pdf.js | 391 +++++++++++---- external/ViewerJS/pdf.worker.js | 447 ++++++++++++++---- external/ViewerJS/pdfjsversion.js | 2 +- external/ViewerJS/text_layer_builder.js | 90 ++-- external/ViewerJS/ui_utils.js | 99 ++-- external/ViewerJS/webodf.js | 24 +- 10 files changed, 833 insertions(+), 340 deletions(-) create mode 100644 external/ViewerJS/images/toolbarButton-print.png diff --git a/build.xml b/build.xml index 8395da1..f15f329 100755 --- a/build.xml +++ b/build.xml @@ -186,8 +186,7 @@ - - + diff --git a/external/ViewerJS/compatibility.js b/external/ViewerJS/compatibility.js index 967e312..06f54bf 100644 --- a/external/ViewerJS/compatibility.js +++ b/external/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/external/ViewerJS/images/toolbarButton-print.png b/external/ViewerJS/images/toolbarButton-print.png new file mode 100644 index 0000000000000000000000000000000000000000..51275e54bee695c76a455579262ad642efe7220c GIT binary patch literal 257 zcmV+c0sj7pP)f!}1hmw`k2Xb!g|HAo2t*7E*&>DgR^vZU zVV4ks^D731!9T-ielNTbGw_$axq|YpFKNTWBMo*4b40@@e=r<~g@MK&J_SO41MfMq z6K6!=^stS5fYisq7foRJTRX628(*Bq(yKr%dZE{WZ`;7vZJ2IZv$kcQLwS8}%Xy#f zfMcjMVUtA}0uh@ufx-#qxPlcm-vgSJD;yl)1oluX_K^Glse?0qV_8Mk00000NkvXX Hu0mjf@9=3h literal 0 HcmV?d00001 diff --git a/external/ViewerJS/index.html b/external/ViewerJS/index.html index d7ac9de..dc53a69 100644 --- a/external/ViewerJS/index.html +++ b/external/ViewerJS/index.html @@ -36,41 +36,48 @@ along with ViewerJS. If not, see . --> - @@ -78,15 +85,16 @@ c;a?(d.title||(d.title=a.replace(/^.*[\\\/]/,"")),d.documentUrl=a,b(a,function(b
-
+
+
-
-
+
+