Commit Graph

258 Commits

Author SHA1 Message Date
Jessica McKellar 485de6a5bc Correctly compute home unread counts on page load.
We had a duplicate and incorrect check on if a stream was in your home
view, which caused us to not display Home unread counts in the sidebar
/ notification bar / Dock on page load.

(imported from commit db27cf9091f8b47200b025f03a26c4fe82701882)
2013-08-20 11:10:18 -04:00
Jessica McKellar b32219c8eb Don't display unread counts until after making a bankruptcy decision.
Users were getting confused about why the unread count in the sidebar
/ notification bar / Dock was different from what the bankruptcy modal
said, so only show them the true server count until they've made a
decision.

(imported from commit 71d376cd4a85749ccf49936b251e6b8ac21361b7)
2013-08-20 10:26:52 -04:00
acrefoot 395aaae994 Allow anyone to edit a "no topic" message
This change would allow anyone in the realm to set a topic for a "no topic"
message. As soon as the message topic is set, only the sender can change it again.

(imported from commit 0a91a93b8fd14549965cedc79f45ffd869d82307)
2013-08-19 16:29:30 -04:00
acrefoot e8e5cc37b7 No longer require topics for zulip.com.
This will allow us to try the "write-once" topics

(imported from commit ffd074baa94fbbe375b7b1b436a2e19fe44f42e4)
2013-08-19 16:29:30 -04:00
Steve Howell 53f62bd71c Created MessageListView class.
(The code for MessageListView  was extracted from message_list.js.)

(imported from commit 60c0bac4c734d3850f8b8c047a978c292b19cc13)
2013-08-19 12:17:56 -04:00
Steve Howell 29c012dc74 Create stream_data.js module.
This pulls a lot of data-centric functions out of subs.js.

(imported from commit 0deed7d4bf5697e893af9bc9d888c2d5da8d9fa2)
2013-08-19 12:17:55 -04:00
Jeff Arnold 12058b0880 Don't break double clicking in the edit compose box to select a word.
(imported from commit 309f9b96b8567e384c83ba4c3a8a954383c6ebc7)
2013-08-16 22:03:47 -04:00
Steve Howell dc19f15b1f Make composebox_typeahead.seen_topics be a Dict of Dicts.
The new implementation makes add_topic() be O(1).  We incur
the cost of sort() in topics_seen_for(), but that's only called
in the typeahead widget, and I think the typical number of topics
should be manageable here.

(imported from commit 0e332301b2e44b4465bf7a1d93ae525a8d17a6b6)
2013-08-16 17:59:40 -04:00
Steve Howell a4af6c7062 Add unit tests for composebox_typeahead.add_topic().
This tests topics_seen_for() as well.

(imported from commit a748134af8068d9e4ae223fb7ecbbbc6c170137e)
2013-08-16 17:59:40 -04:00
Jeff Arnold e51cfeaed4 Only add an edit icon next to the last paragraph
(imported from commit c6d2893faef144f85518c4d45856282ada33a9d1)
2013-08-16 17:40:07 -04:00
Allen Rabinovich 5571a6e466 Switch body click to document click to account for clicks on the outer edge
(imported from commit bf6c7a61cb2f00741ed3af70ca77b5782f15d148)
2013-08-16 10:51:00 -07:00
Jeff Arnold 5596191666 Make double-clicking on a message highlight the message.
Addresses Trac #4.

(imported from commit d920f473e94e5141f41e887ffae74b3e21f862a6)
2013-08-16 13:46:56 -04:00
Jeff Arnold 41a149140d Show a button for editing messages when the user hovers over them.
Addresses Trac #1691.

Currently enabled only for staging and customer7.invalid.

(imported from commit 181e31adbac113bf62709b171d978c3074c8a799)
2013-08-16 13:02:15 -04:00
Jeff Arnold b166accc33 Revert "Show a button for editing messages when the user hovers over them."
This reverts commit 782e76210ac835d0617d91679933eccff0caad98.

