Commit Graph

3423 Commits

Author SHA1 Message Date
Zev Benjamin 300e57fcbd Fill memcached caches synchronously before restarting the server
(imported from commit a45fa845e94a1fc6e96a1aafca31e9a6fc2b7526)
2013-06-05 16:33:43 -04:00
Zev Benjamin 2f7f0da27f Use a per-deployment memcached key prefix
Some cache keys used by Django (like sessions) will not have the key
prefixes, but those values shouldn't change across most restarts.

(imported from commit 2fe61028111fe9d5700432214a611b3341412654)
2013-06-05 16:33:43 -04:00
Zev Benjamin 826b895a2c Avoid using djcache directly
(imported from commit 2a8f0135c7e31ecc30628420e521c8f708c656c5)
2013-06-05 16:33:43 -04:00
Zev Benjamin f38fb33388 Lighten edit diff colors
(imported from commit a2f5778890cbc031f1b95f55a91689e5ee5332e3)
2013-06-05 14:26:46 -04:00
Steve Howell 8be0ea972a Cosmetic: move function up in file.
This just moves keep_pointer_in_view() to be adjacent to recenter_view()
in the file.

(imported from commit 27056e2a949ffef262ac21130436f7303fd2935f)
2013-06-05 13:50:02 -04:00
Steve Howell 042cd8f222 Handle large/gigantic messages when recentering.
(imported from commit d57e702f504a9a3e6b7049a19217671902df4ab7)
2013-06-05 13:50:01 -04:00
Steve Howell 4c8a293750 Scroll more like barnowl again. (but closer to the edges)
We are moving back to a barnowl-ish scrolling algorithm for
the arrow keys, where when you have a message selected toward
the bottom of the screen, hitting down arrow and up arrow
effectively puts the originally selected message at the center
of the screen.  In order to avoid unnecessary scrolls, we
are making it so that you can move the pointer closer to the
edges.

(imported from commit c08233d6d2034a04469b8f424b39d94a230cafe0)
2013-06-05 13:50:01 -04:00
Leo Franchi 92256ab48f Add a TESTING_DEPLOYED settings key, and don't send stats for it
(imported from commit cd73317814a240f7df180f546a9eb6937bb368bb)
2013-06-05 12:57:47 -04:00
Leo Franchi 5a8cc44ba8 Don't autoselect all users in create stream listing
(imported from commit dae00c632d860386255d063db295d707b396b18a)
2013-06-05 12:57:47 -04:00
Leo Franchi b5cadeca73 Backport bootstrap-typeahead click fix to make clicking on autocomplete more reliable
This is the patch described here:

https://github.com/twitter/bootstrap/issues/2715
92189b87ad

That commit has not been upstreamed to bootstrap due to bureaucracy issues.

(imported from commit 3c4a109b58f403569a41f5048ab347a800f029c2)
2013-06-05 12:02:08 -04:00
Steve Howell c7ab489260 Remove dead code in notifications_bar.
I removed references to the following:
    on_custom
    custom_message
    current_message
    show_custom_message()
    clear_customer_message()

(They were not being used anywhere.)  Also, show() does not
receive a msg parameter any more.

(imported from commit 8ec347b40fc9fa582317d68e85c98258cf3fba2f)
2013-06-05 09:35:21 -04:00
Tim Abbott 34e2edb220 Change tutorial instructions for how to reply.
(imported from commit 5204ff60763da990ea27d572adb6810324c0d764)
2013-06-05 09:29:27 -04:00
Zev Benjamin 4bf3cf1c67 Fix whitespace
(imported from commit 27ad5cda6ce439f81fb0ab231ef43303f2d70736)
2013-06-04 19:33:20 -04:00
Zev Benjamin 5a1f036db3 Use Diff Match Patch instead of difflib for HTML diffing
Diff Match Patch provides more human-readable diffs.  For example,
try replacing "mouse" with "sofas".

(imported from commit 7ced81202ce85d5ef69888c59912e3e44c38cfc8)
2013-06-04 18:18:36 -04:00
Zev Benjamin 0c20f48636 Show changes to edited messages using color highlighting
I didn't use red and green for fear of it not being visible to
color-blind users.  We may need to tweak the colors.

(imported from commit 59c4f1dac549a248783e4c3b3ec472d8cb690df5)
2013-06-04 18:15:45 -04:00
Zev Benjamin df53f54cbd Add library to diff HTML fragments and mark changes
I would really like to parse the HTML we produce from the library to
ensure that we don't generate malformed-HTML.  This is unfortunately
hard because we both want pretty strict parsing and we want to parse
html5 fragments.  For now, we just do a basic sanity check.

We also may want to switch to Google Diff-Match-Patch, as that can
clean up the resulting diffs.

(imported from commit 3772f92135cfd7423c335335f861f2c11462a8db)
2013-06-04 18:15:45 -04:00
Zev Benjamin 835dd6673a Only reselect the selected message on rerender if it's not -1
We could get into this situation when someone is doing a search and
someone else edits a message while the results are still loading.

