add support for case sensitive

This commit is contained in:
Artur Adib 2012-09-26 12:14:57 -04:00
parent 6864a07221
commit 6022476f03

View File

@ -247,11 +247,17 @@ var PDFFindController = {
// TODO: Handle the other find options here as well.
var query = this.state.query;
var caseSensitive = this.state.caseSensitive;
var queryLen = query.length;
if (queryLen === 0)
return [];
if (!caseSensitive) {
pageContent = pageContent.toLowerCase();
query = query.toLowerCase();
}
var matches = [];
var matchIdx = -queryLen;