Enable/disable search via about:config pref

This commit is contained in:
Artur Adib 2012-05-21 11:15:24 -04:00
parent 0bac4abcb5
commit 6cd9ae01cc
3 changed files with 10 additions and 2 deletions

View File

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

View File

@ -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>

View File

@ -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);