mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Merge pull request #5579 from jazzy-em/master
Added multiple term search functionality (with default phrase search)
This commit is contained in:
commit
5aefce6ba6
7 changed files with 154 additions and 16 deletions
13
web/app.js
13
web/app.js
|
@ -1250,6 +1250,7 @@ var PDFViewerApplication = {
|
|||
eventBus.on('rotateccw', webViewerRotateCcw);
|
||||
eventBus.on('documentproperties', webViewerDocumentProperties);
|
||||
eventBus.on('find', webViewerFind);
|
||||
eventBus.on('findfromurlhash', webViewerFindFromUrlHash);
|
||||
//#if GENERIC
|
||||
eventBus.on('fileinputchange', webViewerFileInputChange);
|
||||
//#endif
|
||||
|
@ -1905,12 +1906,23 @@ function webViewerDocumentProperties() {
|
|||
function webViewerFind(e) {
|
||||
PDFViewerApplication.findController.executeCommand('find' + e.type, {
|
||||
query: e.query,
|
||||
phraseSearch: e.phraseSearch,
|
||||
caseSensitive: e.caseSensitive,
|
||||
highlightAll: e.highlightAll,
|
||||
findPrevious: e.findPrevious
|
||||
});
|
||||
}
|
||||
|
||||
function webViewerFindFromUrlHash(e) {
|
||||
PDFViewerApplication.findController.executeCommand('find', {
|
||||
query: e.query,
|
||||
phraseSearch: e.phraseSearch,
|
||||
caseSensitive: false,
|
||||
highlightAll: true,
|
||||
findPrevious: false
|
||||
});
|
||||
}
|
||||
|
||||
function webViewerScaleChanging(e) {
|
||||
var appConfig = PDFViewerApplication.appConfig;
|
||||
appConfig.toolbar.zoomOut.disabled = (e.scale === MIN_SCALE);
|
||||
|
@ -2054,6 +2066,7 @@ window.addEventListener('keydown', function keydown(evt) {
|
|||
if (findState) {
|
||||
PDFViewerApplication.findController.executeCommand('findagain', {
|
||||
query: findState.query,
|
||||
phraseSearch: findState.phraseSearch,
|
||||
caseSensitive: findState.caseSensitive,
|
||||
highlightAll: findState.highlightAll,
|
||||
findPrevious: cmd === 5 || cmd === 12
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue