Browse Source

Enable/disable search via about:config pref

Artur Adib 13 years ago
parent
commit
6cd9ae01cc
  1. 3
      extensions/firefox/components/PdfStreamConverter.js
  2. 2
      web/viewer.html
  3. 5
      web/viewer.js

3
extensions/firefox/components/PdfStreamConverter.js

@ -161,6 +161,9 @@ ChromeActions.prototype = { @@ -161,6 +161,9 @@ ChromeActions.prototype = {
},
pdfBugEnabled: function() {
return getBoolPref(EXT_PREFIX + '.pdfBugEnabled', false);
},
searchEnabled: function() {
return getBoolPref(EXT_PREFIX + '.searchEnabled', false);
}
};

2
web/viewer.html

@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline" onclick="PDFView.switchSidebarView('outline')" tabindex="2" data-l10n-id="outline">
<span data-l10n-id="outline_label">Document Outline</span>
</button>
<button id="viewSearch" class="toolbarButton group" title="Search Document" onclick="PDFView.switchSidebarView('search')" tabindex="3" data-l10n-id="search">
<button id="viewSearch" class="toolbarButton group hidden" title="Search Document" onclick="PDFView.switchSidebarView('search')" tabindex="3" data-l10n-id="search">
<span data-l10n-id="search_label">Search Document</span>
</button>
</div>

5
web/viewer.js

@ -1490,6 +1490,11 @@ window.addEventListener('load', function webViewerLoad(evt) { @@ -1490,6 +1490,11 @@ window.addEventListener('load', function webViewerLoad(evt) {
PDFBug.init();
}
if (!PDFJS.isFirefoxExtension ||
(PDFJS.isFirefoxExtension && FirefoxCom.request('searchEnabled'))) {
document.querySelector('#viewSearch').classList.remove('hidden');
}
var thumbsView = document.getElementById('thumbnailView');
thumbsView.addEventListener('scroll', updateThumbViewArea, true);

Loading…
Cancel
Save