(imported from commit 24889d0e0e38cc46d4b2d06c12a5737a4772fd6c)
2013-08-16 11:44:07 -04:00
Jeff Arnold 66c9c7efee Show a button for editing messages when the user hovers over them.
Addresses Trac #1691.

Currently enabled only for staging and customer7.invalid.

(imported from commit 782e76210ac835d0617d91679933eccff0caad98)
2013-08-16 11:20:15 -04:00
Kevin Mehall 3345199604 Hide/show the floating recipient bar when fade state changes.
This partially reverts d3c28b17859cacd49b7db9f8784d4b8b9069e1ff.

It is necessary to call update_floating_recipient_bar from _fade_messages and
_want_normal_display because they are called after opening/closing the compose
box. There is no scrolling there, so it is not otherwise updated. It is not
necessary to call from update_rendered_messages as it is not called on
changes of the fade state.

Related: Trac #1682

(imported from commit e2528f8c8827b7e2a135d7fc2b53e9e8162799b0)
2013-08-15 18:26:36 -04:00
Waseem Daher ada6a8d5d3 Shorten overly long names.
They were getting clipped in our box.

(imported from commit 8a33c385f81753c795ec1a62883aa45c6b6a26e3)
2013-08-15 18:04:43 -04:00
Waseem Daher 90617db8a1 Allow "Share the love" to be expanded and collapsed.
(imported from commit 9e620c5882d58f41d25124a690aa4154f93173db)
2013-08-15 18:04:43 -04:00
Steve Howell 9993af7e8d Remove dead comment from refactoring.
(imported from commit 2b1f3ef65b2e30c548a8966d47b448cefe3dde5f)
2013-08-15 17:15:07 -04:00
Steve Howell 30af17254d Require topics for customer7.invalid and zulip.com.
(imported from commit 6b17147b50575dd4ea8d688f15951660766708fa)
2013-08-15 17:09:26 -04:00
Scott Feeney 0241ae4136 Fix "All messages" showing when it shouldn't
I haven't filed an issue about this since I just quickly found and
tracked down the bug, but the STR were:

1. Subscribe to stream foo
2. Hide foo from your home view
3. Unsubscribe from stream foo
4. Unhide other subscribed streams you've hidden from home view, if any

The "All messages" link would stay, although it should go away in this
case. The apparent cause was an incorrect assumption (when implementing
this feature) that the stream_info dict only contains subscribed
streams; in fact, we also populate it with streams you used to subscribe
to.

(imported from commit 67f95c8c8a211a4943a2de394919d15a0d5435d0)
2013-08-15 16:21:35 -04:00
Allen Rabinovich 550fd6281c Fix regressions associated with the new fixed sidebar layout.
Specifically:

   * Remove min width setting for the main div as it is no longer necessary.
   * Change max width for the app to 1200 and adjust top margin on the message pane

(imported from commit 846dd3dcd7798efa615e15c61681b0ab7465f5e3)
2013-08-15 12:55:10 -07:00
Zev Benjamin 12c7f276b7 blueslip: Get complete stack traces in Chrome
(imported from commit 6165e210b9168701faf1310a33083bd30fa3aaf2)
2013-08-15 13:16:40 -04:00
Steve Howell ecb3399a8d Move summary exemptions from 5 to 8.
(imported from commit 279422ffb9e6d826a9e70e577fe334631f2697ca)
2013-08-15 11:03:26 -04:00
Steve Howell babbca7360 Use d.each() for iterating Dict instances.
(imported from commit 8cfe2c9a61aa1179454a6ab986fa23d04de09525)
2013-08-15 10:16:12 -04:00
Steve Howell 75ffd4d637 Exempt last 5 messages in view from summarization.
Once you enter a view, the last n messages will be exempt from
summarization, to give the users a little more context.  Any
subsequently arriving messages will also be exempt.

We will try n=5 at first.

