Commit Graph

72 Commits

Author SHA1 Message Date
Steve Howell 96100bb42a Highlight search typeaheads for streams
(imported from commit e8725fe8c4f4985d46e48fdab5003e3e9def9bd1)
2013-05-09 10:35:46 -04:00
Steve Howell 667a47755e Highlight search typeaheads for senders
(imported from commit 80e16d47507b0c23103aa1e574961cc5e29cac6e)
2013-05-09 10:35:46 -04:00
Steve Howell e47b98df38 Highlight search typeaheads for private messages
(imported from commit e3c5525255c70e507f33f24fc305d4a268c87e42)
2013-05-09 10:35:46 -04:00
Steve Howell 64ba2864bc Match names w/prefix and turn off highlighting.
(imported from commit 4ebc4aba5d05173ad6b8176d47fdf062e23c1441)
2013-05-09 10:35:45 -04:00
Steve Howell 0f75cbd30f Match any word in stream for typeahead queries
(imported from commit bd6ee91ae880c7fb3dd118cd2f024820ced73466)
2013-05-09 10:35:45 -04:00
Steve Howell de8106d923 Refine search (sort people by # of pms, limit streams to prefix-only).
Also minor configuration changes and no need to clone list.

(imported from commit 9f9c7259ed479fc29cd66fe260d9d81017e5f48f)
2013-05-09 10:35:45 -04:00
Steve Howell 0164d9f757 Search typeahead has more suggestions and sorting.
(imported from commit 5386be57e7f0b820e1a9cbd166c9c43e5e72215b)
2013-05-09 10:35:45 -04:00
Zev Benjamin c08a86aeb9 Use server-highlighted subject and content when narrowed to a search
(imported from commit 0579193da040db77f9c7937d3714cb9ffeaf7ed8)
2013-04-30 11:40:27 -04:00
Keegan McAllister 6d9aca5f1a Move "page parameters" (email, enter_sends, etc) into a single object
(imported from commit 842b2371bf6364982f1358f1cd2d91118c7fb2bf)
2013-03-26 13:50:03 -04:00
Waseem Daher c41fa46fb4 Always show the searchbar 'x'.
This simplifies a bunch of fragile resizing logic in our code,
and also addresses the Chrome Canary bug where clicking in the
searchbox causes the navbar to get huge.

This fixes Trac #764 and Trac #1039

(imported from commit fc8c3995109de384b71dfba2b986a8500ff7f08d)
2013-03-06 15:06:35 -05:00
Tim Abbott a92f2a5229 Rename 'Narrow to messages containing' to 'Search for'.
(imported from commit 147164bb96bb4fdb451454956ac56f5d3b2424b6)
2013-03-05 09:32:59 -05:00
Tim Abbott ee3662d1da Move 'Narrow to' to text inside narrow.describe().
(imported from commit a5ccce0034f4c70b71958b26b60521b779837377)
2013-03-05 09:32:59 -05:00
Tim Abbott 021052a247 search: Remove unused variable search_active.
(imported from commit ebb907742fd38f60116fb0fe46fa622abd3b23e0)
2013-03-04 17:57:21 -05:00
Tim Abbott d5a185dca8 Add highlighting of search terms in "messages containing" narrows.
(imported from commit 47fca2f20650c32e976ab01e213463d4fb4ed655)
2013-03-04 17:57:20 -05:00
Luke Faraone d88107567a Remove "find in page" functionality.
This was a source of user confusion and didn't provide that much value.

(imported from commit fbe9405d8bc4cb6661baa7fe7583eab5ed73d886)
2013-03-04 10:59:41 -05:00
Tim Abbott 096df2d3da typeahead_helper: Rename render_pm_object and cleanup usage.
(imported from commit 28bca00802e189daed22dcabba1241ef2625536e)
2013-02-28 17:49:57 -05:00
Tim Abbott 49af19aa71 Add support for narrowing by a message's sender.
Fixes #972.

(imported from commit 2514d14c94a071f2b3e6149a2bdaeaa00e0c847f)
2013-02-28 17:49:57 -05:00
Keegan McAllister e8dff94bfc Clear the search box on blur if not searching or narrowed
Fixes #978.

(imported from commit 5aefa1bf369e01e4cb6df15478080a793116628b)
2013-02-28 12:29:52 -05:00
Keegan McAllister db58ede658 Move some search UI code from ui.js to search.js
(imported from commit 4e761636769b320431d34d00bfed6b2ba888fa55)
2013-02-28 12:29:52 -05:00
Zev Benjamin 4c9e3a167e Move message selection to an event-based system
Messages are now selected on a MessageList, which triggers a
message_selected event that other parts of the code can listen for.

(imported from commit 1da9e4121425c0ac4461b41b7aea169072e1512b)
2013-02-21 13:29:17 -05:00
Zev Benjamin e9b915c2b9 Remove global selected_message_id and persistent_message_id variables
Each message list now has a selected message id.

(imported from commit 041abc54ea42c636c30e39df4a2e838bb830e1aa)
2013-02-21 13:29:17 -05:00
Waseem Daher 3e28cbc545 Make 'narrow to messages containing x' the default.
As it currently stands, after the introduction of operators, narrowing
to messages that contained X would also trigger a find-in-page.

This stops that from happening, and then also makes the default action
of the search-bar-invoked-without-a-typeahead be 'narrow to messages
containing x' rather than 'find in page'.

(imported from commit 1beffce426c6b00449e7c1c803687a129747ed63)
2013-02-01 13:47:20 -05:00
Jacob Hurwitz c3c79f5423 This magically makes the gear not move when the search box is focused
(imported from commit b562c358f3ba80877e8f03199638c236823d184c)
2013-01-31 19:07:13 -05:00
Waseem Daher 6d5424c910 Put "find in page" as the last option.
Leo points out that if you type a stream name, we probably want
to offer to narrow you to that stream more than we should offer
to find that stream name in the page.

(imported from commit 803ac681ec2f759f4dabb68a40722a07b86a0cab)
2013-01-31 17:50:53 -05:00
Waseem Daher 6cefbde820 Make "Find" option read "Find x in page".
(imported from commit 5d95b996f4d944c285ca6f5bc0f75ea359cb4df2)
2013-01-31 17:50:52 -05:00
Waseem Daher 0eca9fa595 Put 'narrow to messages containing' before 'find in page'.
This fixes Trac #740.

(imported from commit e40ffa149eac3c7d954d6cac617935496d366ce4)
2013-01-30 22:38:56 -05:00
Jacob Hurwitz c82fd34cad Two fixes to the search bar:
1) Make the search hotkey (/) no longer clear the search box
2) Vertically center the "Search..." placeholder

