Merge pull request #5579 from jazzy-em/master

Added multiple term search functionality (with default phrase search)
This commit is contained in:
Yury Delendik 2016-05-27 14:23:26 -05:00
commit 5aefce6ba6
7 changed files with 154 additions and 16 deletions

View file

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