(imported from commit 3e6fe58109e692389bf02dde2230d788b5818d52)
2013-08-15 08:20:29 -04:00
Steve Howell 3e1cdaaded Add MessageList.nth_most_recent_id().
(imported from commit 69a424d4990402b9e77fbfa57fa573a002cf04ce)
2013-08-15 08:20:29 -04:00
Zev Benjamin 72927e9d77 Fix unread count badge on OS X desktop app
For web pages, the initial favicon is the same as the favicon we
set for no unread messages and the initial page title is the same
as the page title we set for no unread messages.  However, for the
OS X app, the dock icon does not get its badge updated on initial
page load.  If the badge icon was wrong right before a reload and
we actually have no unread messages then we will never execute
bridge.updateCount() until the unread count changes.  Therefore,
we now ensure that bridge.updateCount is always run at least once
to synchronize it with the page title.

(imported from commit 5d1269c62c1c3190aea96ef6f96c46acdb9fdf9c)
2013-08-14 17:30:16 -04:00
Kevin Mehall de58b3fb4c Instead of DOM lookups, implement get_row in O(1) with a map updated after rendering.
(imported from commit 52927e87463e49f9f4522baa065cc934094f58de)
2013-08-14 17:08:47 -04:00
Kevin Mehall 0f6c7ca7be Use msg_list.get_row(id) instead of rows.get(id, msg_list.table_name)
(imported from commit 953cd24e605269d2bbdc42b878506f0ab01501e8)
2013-08-14 17:08:32 -04:00
Scott Feeney 024680f1de Outdent rows.js
We don't indent the outermost IIFE in any of our other modules.

(imported from commit 476bf5025988de28644bbb22f70e0cd2f404526a)
2013-08-14 14:57:29 -04:00
Steve Howell 947ca3a0e0 Add Dict.each().
Dict.each() allows to iterate through values and keys of a Dict.
The callback function is passed value as the first parameter to
be similar to _.each()'s calling sequence.

(imported from commit e745e8b5d2f167b8b8acf7542b767494e354b037)
2013-08-14 14:24:38 -04:00
Steve Howell 4b0cef8a83 Fixed code comments
(imported from commit 75b0ad464bab2e9b0b24f7c6a484b9c99d8b5a7a)
2013-08-14 13:22:28 -04:00
Steve Howell 59b84aad4a Properly fade recipient bar of incoming messages.
This fixes #1682, a recent regression that came out of
a5a47e13fc9d, which introduced the update_rendered_messages()
function in compose_fade.js.  The original implementation
was finding the table row for a message, but not the table
row for its recipient bar.  Now we style both elements.

(imported from commit a9628df0b03f79a24dfa68f4f2061eda2ca8ecea)
2013-08-14 13:20:39 -04:00
Steve Howell d66ac9f36c Remove calls to update_floating_recipient_bar in compose_fade.js.
The calls to ui.update_floating_recipient_bar() were brought over
from compose.js, and it turns out they just complicate scrolling,
since we already call the function in the scroll handler.

(imported from commit d3c28b17859cacd49b7db9f8784d4b8b9069e1ff)
2013-08-14 13:20:38 -04:00
Steve Howell 3f6a0cb909 Make topic autocompletes be case-insensitive w/r/t streams.
See trac #1676. Topic autocompletes were case insensitive
w/r/t to topic itself, but if a stream was called "Denmark"
but the compose box's stream field had "denmark", then we
wouldn't suggest any topics.

(imported from commit c8296c166115bb96023026da212f73a243432305)
2013-08-14 13:15:00 -04:00
Steve Howell 050c8ad103 zulip.subject_dict -> composebox_typeahead.seen_topics
Move zulip.subject_dict into composebox_typeahead.seen_topics,
and encapsulate the use of seen_topics inside composebox_typeahead
with add_topic() and topics_seen_for().

(imported from commit 2bc2d1714fabdc07a661cbf815d14b36a08990e2)
2013-08-14 13:15:00 -04:00
Waseem Daher 34e0c1e696 Use iframe for Dropbox integration.
This lets us avoid popping up a separate browser window (which would
not currently work in the desktop app).

This closes Trac #1673.