(imported from commit 02dee6b72c4457e160f57d8604164e15e62f5f28)
2013-01-29 15:29:27 -05:00
Zev Benjamin 8e7ac23d2b Make subs.js the keeper of the streams list
(imported from commit 566f529757bb83ad8dd4e52d3fc8c1b90c497ca2)
2013-01-24 17:59:02 -05:00
Waseem Daher 01ee0ccc9c Return to home view if a search is initiated from elsewhere.
(imported from commit a7453f269cabc2dd349a9711fcb6e84de18fecd7)
2013-01-22 17:18:50 -05:00
Keegan McAllister a15a1702e1 search: Only highlight actual message or recipient header text
Before, a whitespace-only search would "highlight" the pointer and all kinds of
other interstitial space, which totally broke the page layout.

Fixes #408.

(imported from commit e7e0e251551a9da5a2ea53e36b9cce16e3e30634)
2013-01-15 17:28:07 -05:00
Waseem Daher fad7d0a7cb Always show the floating recipient bar.
The initial rationale for hiding the floating recipient bar
was that it duplicated information that was in the "narrowbar".
Now that this no longer exists, let's *always* show the
floating recipient bar.

(Yes, there is some duplication of this information in the
search area, but I think the situation is fundamentally
different now and would basically like to see it everywhere.)

(imported from commit 6fd4506c2f48caade9496139e580e6550252ce8c)
2013-01-08 16:43:50 -05:00
Keegan McAllister 952296bb3d Hide search.update_button_visibility focus override argument from exports
(imported from commit 98201f7c833f9fc4a1c1d6ecdff033e08c28dd5c)
2013-01-08 12:18:31 -05:00
Keegan McAllister 6dea25fd9f Add narrow.by for syntactic convenience
(imported from commit 51300b93a078d54e5111e6bb16ecd9ecbcc295d2)
2013-01-08 12:18:31 -05:00
Keegan McAllister dbc4798594 Be consistent about when we display search buttons
Show the buttons iff

    - the search input is focused,
    - the search input has non-empty contents, or
    - we are narrowed.