(imported from commit 99e371fd75c7ae7dc98a0c03bc434e434da44b94)
2013-06-04 16:21:56 -04:00
Zev Benjamin 1d2c1a00bc Improve error reporting for trying to select an unknown message
(imported from commit 4fdc09d11e35eeed2510de6668d5a982c915f8c0)
2013-06-04 16:21:56 -04:00
Zev Benjamin d95ea89f54 Fix a "can't read property 'id' of undefined" user error
`current_msg_list.get(id)` and `rows.get(id,
current_msg_list.table_name)` are not interchangable in terms of
checking for whether we have a message.  The former checks whether
the message is in the current message list while the latter checks
whether the message is in the current message list and currently
rendered.  `message_edit.end` only operates on rendered messages.

(imported from commit 203ee612bfd0aa94571dde9b601e948b3c6f6cbb)
2013-06-04 15:39:51 -04:00
Zev Benjamin 6bd61f458d Don't throw an exception if someone edits a very old message
Previously, if you didn't have a message that someone else had edited
in your message list, you would get an exception because we weren't
checking whether we actually had the message or not.

(imported from commit 33a5c6e7fe95b5397a32df5c7b5f6714d71e1e5f)
2013-06-04 15:38:42 -04:00
Leo Franchi 23b4ad3b02 Add a redis_check management command
(imported from commit 04a272ca8d8288f7e3b1a54fd5d73629bde938a0)
2013-06-04 09:43:09 -04:00
Leo Franchi 0b5b1dafc4 Add a rate limiting system to our backend
(imported from commit a1218618918b4dedc77307e2f277665e7dd8fa22)
2013-06-04 09:43:09 -04:00
Leo Franchi 4b2a2d01e6 [schema] Add a rate_limits column on UserProfile
(imported from commit 3682212d91ce5a91cc2e7d5611da0265518cf18a)
2013-06-04 09:43:09 -04:00
Luke Faraone a73e86cd9f Keep the desktop client updated as to the app's new message count.
(imported from commit c8deb2a773ee5c82f9d2decdced936f2f18dd4e0)
2013-06-03 13:10:25 -07:00
Luke Faraone c5d3ca0247 Send notifications over the JS→C++ bridge if it exists.
When determining if desktop notifications are enabled, we can check whether
there is a "window.bridge" element.

Now when it comes time to actually send out notifications, we can just test
again for the existence of "window.bridge" and if so, shunt the data over
it.

(imported from commit 8104c91ea9da7bc485c86a3c21edc88905d2f47b)
2013-06-03 13:10:18 -07:00
Steve Howell 3ee4161ace Allow pointer in more places.
Before this fix, the code would restrict the pointer to be above
either the 1/2 mark or 2/3 mark of the page, depending on your
scrolling direction.  This fix makes it so that the system leaves
your scroll and pointer alone when between the 1/5 mark and 4/5
mark.  This means the user can read more messages on the screen
at a time before getting paginated.

(imported from commit 98f6319bf63181dd331e037ac20a0c15518725ea)
2013-06-03 11:04:01 -04:00
Steve Howell 40ce4e0acc Streamline recentering code.
When you make a call to set_message_position(), you already
know that the pointer is gonna be onscreen, so set the flag
to suppress scroll pointer updates.  This should be faster and
also avoid future confusing bugs where recenter_view() and
keep_pointer_in_view() run for the same event.

(Both callers to recenter_view pass in the selected message,
and then the calls to set_message_position() set the scrollTop
so that the selected message shows onscreen.)

(imported from commit f1a6f189b7899b280a6316ea7eb03f015d3d4ae3)
2013-06-03 10:41:04 -04:00
Jessica McKellar a63b0e31a7 Say if a realm is open in the internal signups Humbug.
(imported from commit 5745f3b2fbfbbdc2681628ef1ccb637cc1abb9f3)
2013-06-02 15:12:28 -04:00
Jessica McKellar 79d494282d Use a case-insensitive wrapper around retrieving a realm by its domain.
We were previously able to create realms for different casings of the
same domain.

(imported from commit c13a86c9eb9fb4934bebcda7a578e2a071dd1962)
2013-06-02 15:12:28 -04:00
Jessica McKellar 83a8ed048f Remove unused imports in zephyr/lib/.
(imported from commit 54fa64f34d29ede939d18f3834249b7bff4490e5)
2013-06-02 15:12:27 -04:00
Jessica McKellar bd5bc4fcf7 create_realm: be able to specify an open realm.
(imported from commit 227b89c51c45b2a3fcd343b2a6a986f5212c1b9c)
2013-06-02 15:12:27 -04:00
Jessica McKellar 048a53c1ce Make do_create_realm aware of restricted_to_domain.
(imported from commit bee8d79cd5f5d4165e2a573eb3a91123857be6cd)
2013-06-02 15:12:27 -04:00
Jessica McKellar 67a25614df Remove unused reply argument to do_create_realm.
(imported from commit 6f56c0748a989a8d7163d20f6d9d243c8d96ce87)
2013-06-02 15:12:27 -04:00
Jessica McKellar 088984b31a Don't let CUSTOMER4 users invite new users to the realm.
As requested by the facilitators: only they should be able to invite
new people.