(imported from commit eb1990d8021600fc4d3870f6ec3a28f7111036c3)
2013-08-14 11:05:14 -04:00
Waseem Daher 13d3b4ab59 Less confusing placeholder names for "Share the Love".
(imported from commit cd904510b8aa7bf2b4e6d63aaa43bd48e6bb8966)
2013-08-14 10:12:34 -04:00
Tim Abbott 91a3935b92 Fix sending unnecessary pointer updates to server after reload.
(imported from commit 5297d7339e2fc363e825b20ddd7279f9878dbe2f)
2013-08-13 18:09:19 -04:00
Tim Abbott f6b7aed0c9 Save the original initial_pointer when updating it on reload.
(imported from commit 1fe4332282e521240d3a24428f3f7c318233258a)
2013-08-13 18:09:19 -04:00
Steve Howell 1c9749d21e Debounce update_faded_message on the trailing edge.
This resolves trac #1675, without introducing the problem that
caused us to set the immediate flag in the first place.  (Some
commits just prior to this eliminate some slowness with rendering
by taking the debounced function out of the code path.)

(imported from commit 8c72f25a9d5eb38376957f222b9413d3167fa386)
2013-08-13 17:14:07 -04:00
Steve Howell a1fa7c1b04 Remove unneeded calls to update_faded_messages() in Zulip.
These calls were expensive and unnecessary.  We already update
fade/unfade classes deeper in the call stack, when we render
the messages inside message_list.js.

(imported from commit 08fe028462b6d4569d9798a290dd7b26eb21fb01)
2013-08-13 17:14:07 -04:00
Steve Howell beb89e247f Avoid unnecessary fading/unfading processing via message_list.
The call to compose_fade.update_faded_messages() in message_list
caused us to traverse every message in the current table, which
was extremely inefficient.  Now we call the newly created
compose_fade.update_rendered_messages(), which only fades/unfades the
messages passed in as the first parameter.

(imported from commit a5a47e13fc9daeedd0899b2cfb02beb3f6b8cd0a)
2013-08-13 17:14:06 -04:00
Jeff Arnold ec2f013723 Make the left sidebar and right sidebar more consistent.
Addresses Trac #1500.

(imported from commit ad59d6f78042ce89a99ad60c7c34f67144e9c776)
2013-08-13 16:34:16 -04:00
Jessica McKellar f530e3b930 Display the email address for a stream in its stream page detail.
For now, only show it on staging.

(imported from commit fd07fad1c34578d8ddc2cddd1bb6bdcb72f354de)
2013-08-13 14:28:47 -04:00
Jessica McKellar f7784a2f1d Add a handlebars helper for variadic compound AND conditions.
e.g., from a comment in the commit:

// Execute the conditional code if all conditions are true.
// Example usage:
//     {{#if_and cond1 cond2 cond3}}
//         <p>All true</p>
//     {{/if_and}}

We'll use this for the email forwarding UI, but it may also be
generally useful, and easy to generalize to OR.

(imported from commit da601f94d9da300213ff46be50255135c014eca0)
2013-08-13 14:28:47 -04:00
Luke Faraone af4c34330b Switch to checking database is_bot field instead of using a heuristic.
This has the amusing side effect of showing all the Zulip bots in the
administration view because none of them have the is_bot 	 set.

(imported from commit cdec19d2109c092018c1f331aa32f345d1587683)
2013-08-13 14:20:18 -04:00
Luke Faraone ecc42bc9f8 Add administrative panel to allow for user deactivations etc.
We now show a list of users and allow you to deactivate a user using the
same process as `python manage.py deactivate_user`.

We add a new menu item accessible from the gear icon which will eventually
have much more than just this, but we have a good start here.

Here we also add a property to UserProfile which determines whether you're
eligible to access the administration panel, and then have code which shows
the menu option if so.

This introduces a new JS file, admin.js.

