pages loaded from search results should highlight the search term

RESOLVED FIXED in seamonkey2.1a2

Status

SeaMonkey
Help Documentation
--
enhancement
RESOLVED FIXED
15 years ago
7 years ago

People

(Reporter: timeless, Assigned: InvisibleSmiley)

Tracking

({fixed-seamonkey2.0.6})

Trunk
seamonkey2.1a2
fixed-seamonkey2.0.6

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

15 years ago
someone decided to make mozilla help pages extremely long.
this is a big problem, because you can search for a topic (print preview) get a
very long page and see *no* evidence of print preview on the page.

this bug is asking for the search term to be highlighted (ala google).
for multiple terms (print preview) it might be beneficial to color each word and
also color multiword spans.  i think coloring multiword spans won't be necessary
because the natural adjacency of multiple colored words will draw the reader to
them.

Comment 1

14 years ago

*** This bug has been marked as a duplicate of 158772 ***
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
(Reporter)

Comment 2

14 years ago
no.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---

Comment 3

14 years ago
Now that I understand timeless, I would agree with this as well.
Severity: major → enhancement
OS: Windows 2000 → All
Hardware: PC → All

Comment 4

14 years ago
moving stuff over to an outside-the-firewall email for the time being, looking
for people to pick these Help and doc bugs up for me.
Assignee: oeschger → oeschger
Status: REOPENED → NEW

Comment 5

14 years ago
--> me

We'll see if we can get this for 1.6a.
Assignee: oeschger → rlk
Target Milestone: --- → mozilla1.6alpha

Comment 6

14 years ago
Brant, do you think that we could get this in for 1.6a?

Comment 7

14 years ago
I'm not exactly sure how to go about doing this.  The best I can come up with is
to do something like:
[search item clicked]
Search for search term in article.
Replace with <span class="searched">search term</span>

That's the most straight forward algorithm I can think of if it can be done.

Updated

14 years ago
QA Contact: tpreston → stolenclover

Comment 8

14 years ago
-> Future

Not sure when I'm going to get to this. Probably not before 1.7.
Target Milestone: mozilla1.6alpha → Future

Comment 9

13 years ago
Moving to new Help component owner.
Assignee: rlk → neil.parkwaycc.co.uk

Comment 10

13 years ago
The finder component is this:
var finder = Components.classes["@mozilla.org/embedcomp/rangefind;1"]
                       .createInstance(Components.interfaces.nsIFind);
