colors closer to FF's, add highlightAll support
This commit is contained in:
parent
e2a2085f62
commit
6090b3edf9
@ -1067,7 +1067,7 @@ canvas {
|
||||
margin: -1px;
|
||||
padding: 1px;
|
||||
|
||||
background-color: rgba(0, 137, 26, 0.2);
|
||||
background-color: rgba(180, 0, 170, 0.2);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@ -1084,7 +1084,7 @@ canvas {
|
||||
}
|
||||
|
||||
.textLayer .highlight.selected {
|
||||
background-color: rgba(255, 0, 0, 0.2);
|
||||
background-color: rgba(0, 100, 0, 0.2);
|
||||
}
|
||||
|
||||
/* TODO: file FF bug to support ::-moz-selection:window-inactive
|
||||
|
@ -458,22 +458,18 @@ var PDFFindBar = {
|
||||
// next match when the findField is selected.
|
||||
|
||||
document.getElementById('findPrevious').addEventListener('click',
|
||||
function() {
|
||||
self.dispatchEvent('again', true);
|
||||
});
|
||||
function() { self.dispatchEvent('again', true); }
|
||||
);
|
||||
|
||||
document.getElementById('findNext').addEventListener('click',
|
||||
function() {
|
||||
document.getElementById('findNext').addEventListener('click', function() {
|
||||
self.dispatchEvent('again', false);
|
||||
});
|
||||
|
||||
this.highlightAll.addEventListener('click',
|
||||
function() {
|
||||
this.highlightAll.addEventListener('click', function() {
|
||||
self.dispatchEvent('highlightallchange');
|
||||
});
|
||||
|
||||
this.caseSensitive.addEventListener('click',
|
||||
function() {
|
||||
this.caseSensitive.addEventListener('click', function() {
|
||||
self.dispatchEvent('casesensitivitychange');
|
||||
});
|
||||
},
|
||||
@ -2276,6 +2272,7 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
|
||||
var prevEnd = null;
|
||||
var isSelectedPage = this.pageIdx === PDFFindController.selected.pageIdx;
|
||||
var selectedMatchIdx = PDFFindController.selected.matchIdx;
|
||||
var highlightAll = PDFFindController.state.highlightAll;
|
||||
|
||||
this.clearMatches();
|
||||
|
||||
@ -2323,7 +2320,14 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
|
||||
textDivs[divIdx].className = className;
|
||||
}
|
||||
|
||||
for (var i = 0; i < matches.length; i++) {
|
||||
var i0 = selectedMatchIdx, i1 = i0 + 1, i;
|
||||
|
||||
if (highlightAll) {
|
||||
i0 = 0;
|
||||
i1 = matches.length;
|
||||
}
|
||||
|
||||
for (i = i0; i < i1; i++) {
|
||||
var match = matches[i];
|
||||
var begin = match.begin;
|
||||
var end = match.end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user