(imported from commit 52296fdedb46b4f32d541df43022ffccfb277297)
2013-08-13 14:20:18 -04:00
Steve Howell 78d8153e6b Remove compose box flicker after sending messages.
We remove the calls to clear_box()/hide_box() and start(),
so that we don't mutate a bunch of UI elements needlessly.
Everything that start() does either never made sense in a
just-after-message-sent context, or it was necessary prior to
this fix only because of what happened in clear_box() or
hide_box().

This change closes out trac #1672, "Clean up always-open code."

(imported from commit bedaa719eb05e166a4bac562784da0cce8859700)
2013-08-13 14:12:29 -04:00
Steve Howell 8f11ce7485 Remove redundant calls to send_status.hide()
One of the calls was obviously a typo dup, and the other
call is already covered by clear_box().

(imported from commit 448dc4c0f265cc7260ea08f0468a7d1440903e3c)
2013-08-13 14:12:28 -04:00
Steve Howell 5248c68fb7 Extract compose.show_box_for_msg_type()
(imported from commit 886717cbc73d0d662ccbd96091e94b85864d0049)
2013-08-13 14:12:28 -04:00
Steve Howell 86b337ca75 Extract compose.same_recipient_as_before()
(imported from commit 2ba8589127e3a0e86c00bb52a22be01bcad48a5d)
2013-08-13 14:12:28 -04:00
Steve Howell 6314089e26 Extract compose.fill_in_opts_from_current_narrowed_view.
(imported from commit e89c6c7f42aa8fdfd77e879e6d9f43dd67744ea6)
2013-08-13 14:12:28 -04:00
Steve Howell 0879648f0e Remove respond_to_cursor flag.
The prior commit, which was a functional fix, made the
flag obsolete.

(imported from commit 203a080106b00e0355a1223f783bbe579430b4ad)
2013-08-13 14:12:28 -04:00
Steve Howell 2b2587d70b Stop using old reply recipient in always-open compose.
Due to the code removed in this diff, we would put you
back to your original reply stream/topic/sendee

(imported from commit 6e1f4666e3b32b057e692e015782780f7c734445)
2013-08-13 14:12:28 -04:00
Steve Howell 6686ca04d2 Remove feature_flags.always_open_compose from code.
The flag has been set to true for a while, so we removed
the flag and a bit of dead code associated with it.  This
change should not affect any functionality on any realm.

(imported from commit 8d457f52584173994d0e5e83ca326f892cd90057)
2013-08-13 14:12:27 -04:00
Steve Howell ad10cecdd7 Extract mark_summarized().
(imported from commit 14a1c69392ec6ca8cb0ec72196368a195dd4c6fa)
2013-08-13 11:26:12 -04:00
Steve Howell d27feeed62 Extract code to summary.js.
(imported from commit 51d958b27e53555f5f77d6e6b661eade57190e23)
2013-08-13 11:26:12 -04:00
Zev Benjamin 62f607fd5e Debounce fading on the leading instead of the trailing edge
(imported from commit 11d0e8938c1f29cfea0678330e7af9884844af21)
2013-08-12 18:07:30 -04:00
Jessica McKellar 29a64b6c59 Only suggest declaring bankruptcy once.
Use information from the server to figure out if we should prompt for
bankruptcy, rather than trying repeatedly inside load_more.

(imported from commit ccb8cb1ce482b8bf3d343e7324fef7981880282d)
2013-08-12 17:33:40 -04:00
Waseem Daher 9ea08a35c5 Refactor: move attachment-related code into compose.js
(imported from commit 4436f0799a9c1a00e964962d4d0d165e03b641b7)
2013-08-12 17:22:23 -04:00
Waseem Daher dfb60ee966 File uploads using Dropbox.
(imported from commit c552133fc7025eca526fbfef24fd544260d7111b)
2013-08-12 17:22:23 -04:00
Waseem Daher 067bd390ac Remove kiosk mode.
We instead implemented the ~desired functionality here using the
API and a bot to make a totally read-only, static, slowly-updating
view into the Zuliverse.

This is the moral equivalent of reverting deb035b4c702fcdb0e660ed549fe74c682abb6d9