(imported from commit f5c98471a2db4ab522160960dd1271471a9db555)
2013-01-08 12:18:31 -05:00
Keegan McAllister 60f2d06736 search: Factor out show_buttons / hide_buttons
(imported from commit 776f066129e8cf4e298ae90fdd4f62341b36dcae)
2013-01-08 12:18:30 -05:00
Keegan McAllister f3e4b3bc31 search: Simplify event handler setup
(imported from commit b14c4bafb09fa5919e03aac24e968329778a01d6)
2013-01-08 12:18:30 -05:00
Keegan McAllister ddf75b64f7 Un-narrow whenever we clear the search box
(imported from commit 15533579bfbae1644cc76b33348c3cd21a829713)
2013-01-08 12:18:30 -05:00
Keegan McAllister 3619480673 Handle narrowing operators typed into the search box
(imported from commit 6f758091e2953d00d6a331210aa774b72ba889d5)
2013-01-08 12:18:30 -05:00
Keegan McAllister 121ba29abe Simplify searchbox_sorter
(imported from commit cce3d2fd2e56801b43c668c849ef4664edc32a6c)
2013-01-08 12:18:30 -05:00
Keegan McAllister 1fcc7a6185 Rework render_object_in_parts to use switch/case
And rename fields for conciseness.

(imported from commit 77d89085f0786ecdcbb2897e3d171c930b44137a)
2013-01-08 12:18:30 -05:00
Keegan McAllister e202638184 Rework narrow_or_search_for_term to use switch/case
(imported from commit a1296e79d9f6414113a475e407fbaccb54eadb14)
2013-01-08 12:18:30 -05:00
Keegan McAllister ba7ffcead4 narrow: Remove some unnecessary helpers
(imported from commit 307dfec262648bc1fc79d2fb46f8950c7a2f1e2e)
2013-01-08 12:18:29 -05:00
Keegan McAllister d4d4ea7a8d Display narrowing operators in the search bar
(imported from commit d801128c5b961360939c9e3f3f6f89c8602f987b)
2013-01-08 12:18:29 -05:00
Jeff Arnold db6f03d46d Make the back button work when narrowed
(imported from commit be922b06e7b53ec21751e67a490bb518333c3e6c)
2012-12-19 14:46:31 -05:00
Waseem Daher 64b3f072fe Restore "Enter advances find" behavior.
This fixes https://trac.humbughq.com/ticket/546.

It's a little unpleasant that this special-casing lives in hotkey.js
-- instead you could imagine doing something where there was a whole
special set of hotkeys when a search is active, like we do with the
composebox, but this gets the job and is probably simplest.

I would have written this as a case that just falls through in the
else condition, but jslint doesn't like that.

(imported from commit 65a1b8aa1efc356b6690dc177058a4fb9e12745a)
2012-12-07 15:01:20 -05:00
Zev Benjamin c5bf05ad0a Make clicking on 'Find <search term>' work
(imported from commit 756bd6cb3533e985e031954ece9228a146c5160e)
2012-11-30 17:03:52 -05:00
Waseem Daher 2321059240 Don't highlight, e.g. 'Narrow to', in the searchbox typeahead.
(imported from commit f16f1417da708ad2060ba603fe14ea113559d100)
2012-11-27 13:28:21 -05:00
Waseem Daher e0f3c43432 Deduplicate code a little.
(imported from commit 52c32776641256fc145ce1ff7a60ca8fb92ea784)
2012-11-27 13:28:21 -05:00
Waseem Daher 8c0445bff5 Sort searchbox typeahead in a more intelligent way.
Ensure that every result has one of:
* find what you typed in
* search for what you typed in
* Narrow to a stream related to what you typed
* Narrow to a person related to what you type

(imported from commit 2178f17932f951a48f53d982ef660942562b55dc)
2012-11-27 13:28:21 -05:00
Jeff Arnold 9ce4c103c0 Implement full history search by creating a narrow for a search term
(imported from commit 3f2df6a6e590458ff774bbd658bbd1d95076a4db)
2012-11-19 17:12:59 -05:00