[Pkg-javascript-commits] [pdf.js] 02/204: Disable the developer hash parameters by default in PRODUCTION builds of PDF.js

David Prévot taffit at moszumanska.debian.org
Sat Oct 25 18:50:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 3ead6e6a941b87e5e8bcd6f59284a6d7d884b0ad
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Mon Jun 16 22:18:12 2014 +0200

    Disable the developer hash parameters by default in PRODUCTION builds of PDF.js
---
 web/viewer.js | 143 ++++++++++++++++++++++++++++------------------------------
 1 file changed, 69 insertions(+), 74 deletions(-)

diff --git a/web/viewer.js b/web/viewer.js
index 5006fca..b2e8264 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -1732,60 +1732,81 @@ function webViewerInitialized() {
 //document.getElementById('secondaryOpenFile').setAttribute('hidden', 'true');
 //#endif
 
-  // Special debugging flags in the hash section of the URL.
-  var hash = document.location.hash.substring(1);
-  var hashParams = PDFView.parseQueryString(hash);
-
-  if ('disableWorker' in hashParams) {
-    PDFJS.disableWorker = (hashParams['disableWorker'] === 'true');
-  }
-
-  if ('disableRange' in hashParams) {
-    PDFJS.disableRange = (hashParams['disableRange'] === 'true');
-  }
-
-  if ('disableAutoFetch' in hashParams) {
-    PDFJS.disableAutoFetch = (hashParams['disableAutoFetch'] === 'true');
-  }
-
-  if ('disableFontFace' in hashParams) {
-    PDFJS.disableFontFace = (hashParams['disableFontFace'] === 'true');
-  }
-
-  if ('disableHistory' in hashParams) {
-    PDFJS.disableHistory = (hashParams['disableHistory'] === 'true');
-  }
-
-  if ('webgl' in hashParams) {
-    PDFJS.disableWebGL = (hashParams['webgl'] !== 'true');
-  }
-
-  if ('useOnlyCssZoom' in hashParams) {
-    PDFJS.useOnlyCssZoom = (hashParams['useOnlyCssZoom'] === 'true');
-  }
-
-  if ('verbosity' in hashParams) {
-    PDFJS.verbosity = hashParams['verbosity'] | 0;
-  }
-
-  if ('ignoreCurrentPositionOnZoom' in hashParams) {
-    IGNORE_CURRENT_POSITION_ON_ZOOM =
-      (hashParams['ignoreCurrentPositionOnZoom'] === 'true');
-  }
+//#if !(FIREFOX || MOZCENTRAL)
+  var locale = PDFJS.locale || navigator.language;
+//#endif
 
 //#if !PRODUCTION
-  if ('disableBcmaps' in hashParams && hashParams['disableBcmaps']) {
-    PDFJS.cMapUrl = '../external/cmaps/';
-    PDFJS.cMapPacked = false;
-  }
+  if (true) {
+//#else
+//if (PDFView.preferencesPdfBugEnabled) {
 //#endif
+    // Special debugging flags in the hash section of the URL.
+    var hash = document.location.hash.substring(1);
+    var hashParams = PDFView.parseQueryString(hash);
 
-
+    if ('disableWorker' in hashParams) {
+      PDFJS.disableWorker = (hashParams['disableWorker'] === 'true');
+    }
+    if ('disableRange' in hashParams) {
+      PDFJS.disableRange = (hashParams['disableRange'] === 'true');
+    }
+    if ('disableAutoFetch' in hashParams) {
+      PDFJS.disableAutoFetch = (hashParams['disableAutoFetch'] === 'true');
+    }
+    if ('disableFontFace' in hashParams) {
+      PDFJS.disableFontFace = (hashParams['disableFontFace'] === 'true');
+    }
+    if ('disableHistory' in hashParams) {
+      PDFJS.disableHistory = (hashParams['disableHistory'] === 'true');
+    }
+    if ('webgl' in hashParams) {
+      PDFJS.disableWebGL = (hashParams['webgl'] !== 'true');
+    }
+    if ('useOnlyCssZoom' in hashParams) {
+      PDFJS.useOnlyCssZoom = (hashParams['useOnlyCssZoom'] === 'true');
+    }
+    if ('verbosity' in hashParams) {
+      PDFJS.verbosity = hashParams['verbosity'] | 0;
+    }
+    if ('ignoreCurrentPositionOnZoom' in hashParams) {
+      IGNORE_CURRENT_POSITION_ON_ZOOM =
+        (hashParams['ignoreCurrentPositionOnZoom'] === 'true');
+    }
+//#if !PRODUCTION
+    if ('disableBcmaps' in hashParams && hashParams['disableBcmaps']) {
+      PDFJS.cMapUrl = '../external/cmaps/';
+      PDFJS.cMapPacked = false;
+    }
+//#endif
 //#if !(FIREFOX || MOZCENTRAL)
-  var locale = PDFJS.locale || navigator.language;
-  if ('locale' in hashParams) {
-    locale = hashParams['locale'];
+    if ('locale' in hashParams) {
+      locale = hashParams['locale'];
+    }
+//#endif
+    if ('textLayer' in hashParams) {
+      switch (hashParams['textLayer']) {
+        case 'off':
+          PDFJS.disableTextLayer = true;
+          break;
+        case 'visible':
+        case 'shadow':
+        case 'hover':
+          var viewer = document.getElementById('viewer');
+          viewer.classList.add('textLayer-' + hashParams['textLayer']);
+          break;
+      }
+    }
+    if ('pdfBug' in hashParams) {
+      PDFJS.pdfBug = true;
+      var pdfBug = hashParams['pdfBug'];
+      var enabled = pdfBug.split(',');
+      PDFBug.enable(enabled);
+      PDFBug.init();
+    }
   }
+
+//#if !(FIREFOX || MOZCENTRAL)
   mozL10n.setLanguage(locale);
 //#endif
 //#if (FIREFOX || MOZCENTRAL)
@@ -1796,32 +1817,6 @@ function webViewerInitialized() {
 //}
 //#endif
 
-  if ('textLayer' in hashParams) {
-    switch (hashParams['textLayer']) {
-      case 'off':
-        PDFJS.disableTextLayer = true;
-        break;
-      case 'visible':
-      case 'shadow':
-      case 'hover':
-        var viewer = document.getElementById('viewer');
-        viewer.classList.add('textLayer-' + hashParams['textLayer']);
-        break;
-    }
-  }
-
-//#if !(FIREFOX || MOZCENTRAL)
-  if ('pdfBug' in hashParams) {
-//#else
-//if ('pdfBug' in hashParams && PDFView.preferencesPdfBugEnabled) {
-//#endif
-    PDFJS.pdfBug = true;
-    var pdfBug = hashParams['pdfBug'];
-    var enabled = pdfBug.split(',');
-    PDFBug.enable(enabled);
-    PDFBug.init();
-  }
-
   if (!PDFView.supportsPrinting) {
     document.getElementById('print').classList.add('hidden');
     document.getElementById('secondaryPrint').classList.add('hidden');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list