(imported from commit 9d743fe82f197b37f005e5a038f77cc4b8566024)
2013-08-12 16:19:53 -04:00
Waseem Daher f44176020e kiosk: Suppress user-info popover.
(imported from commit bda1714a49ea0cfa4ad0ec6447c7bb3fcf8b866b)
2013-08-12 16:19:53 -04:00
Steve Howell 878ee2b3fd Move Filter class to filter.js from narrow.js.
1) The class Filter now lives in its own module.
2) The function canonicalized_operators() is now a class method on Filter.
3) The function message_in_home moved to filter.js and became private.
4) Various calling code had to change, of course.
5) Splitting out Filter helped simplify a few tests.

(imported from commit e41d792b46d3d6a30d3bd03db0419f129d0a2a7b)
2013-08-12 13:58:32 -04:00
Zev Benjamin 46eb90a238 referral: Clean up display of validation errors
* We now clear the validation errors when the input box is de-focused
* We make the left sidebar height accommodate the validation error messages

(imported from commit 4b39bfd3e8e8dd707722492a3f98967ee4ccf0ab)
2013-08-12 12:50:33 -04:00
Zev Benjamin 51beeba854 referral: Prevent empty form submission
(imported from commit cc012e84c21bc424adaaa79611f09415480a2ba5)
2013-08-12 12:50:32 -04:00
Zev Benjamin 16f2a6e284 referral: Only show "no more invites" message when you first deplete your invites
(imported from commit 831e8aa466c4c4e463e269bad75078d1328fe286)
2013-08-12 12:50:32 -04:00
Zev Benjamin 848242399c referral: Hide explanatary text after first referral
(imported from commit 91460b80e2f45b9eaf2f24b3c1eb75ded884c445)
2013-08-12 12:50:32 -04:00
Zev Benjamin 126fcd42d7 referral: Show feedback immediately and don't show errors
(imported from commit 3bf6071c4fdeeaa50ea05c60b4bf0244c78ebeb0)
2013-08-12 12:50:32 -04:00
Steve Howell c4e168254c Fix too-much-fading regression and remove spurious classes.
To get to the bottom of the too-much-fading regression,
it was necessary to clean up the code, which was overly
complicated by multi-purposed functions.

The API for compose_fade now has these functions:

    set_focused_recipient
    start_compose
    clear_compose
    update_message_list
    update_faded_messages

Internally there is now a notion of "normal display",
so e.g. when you want a normal display, we call
_diplay_messages_normally() internally, which removes the
faded/unfaded classes from all messages.

(imported from commit 7eb2b0a163f29d9ebae26661f432fecc7c331e4c)
2013-08-12 11:54:27 -04:00
Tim Abbott e2413e8137 Defer processing of get_old_messages results during tutorial.
Previously we would just discard the results of get_old_messages,
which meant that any messages sent either while you were doing the
tutorial or that you started out with (as in the case of the CUSTOMER3
experiment) would be lost until you reloaded.

(imported from commit f5280c091ab6ed7c2af6eb8fe49c0fa6b997ac97)
2013-08-12 10:17:18 -04:00
Waseem Daher 41e88c89d8 kiosk: Try to suppress notifications.
(imported from commit dfb37bbf1e119ceeb719906c2623c6ea70e3112a)
2013-08-11 21:31:17 -04:00
Steve Howell e720737cb5 Tune fade/unfade bouncing from 150ms to 50ms.
This makes fade/unfade start sooner (good), but it might
re-introduce some typing sluggishness (bad).

(imported from commit 4e3112ed1ac931f2931182f91b60567ef2d72695)
2013-08-11 18:18:01 -04:00
Steve Howell 6591c79184 Un-debounce fade/unfade when starting a compose.
When starting a compose, call compose_fade.set_faded_messages,
which will immediately do fade/unfade logic, whereas before
the code path went thru debouncing logic.

(imported from commit 7d0b30435be32a7132dbf05bf064b03b925a2d42)
2013-08-11 18:08:36 -04:00
Steve Howell 6cc5c43e59 Move code into compose_fade.set_focused_recipient().
Move code from compose.update_fade() into
compose_fade.set_focused_recipient(), which makes it
so that we only have to send the msg_type.