Its Find method returns a range that contains the found string.
var range = finder.Find(string, searchRange, startRange, endRange);
startRange and endRange are usually points. They may not look useful but
depending on which way you're searching it's easier to update the start/end
range for the find again than to change the search range.
You then need to modify the document to highlight the string. Unfortunately
there are at least two bugs that are stopping this from working :-(
Keywords: helpwanted

Comment 11

13 years ago
OK, so now surroundContents is fixed, here's a starter code snippet:

var searchRange = content.document.createRange();
searchRange.selectNodeContents(content.document.body);
var endRange = searchRange.cloneRange();
endRange.collapse(false);
var range = searchRange.cloneRange();
range.collapse(true);
var finder = Components.classes["@mozilla.org/embedcomp/rangefind;1"]
                       .createInstance(Components.interfaces.nsIFind);
while ((range = finder.Find(findText, searchRange, range, endRange)) != null) {
  var span = content.document.createElement("span");
  span.className = "searchHighlight";
  range.surroundContents(span);
  range.collapse(false);
}
Product: Browser → Seamonkey
(Assignee)

Comment 12

9 years ago
Now that SM2 uses the Toolkit-based help browser with the find bar at the bottom there is "Highlight all" which qualifies as a workaround. Could that functionality be adapted to fix this bug?

Comment 13

7 years ago
(In reply to comment #12)
> Now that SM2 uses the Toolkit-based help browser with the find bar at the
> bottom there is "Highlight all" which qualifies as a workaround. Could that
> functionality be adapted to fix this bug?

Yes, but we need to document how to do that on the "Using the Help Window" page.
Feel free to take this bug.
Assignee: neil → nobody
QA Contact: danielwang → help
(Assignee)

Comment 14

7 years ago
Created attachment 445549 [details] [diff] [review]
document Help findbar
Assignee: nobody → jh
Status: NEW → ASSIGNED
Attachment #445549 - Flags: review?(iann_bugzilla)

Comment 15

7 years ago
Comment on attachment 445549 [details] [diff] [review]
document Help findbar

>+++ b/suite/locales/en-US/chrome/common/help/help_help.xhtml
> <ul>
>   <li>Main topics are listed in the left sidebar. Click a topic to read about
>     it. To see its subtopics, double-click or click the <span class="noMac">
>     plus-sign</span><span class="mac">triangle</span> at the left.</li>
Whilst you are here can you correct the error with it only being a "triangle" on macs, it is a "triangle" on linux (at least Fedora) as well. Probably using class="win" and class="unix" as well as class="mac".

>+  <li>To search inside a page, use the <kbd class="mac">Cmd</kbd><kbd
>+    class="noMac">Ctrl</kbd>+<kbd>F</kbd> shortcut. Enter the word or phrase
>+    you would like to find into the text field of the bar that will open at the
>+    bottom and press Return, or use the <q>Next</q> and <q>Previous</q> buttons
You should not use "Return" but use:
<kbd class="mac">Return</kbd><kbd class="noMac">Enter</kbd>

>+    to find the next match in the chosen direction. Use <q>Highlight all</q> to
>+    highlight your search phrase within the whole page. If you want to do a
>+    case-sensitive search, tick the <q>Match case</q> checkbox.</li>
We have to use an Americanism here, so not "tick" but "check". In this case:
"check the <q>Match case</q> box." so as not to repeat check in the word checkbox.
r=me with those changes.
Attachment #445549 - Flags: review?(iann_bugzilla) → review+
(Assignee)

Comment 16

7 years ago
Created attachment 445557 [details] [diff] [review]
patch v2

(In reply to comment #15)
> (From update of attachment 445549 [details] [diff] [review])
> >+++ b/suite/locales/en-US/chrome/common/help/help_help.xhtml
> > <ul>
> >   <li>Main topics are listed in the left sidebar. Click a topic to read about
> >     it. To see its subtopics, double-click or click the <span class="noMac">
> >     plus-sign</span><span class="mac">triangle</span> at the left.</li>
> Whilst you are here can you correct the error with it only being a "triangle"
> on macs, it is a "triangle" on linux (at least Fedora) as well. Probably using
> class="win" and class="unix" as well as class="mac".

Actually with Modern it's always a triangle so I changed the text to be platform-independent (all-encompassing). Re-requesting review solely for that, fixed your other nits.
Attachment #445549 - Attachment is obsolete: true
Attachment #445557 - Flags: review?(iann_bugzilla)

Comment 17

7 years ago
Comment on attachment 445557 [details] [diff] [review]
patch v2

>   <li>Main topics are listed in the left sidebar. Click a topic to read about
>+    it. To see its subtopics, double-click or click the plus-sign/triangle at
>+    the left.</li>
"at the left" doesn't sound right, "to the left" is probably better.
r=me with that addressed.
Attachment #445557 - Flags: review?(iann_bugzilla) → review+
(Assignee)

Comment 18

7 years ago
Created attachment 445589 [details] [diff] [review]
patch v2a, r=IanN [Checkin: comments 19+20]
Attachment #445557 - Attachment is obsolete: true
Attachment #445589 - Flags: review+
(Assignee)

Comment 19

7 years ago
Comment on attachment 445589 [details] [diff] [review]
patch v2a, r=IanN [Checkin: comments 19+20]

http://hg.mozilla.org/comm-central/rev/2a5aeaa7f616
Attachment #445589 - Attachment description: patch v2a, r=IanN → patch v2a, r=IanN [Checkin: comment 19]
Attachment #445589 - Flags: approval-seamonkey2.0.6?
(Assignee)

Updated

7 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago7 years ago
Keywords: helpwanted
Resolution: --- → FIXED
Target Milestone: Future → seamonkey2.1a2

Updated

7 years ago
Attachment #445589 - Flags: approval-seamonkey2.0.6? → approval-seamonkey2.0.6+
(Assignee)

Comment 20

7 years ago
Comment on attachment 445589 [details] [diff] [review]
patch v2a, r=IanN [Checkin: comments 19+20]

http://hg.mozilla.org/releases/comm-1.9.1/rev/7d6981344b11
Attachment #445589 - Attachment description: patch v2a, r=IanN [Checkin: comment 19] → patch v2a, r=IanN [Checkin: comments 19+20]
(Assignee)

Updated

7 years ago
Keywords: fixed-seamonkey2.0.6
(In reply to comment #15)
>(From update of attachment 445549 [details] [diff] [review])
>>+    case-sensitive search, tick the <q>Match case</q> checkbox.</li>
>We have to use an Americanism here, so not "tick" but "check".
Our localiser will then restore "tick" to the en-GB locale ;-)
You need to log in before you can comment on or make changes to this bug.