Commit Graph

3076 Commits

Author SHA1 Message Date
Tim Abbott a1885c6ffb message_edit: Add debug logging for missing messages.
This is an attempt to more easily debug a traceback we've seen a few
times.  The issue likely has to do with local echo, which would be
confirmed if this reports a local-echo-style message ID.
2017-08-27 16:11:42 -07:00
Harshit Bansal cd2f41dbb1 popovers: Extend the `compute_placement()` function.
This commit extends the `compute_placement()` function in
`popovers.js` to take into account height/width of popover as well as
positioning preference. If vertical positioning is desired and the
popover fits in either 'top/bottom' positions then we don't check for
`left/right' positions. Earlier the behavior was to prefer
'left/right'positions over 'top/bottom' positions, which resulted in
the emoji picker popping incorrectly to the left.
2017-08-27 12:27:53 -07:00
Harshit Bansal f24582576a emoji_picker: Further improve emoji picker navigation.
This further improves the emoji picker by introducing two new behaviors:

1: If the cursor is at the end of the input box then pressing `right_arrow`
moves the focus down into `emoji_catalog.

2: If the currently focused emoji is the first emoji in the `emoji_catalog`
then pressing `left_arrow` moves focus back to search filter.
2017-08-27 12:04:10 -07:00
Tim Abbott eb4635804f compose: Fix previews of /me messages.
Previously, we didn't do anything special when previewing /me messages.

Fixes #2115.
2017-08-27 09:48:27 -07:00
Tim Abbott e80f93dc42 markdown: Set is_me_message in apply_markdown.
This should make the variable available to things like drafts and
previews.
2017-08-27 09:34:24 -07:00
Tim Abbott 133f005530 markdown: Remove is_me_message UserMessage flags.
This never made sense to be a flag on the UserMessage table, since
it's not per-user state.  And in fact it doesn't need to be in a
database at all, since it's easily computed from content anyway.

Fixes #1099.
2017-08-27 09:34:24 -07:00
Tim Abbott 0f1768d0d1 compose: Fix confusing variable name in preview code path.
This seems to be the root cause of the bug fixed in the last commit.
2017-08-27 09:34:06 -07:00
Tim Abbott eb6d736df3 compose: Fix local rendering of previews.
Apparently, local rendering of previews had broken sometime in the
last few months in a refactoring that resulted in us passing a string,
rather than an object, into markdown.js.
2017-08-27 09:33:52 -07:00
rht 437b2a3146 Update "MacOS" text to "macOS" 2017-08-26 09:00:42 -07:00
Tim Abbott 07a156c400 notifications: Fix desktop/sound notifications for @all.
It appears that previously, these weren't being triggered.
2017-08-24 23:56:10 -07:00
Tim Abbott a2c21543bc mentions: Fix mention state being lost after reload.
This fixes a regression introduced in
bc2069aec2, which caused @-all mentions
to not be displayed properly.

Fixes #5317.
2017-08-24 23:47:55 -07:00
Tim Abbott eb781de78d settings: Fix buggy use of JavaScript regular expressions.
Using weird characters when filtering options items in these various
settings pages would throw exceptions whenever they didn't form a
valid regular expression.
2017-08-24 18:32:01 -07:00
Brock Whittaker d2a4afeacf Change message click => message long-tap event on mobile.
Previously on mobile, clicking on a message would make the compose
box open, but this is a relatively finnicky event whenever scrolling
so we realistically want to open the compose box on long-tap (with
a 750ms delay) to prevent false clicks and provide a closer-to-native
experience.
2017-08-24 16:52:18 -07:00
Brock Whittaker 44636051e4 Make /help/ sidebar more discoverable on mobile/narrow.
This makes the /help/ sidebar more discoverable at windows less
than 1000px in width because it makes it stick out a bit when it
is closed with the hamburger menu at the top.