(imported from commit c17665d9f34f525bdedcd36d39d3a112fa36a914)
2013-08-11 17:54:50 -04:00
Steve Howell 8190cdc9fb Avoid redundant O(N) work in unfade_messages()..
The code in unfade_messages() is O(N) over the number of
messages, but a simple flag allows us to track the fact that
all messages are unfaded, so we can short circuit the O(N)
logic in many cases.

A typical scenario now would be that you start typing a
stream while the topic is still empty.  Modulo debouncing,
every keystroke now leads to a call to unfade_messages(),
but this change only does real work the first time.

(imported from commit da07cf408bbdbf5b381ff3ec33a5e05e34eef5b5)
2013-08-11 17:05:13 -04:00
Steve Howell 37f8cc9294 Extracted code into compose_fade.js.
The compose_fade has three public exports:

    set_focused_recipient
    unfade_messages
    update_faded_messages

All code was pulled directly from compose.js, except for the
one-line setter of set_focused_recipient.  The focused_recipients
variable that used to be in compose.js was moved to compose_fade.js,
hence the need for the setter.

(imported from commit 462ca5d0d0bd58612d0197f3734a8c78de8c6d30)
2013-08-11 17:05:13 -04:00
Waseem Daher 0dcaf9ca3d Kiosk mode [unsafe].
"Kiosk mode" is a "read-only" Zulip suitable for embedding into
an iframe on another site. I say "read-only" in quotation marks,
because the account is still a fully-fledged active account on
the server, and we just tear out a bunch of stuff in Javascript
(that a malicious user could easily re-enable).

So in that sense, it's not actually safe in security-sensitive
environments -- malicious users logged in via kiosk mode
can do anything the kiosk-mode user can do.

(We need this functionality for the customer3 realm specifically;
 we'll possibly just tear this code back out once that experiment
 has run its course.)

(imported from commit deb035b4c702fcdb0e660ed549fe74c682abb6d9)
2013-08-11 15:57:21 -04:00
Steve Howell dbcbeb17d4 Debounce update_faded_messages to once per 150ms.
This is an attempt to make the compose box less sluggish.

(imported from commit b1450216da0a92fc69e0d129a74e76eca37df1b5)
2013-08-11 12:01:24 -04:00
Steve Howell 35af96a807 Add hasClass() optimization for fading.
(imported from commit 859e5c2ad731e16d4b4a7de80e574ee5131888fc)
2013-08-11 10:49:11 -04:00
Waseem Daher 8aa80f6800 Disable browser spellcheck in desktop app.
This fixes Trac #1567.

This is kind of a big hammer approach, though. If we did support
spellcheck on other platforms (without doing more work), this might
actually potentially disable it.

But we don't, so this is mostly a non-issue for now.

(imported from commit 74dcb42b19c37e1e8d1e9a2b265e1e6ae0cc2c67)
2013-08-09 18:53:22 -04:00
Zev Benjamin 222f6194e2 Fix key lookup when canonicalizing operators
(imported from commit 59d460bfaa50c0872918d1e5a22efb98d15ce669)
2013-08-09 17:35:58 -04:00
Zev Benjamin ec9322fc87 Use Dict everywhere we have keys based on potentially dangerous, user-supplied data
There are also one or two places we don't need to use it for security
purposes, but we do so for consistencey.

(imported from commit aa111f5a22a0e8597ec3cf8504adae66d5fb6768)
2013-08-09 17:35:14 -04:00
Zev Benjamin 0cfc8fae9f Add basic Javascript Dict implementation
(imported from commit 9f2fb089eb6e269549de26b37bd588355757d22c)
2013-08-09 17:20:14 -04:00
Zev Benjamin e0eddabeb1 Add util.enforce_arity
util.enforce_arity takes a function and returns a new version which
throws an error if an incorrect number of arguments (as determined by
the function prototype) are passed.

