]> git.parisson.com Git - pdf.js.git/commitdiff
Change how the tools are enabled.
authorBrendan Dahl <brendan.dahl@gmail.com>
Wed, 15 Feb 2012 21:13:07 +0000 (13:13 -0800)
committerBrendan Dahl <brendan.dahl@gmail.com>
Wed, 15 Feb 2012 21:13:07 +0000 (13:13 -0800)
src/debugger.js
web/viewer.js

index c5fc02aca52621be5ac8cf481970e7826c5c8e54..372ebd68fa17934380f7d4ae5674fe900d2917bb 100644 (file)
@@ -374,8 +374,8 @@ var PDFBug = (function PDFBugClosure() {
           tool.init();
         else
           panel.textContent = tool.name + ' is disabled. To enable add ' +
-                              ' PDFBug_' + tool.id + '=true to the url query ' +
-                              'parameters and refresh.';
+                              ' "' + tool.id + '" to the pdfBug parameter ' +
+                              'and refresh (seperate multiple by commas).';
         buttons.push(panelButton);
       }
       this.selectPanel(0);
index 46665fd87f8d3d1cb64970f7ad8c01d4d94b1cf3..5381f69c1d89918ac541364f0c768f82184ff1d9 100644 (file)
@@ -1122,16 +1122,19 @@ window.addEventListener('load', function webViewerLoad(evt) {
   if ('disableTextLayer' in params)
     PDFJS.disableTextLayer = (params['disableTextLayer'] === 'true');
 
-  if ('PDFBug' in params)
-    PDFJS.pdfBug = (params['PDFBug'] === 'true');
-
-  if (PDFJS.pdfBug) {
+  if ('pdfBug' in params) {
+    PDFJS.pdfBug = true;
+    var pdfBug = params['pdfBug'];
+    var all = false, enabled = [];
+    if (pdfBug === 'all')
+      all = true;
+    else
+      enabled = pdfBug.split(',');
     var debugTools = PDFBug.tools;
     for (var i = 0; i < debugTools.length; ++i) {
       var tool = debugTools[i];
-      var key = 'PDFBug_' + tool.id;
-      if (key in params)
-        tool.enabled = (params[key] === 'true');
+      if (all || enabled.indexOf(tool.id) !== -1)
+        tool.enabled = true;
     }
     PDFBug.init();
   }