mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 20:15:46 +01:00
apply 'hlsearchstyle' to frame documents
This commit is contained in:
@@ -235,17 +235,22 @@ function Search() //{{{
|
|||||||
if (!text)
|
if (!text)
|
||||||
text = last_search_string;
|
text = last_search_string;
|
||||||
|
|
||||||
// NOTE: setCaseSensitivity() in FF2 does NOT set the
|
// NOTE: gFindBar.setCaseSensitivity() in FF2 does NOT set the
|
||||||
// accessibility.typeaheadfind.casesensitive pref as needed by
|
// accessibility.typeaheadfind.casesensitive pref as needed by
|
||||||
// highlightDoc()
|
// highlightDoc()
|
||||||
gFindBar.mTypeAheadCaseSensitive = case_sensitive ? 1 : 0;
|
gFindBar.mTypeAheadCaseSensitive = case_sensitive ? 1 : 0;
|
||||||
gFindBar.highlightDoc("white", "black", text);
|
gFindBar.highlightDoc("white", "black", text);
|
||||||
|
|
||||||
// TODO: seems fast enough for now
|
// TODO: seems fast enough for now...just
|
||||||
// NOTE: FF2 highlighting spans all have this id rather than a class attribute
|
// NOTE: FF2 highlighting spans all have the same id rather than a class attribute
|
||||||
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]')
|
(function(win)
|
||||||
for (var i = 0; i < spans.snapshotLength; i++)
|
{
|
||||||
spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]);
|
for (var i = 0; i < win.frames.length; i++)
|
||||||
|
arguments.callee(win.frames[i])
|
||||||
|
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document)
|
||||||
|
for (var i = 0; i < spans.snapshotLength; i++)
|
||||||
|
spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]);
|
||||||
|
})(window.content);
|
||||||
|
|
||||||
// recreate selection since _highlightDoc collapses the selection backwards
|
// recreate selection since _highlightDoc collapses the selection backwards
|
||||||
getBrowser().fastFind.findNext();
|
getBrowser().fastFind.findNext();
|
||||||
|
|||||||
Reference in New Issue
Block a user