Added multiple term search functionality (with default phrase search)

This commit is contained in:
jazzy-em 2016-05-26 18:24:58 +05:00
parent 7ac48ef4d5
commit 0a347ec04d
7 changed files with 154 additions and 16 deletions

View file

@ -1251,6 +1251,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
@ -1906,12 +1907,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);
@ -2055,6 +2067,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