Fixes: #6038.
2017-08-24 13:38:22 -07:00
Brock Whittaker 321074856e /integrations/: Focus search bar on page load.
This focuses the search bar on initial page load.
2017-08-24 11:38:13 -07:00
Steve Howell b215229d22 unread: Add code to set unread counts from page_params data.
This won't run in production due to the feature flag.
2017-08-23 17:25:52 -07:00
Steve Howell 540c452fc2 unread: Use a an "id_set" for unread_messages. 2017-08-23 17:25:52 -07:00
Vaida Plankyte b2c0ff68c2 frontend: Add hotkey information to title/inline text.
This should make many Zulip hotkeys significantly more discoverable.
2017-08-23 17:12:09 -07:00
Tim Abbott 57dfded339 narrow: Add some clarifying comments. 2017-08-23 12:43:11 -07:00
Brock Whittaker 2bb5042315 Use native `.click` event over jQuery `.click` event.
For whatever reason, the clipboard doesn’t want to work if you use a
jQuery click trigger. Perhaps because the jQuery event trigger doesn’t
create a native event at all. By doing this however, it doesn’t appear
to affect any other code but does allow for the clipboard to work again.

Fixes: #6002.
2017-08-23 12:26:50 -07:00
Brock Whittaker 4617a650c0 Compact two `row.find(".alter-copied")` statements into one. 2017-08-23 12:26:50 -07:00
Tim Abbott 74c628b105 editing: Fix live update of ability to edit messages.
Previously, we didn't check the organization-level settings when
rendering a message list; instead, we only checked it when putting
messages into the message_store.  That resulted in the state being
stale in the event that the setting controlling whether one can edit
messages was changed.

We remove some node tests, because revidving the node test for their
new home in message_list_view would be more work than we probably want
to do with an upcoming release.  We basically need to be better about
exporting functions like populate_group_from_message_container and
set_topic_edit_properties, so we can do fine grained testing.

When we get around to the node tests, rather than exporting these
functions, it might make sense to create a new module with a name
like message_container.js, which would have all of these
last-second type of data manipulations on message objects.  This
would be nice to split out of message_list_view.js.  MLV is our
biggest module, and it's mostly cohesive, but it's real job
should be about assembling messages into a DOM list, which is
probably 80% of the code now.  The 20% that I'd want to consider
splitting out is actually closer in spirit to message_store.js.

Thanks to Steve Howell for helping with the node tests.
2017-08-23 12:03:35 -07:00
Umair Khan f265718854 i18n: Escape settings names in settings status messages.
By default, all text is escaped in i18next. We can use '__- ' to
unescape.

Fixes #6219
2017-08-23 00:22:59 -07:00
Max Schaefer 4825b6e5ad topic_list: Remove a spurious assignment and simplify a conditional.
Variable `show_topic` was assigned in both branches of the
conditional, but the assignment in the "then" branch was useless,
since the variable wasn't subsequently read. Hence the assignment can
be dropped, leaving the "then" branch empty. The "if" statement can
then be simplified by removing the "then" branch entirely and flipping
the condition. Since `show_topic` is now only used inside the "if", it
is slightly tidier (though semantically equivalent) to move its
declaration inside.
2017-08-22 23:49:47 -07:00
Max Schaefer 34f97cfb9a tab_bar: Remove a spurious assignment.
Variable `stream` is a local variable (declared on [line
51](85c3f59292/static/js/tab_bar.js (L51))). It
is not read after this assignment, which hence becomes useless.
2017-08-22 23:49:33 -07:00
Max Schaefer bbe87231cd upload_widget: Remove a spurious argument.
This call refers to the `accept` function on [line
118](85c3f59292/static/js/upload_widget.js (L118)),
which takes no arguments (unlike the `accept` function on [line
33](85c3f59292/static/js/upload_widget.js (L33)),
which takes one argument, but isn't in scope here).
2017-08-22 23:48:55 -07:00
franziskagoltz 61fbf1a7e3 editing: Hide topic-edit-pencil if message editing is disabled.
This fixes a confusing bug where administrators would be offered the
convenient topic-edit pencil even if message editing was actually
disabled.

This doesn't yet fix the real-time sync issues of changing the setting
without reloading.

Fixes #5946.
2017-08-22 19:43:56 -07:00
Brock Whittaker d07281fa66 rename: Change list_rendering.js => list_render.js.
The method itself is called `list_render`, so the file should
reflect that name.
2017-08-22 17:37:36 -07:00
Harshit Bansal 1a43728b1e emoji_picker: Fix tracebacks in navigation if search results are empty.
This fixes 2 bugs:

* If you perform a search and search results are empty then if you try
  to navigate using arrow keys, page-down/page-up etc. it will give a
  traceback.
* Search for example 'a' and then navigate to the last of the search
  results using arrow keys. Now press 'tab' to go back the search box
  and restrict the search to for e.g. 'ab' and now try to navigate
  using arrow keys, page-up/page-down etc you will get a traceback.
2017-08-22 14:48:02 -07:00
Brock Whittaker 09be694ea3 Rewrite scrollbar width check to not use jQuery.
This check was going to do the wrong thing when we upgraded to jQuery 3.
2017-08-22 12:50:54 -07:00
Max Schaefer 8aa5a02866 js: Remove a few spurious arguments. 2017-08-22 09:37:17 -07:00
Max Schaefer 4d0f304048 js: Fix two misphrased conditions. 2017-08-22 09:37:15 -07:00
Aditya Bansal 0dcbacdbc6 emoji_picker: Refactor toggle_emoji_popover to split out to functions. 2017-08-22 08:46:55 -04:00
Vishnu Ks 517d9b7594 /apps/: Detect the user OS and show the appropriate app by default. 2017-08-20 22:11:56 -07:00
Aditya Bansal e1cc0455ee emoji_picker: Fix issue with emoji tab shifting.
In this commit we basically do these things:
* Clear up section_head_offsets before pushing stuff in it so that
its size doesn't keep on growing indefinitely with time and users
opening emoji picker.
* Make use of popover element to find the correct element in DOM
to scan for section elements. This prevents us from filling stuff
twice into section_head_offsets because of presence of two
elements for '.emoji-popover-subheading' in DOM since popover
destroy is an async call.
* Using this popover element also helps in avoiding manuplation
of the DOM elements of the popover that was destroyed (Because
popover destroy is async it still maybe around). One instance of
this is associating scroll event with the right instance of
'.emoji-popover-emoji-map'.
2017-08-18 12:18:39 -04:00
Steve Howell eeb164dfc5 bug: Show the count in the bankruptcy modal.
(This was a recent regression.)
2017-08-17 23:30:41 -04:00
Steve Howell 770ec92891 hotkeys: Fix "n" key to work inside a muted stream.
Normally the "n" key skips over muted streams, but if we
are currently narrowed inside a muted stream, it will now
go to the next topics within that stream.

For me the use case was that I have a stream I check up on
about once a day, and "n" would be super useful for me to
clear out unread counts while still skimming some content,
and without having to temporarily unmute the stream.
2017-08-17 09:01:49 -07:00
Tim Abbott 5e968ce30d stream_list: Use data-topic-name for topic names.
The name data-name was ambigious.
2017-08-16 18:03:44 -07:00
Tim Abbott d9dcdbbbe9 stream_popover: Use data-stream-id when building topic popovers. 2017-08-16 18:03:29 -07:00
Tim Abbott dbae28683c stream_popover: Use data-stream-id when building popover. 2017-08-16 18:03:29 -07:00
Tim Abbott c6d7cfb60b stream_popover: Fetch the current stream by data-stream-id. 2017-08-16 18:03:29 -07:00
Tim Abbott 7d9303cfe8 topic_list: Stop accessing legacy data-stream name field.
We should be using data-stream-id everywhere.
2017-08-16 18:03:28 -07:00
Tim Abbott 88e3ba9576 stream_list: Fix enter key to use data-stream-id. 2017-08-16 18:02:57 -07:00
Tim Abbott 047237e45b stream_list: Remove a reference to data-name in sidebar. 2017-08-16 18:02:56 -07:00
Tim Abbott 4acd7595cd stream_sidebar: Clean up use of ambiguously named data-id.
We prefer to specify the type of data objects wherever possible.
2017-08-16 18:02:29 -07:00
Tim Abbott 78d9fcd23a streams: Remove a reference to data-stream-name. 2017-08-16 18:02:29 -07:00
Tim Abbott 4b72b461e5 user_events: Fix buggy-looking logging code.
The previous logging exception looked like it sorta left off.
2017-08-16 16:23:41 -07:00
Aditya Bansal 7beeef9782 emoji_picker: Export emoji_collection and complete_emoji_catalog. 2017-08-16 19:18:26 -04:00
Aditya Bansal 406806b7df emoji_picker: Start using current emoji categories for rendering. 2017-08-16 19:18:26 -04:00
Aditya Bansal 245d571ae9 emoji.js: Refactor to make better use of initialize(). 2017-08-16 19:18:26 -04:00