(imported from commit 636e332759b9ad56a8d45115d92326a929472c14)
2013-06-02 13:23:04 -04:00
Leo Franchi df6a93ddb6 Log time spent in markdown to statsd
(imported from commit 736a4ddf0716cf365cfaafd8f22a88de00d126bd)
2013-05-31 15:57:53 -04:00
Leo Franchi a906e1609d Remove 'PM' from missed message subject as we also email you on @-notifications
(imported from commit 0993bae5b6a1e40b462a314c41bd5c2d47b4bc8c)
2013-05-31 15:54:57 -04:00
Steve Howell 303b8174ac Fix trailing whitespace in a couple Python files.
(imported from commit a8338773aa4ff10add6f06c699b395890b9ed3ee)
2013-05-31 15:25:35 -04:00
Steve Howell e558b5bf23 Fix whitespace in code.
(imported from commit 4bb750f886ccffc22d54140c10d39f0f91725156)
2013-05-31 14:19:47 -04:00
Steve Howell cd13488959 Show fade effect in left pane for new mentions.
This also changes the color for the blink effect when you
get private messages.  For simplicity sake, we use the
same color for private messages and mentions.

(imported from commit 46b0f7af1dccefe575004e7676990e5c854a3dcc)
2013-05-31 14:07:34 -04:00
Jessica McKellar b895780c7c Make narrow.operators always return an array.
Previously it could return an array or boolean, and this inconsistent
interface had several latent bugs where consumers of the API only
considered it returning one or the other type.

This also fixes a specific bug a user triggered by being narrowed to
nothing (/#narrow) and clicking in the compose box.

(imported from commit 64ca2a37a9f288066f89b0ddec6638e010704eb0)
2013-05-31 13:51:53 -04:00
acrefoot 6ae117ea5f Re-focus on the compose box after a send, auto-move cursor
Re-focuses on the compose box after a send, under these conditions:
1) narrowed to stream+subject -or- responding to PM/huddle
2) compose was initiated by clicking on a message or hitting "r"/"enter"
3) cursor has not moved since you've started the composition

Additionally, if you are thus narrowed, we will move your cursor when you've sent
a message to that message, assuming that such a message initially appears visible.

(imported from commit 373c858081694e6fc9994639340a847d66edb566)
2013-05-31 13:43:05 -04:00
Steve Howell 66b93d5cfd Fix barnowl style scrolling w/r/t fixed elements.
This change fixes the barnowl scrolling so that the ratios of
1/5, 1/2, and 2/3 are all relative to the visible viewport.

The core part of the fix is that we need to call
ui.message_viewport_info() to get the correct offsets for
the top/height of the actually visible viewport  Because
this function is fairly expensive, I didn't want the
helper functions needlessly re-calling it.  I could
have passed the helper functions the structure, but at
that point it was simpler to inline their functionality.

(imported from commit fb10d99313d568e85acfa70703c4651466acbc21)
2013-05-31 12:51:50 -04:00
Tim Abbott 6100d61f8f Remove 'narrow to messages sent by' from message popover.
Now that this functionality is accessible from the right sidebar, we
don't really need it here.

(imported from commit 34eaef4e1200f9fc673a681f0be87d8008033e83)
2013-05-31 12:24:33 -04:00
Tim Abbott 4558c5e008 Fix tab bar handling of search for 'sender:'.
(imported from commit c054ffee10943a4e6835d4466d57818df6efc7e4)
2013-05-31 12:24:32 -04:00
Tim Abbott 3be4a010e8 Add a sidebar actions popover for the right/user sidebar.
Currently, this is accessed by clicking anywhere in the sidebar region
other than the text of the person's name itself, which does the
existing narrow behaviour.  Later we can make it do something clever
with hovering pulling out the popover or something, but that's
potentially a significant design project I think this is good enough
to be useful.

(imported from commit a2cc5dc851661117a6d438ca48a1ce7585d4eb63)
2013-05-31 12:24:32 -04:00
Tim Abbott 878cd4cf3e Move stream sidebar rows into a handlebars template.
(imported from commit f1f2acecec0a0a1ff86bffc2a0244e015535ce86)
2013-05-31 12:24:32 -04:00
Tim Abbott 4e3ea12dc1 Rename stream sidebar variables/functions to be less generic.
(imported from commit 1d9fe6cd8da513b7a283c08862ce887159fe498e)
2013-05-31 12:24:31 -04:00
Tim Abbott 7d20a697d6 Move user presence sidebar to a handlebars template.
(imported from commit 1f505bbda4ed67da94db8d97e8e58cb2c462d056)
2013-05-31 12:24:31 -04:00
Tim Abbott 74cfadfb74 Rename sidebar_stream_actions to stream_sidebar_actions.
I think it's more intuitive.

(imported from commit bd9939a994e1f9f93fd71d9c71963debfedfff89)
2013-05-31 12:24:31 -04:00
Leo Franchi 56af48cd50 Split wildcard mentions from personal mentions, only email on personals
(imported from commit 18971d9e40dd2c93ef9c30edc963da33e3c65309)
2013-05-31 12:24:31 -04:00