(imported from commit 20e69a6dc7b6f8455726ab4fae8d5b7b04dc4103)
2013-08-09 17:12:23 -04:00
Waseem Daher 1f80302668 Use 12-hour time (with some exceptions).
(imported from commit 0cb3cfe23c8696368e3dc8ac51eaa5419928f6f5)
2013-08-09 14:32:02 -04:00
Steve Howell 6790ed79cc Add a unit test for activity.js.
This includes slightly invasive, but harmless, changes to
the production code.

(imported from commit ff40af504de2360ada866508da262e0d2e9f7ad9)
2013-08-09 13:11:59 -04:00
Steve Howell cf1d94edef Add a test for stream_color.js (pick_color).
(imported from commit a49f96a4a7b61ef51c057e8a3f11c116d77ebb49)
2013-08-09 12:29:02 -04:00
Steve Howell cc73619a9d Add unit tests to narrow.js.
This includes slightly invasive, but harmless, changes to
production code.

(imported from commit 847557c11088b75c836cc399d0af75353a8faa3a)
2013-08-09 11:59:32 -04:00
Steve Howell 48b4fed555 Use _.where and _.pluck in subs.subscribed_streams().
(imported from commit b6ff77f3d762c88ed6f04c9eb9ca9135b6eeb8ca)
2013-08-08 19:09:14 -04:00
Steve Howell 9c994265c6 Randomize stream color assignments.
This fixes trac #1357, which says that some users get annoyed
when the system keeps generating the same color for them, which
would happen if they didn't like #76ce90 and kept picking a
new color for their streams.

(imported from commit 0fdb726aad4009332cc056a5e98bb39e01ef414c)
2013-08-08 18:22:44 -04:00
Steve Howell 7d67716c21 Simplify code to generate new stream colors.
Instead of splicing up a cloned copy of stream_assignment_colors
every time somebody uses a color, we just rebuild a hash
of used_colors from our subscribed streams when we need to assign
a color, and we avoid calling into stream_color.pick_color() when
a stream already has a color.

This change has a slight functional impact in the situation where
a user unsubscribes some streams during their session, because
we weren't "reclaiming" colors before on unsubscription, but the
simple approach gets that for free.

(imported from commit adf360365bdf1ae9db99c533a0bde62d91f5dfe8)
2013-08-08 18:22:44 -04:00
Steve Howell e36fd929bc Created stream_color.js.
This is a pure refactoring that mostly just moves code from
subs.js to the new stream_color.js and updates module references
accordingly.  In order to prevent introducing some exports,
update_stream_color was given an additional "sub" parameter
and update_stream_sidebar_swatch_color was given an "id"
parameter.

Killed off unused initial_color_fetch var.

(imported from commit b7644ce67f50d31fb46f564d758d661eea776aa6)
2013-08-08 18:22:44 -04:00
Kevin Mehall 2dfcd7876d Copy only specified properties from messages to summary row fake messages.
See previous commit message for why.

(imported from commit 53241f3aab3ec48a90cd9a280a0e5ec4a19e33cd)
2013-08-08 17:54:52 -04:00
Waseem Daher 49849a214f New onboarding step: Set up an integration.
(imported from commit 2c6cc6f703e893b44b2871c9510e858743d417ad)
2013-08-08 17:23:27 -04:00
Waseem Daher 1e92b17b1a Replace "Get the app" popup with a link.
The popover had a tendency to be obnoxious and hard to close.

This fixes Trac #1661.

(imported from commit d0ad8bd5b643abd9e7add76bc029458dacbd76cf)
2013-08-08 17:23:27 -04:00
Steve Howell 71e138b1aa Suggest more topics.
Examine up to 300 topics for search suggestions.

(imported from commit 8d52dd4d857818dcf59222bfdd956ee800342894)
2013-08-08 14:53:11 -04:00
Kevin Mehall 9be559858e Summarization style improvements
(imported from commit 4029d96d60cae0c6856067a696a842c39f4248e3)
2013-08-08 13:04:01 -04:00