mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
add support for case sensitive
This commit is contained in:
parent
6864a07221
commit
6022476f03
1 changed files with 6 additions and 0 deletions
|
@ -247,11 +247,17 @@ var PDFFindController = {
|
||||||
// TODO: Handle the other find options here as well.
|
// TODO: Handle the other find options here as well.
|
||||||
|
|
||||||
var query = this.state.query;
|
var query = this.state.query;
|
||||||
|
var caseSensitive = this.state.caseSensitive;
|
||||||
var queryLen = query.length;
|
var queryLen = query.length;
|
||||||
|
|
||||||
if (queryLen === 0)
|
if (queryLen === 0)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
|
if (!caseSensitive) {
|
||||||
|
pageContent = pageContent.toLowerCase();
|
||||||
|
query = query.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
var matches = [];
|
var matches = [];
|
||||||
|
|
||||||
var matchIdx = -queryLen;
|
var matchIdx = -queryLen;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue