]> git.parisson.com Git - pdf.js.git/commitdiff
Localize print message. Show/hide print button.
authorBrendan Dahl <brendan.dahl@gmail.com>
Mon, 9 Jul 2012 23:04:55 +0000 (16:04 -0700)
committerBrendan Dahl <brendan.dahl@gmail.com>
Mon, 9 Jul 2012 23:04:55 +0000 (16:04 -0700)
l10n/en-US/viewer.properties
web/viewer.html
web/viewer.js

index de6fd95dba343163d29c2a05f560ac08bd70a72d..ce268a1133f5c8df95c8907d83ba25585beb6540 100644 (file)
@@ -87,3 +87,5 @@ loading_error=An error occurred while loading the PDF.
 # Some common types are e.g.: "Check", "Text", "Comment", "Note"
 text_annotation_type=[{{type}} Annotation]
 request_password=PDF is protected by a password:
+
+printing_not_supported=Warning: Printing is not supported by this browser.
index 5d66e8b335672ad4bc1c3e4e39e1a7982cb79b43..28e57f700374e0c23f6ddddc0993fbb10e39e42e 100644 (file)
                    <span data-l10n-id="open_file_label">Open</span>
                 </button>
 
-                <!--
                 <button id="print" class="toolbarButton print" title="Print" tabindex="11" data-l10n-id="print" onclick="window.print()">
                   <span data-l10n-id="print_label">Print</span>
                 </button>
-                -->
 
                 <button id="download" class="toolbarButton download" title="Download" onclick="PDFView.download();" tabindex="12" data-l10n-id="download">
                   <span data-l10n-id="download_label">Download</span>
index 1a7732e4e790d0c20fcdbed97de4d1f449b651a0..377a4fc7e7e3e25a1466d01e53fb8ceebe47b8e8 100644 (file)
@@ -1050,7 +1050,9 @@ var PDFView = {
 
   beforePrint: function pdfViewSetupBeforePrint() {
     if (!this.supportsPrinting) {
-      alert('Printing is not supported by this browser.');
+      var printMessage = mozL10n.get('printing_not_supported', null,
+                         'Warning: Printing is not supported by this browser.');
+      alert(printMessage);
       return;
     }
     for (var i = 0, ii = this.pages.length; i < ii; ++i) {
@@ -1761,6 +1763,10 @@ window.addEventListener('load', function webViewerLoad(evt) {
     document.querySelector('#viewSearch').classList.remove('hidden');
   }
 
+  if (!PDFView.supportsPrinting) {
+    document.getElementById('print').classList.add('hidden');
+  }
+
   // Listen for warnings to trigger the fallback UI.  Errors should be caught
   // and call PDFView.error() so we don't need to listen for those.
   PDFJS.LogManager.addLogger({