Commit Graph

10622 Commits

Author SHA1 Message Date
Gittenburg 0706de2305 docs: Make tabbed sections accessible from keyboard.
Part of #15948.
2020-07-29 11:40:39 -07:00
Gittenburg ccaab2d471 docs: Restore link focus outline in sidebar.
Not having a focus outline is very bad for accessibilty.
Browsers have it by default but we completely disabled it for links in
the sidebar in 9955580251.

Showing the outline when selecting a page in the sidebar can be
distracting, so we hide the outline for the highlighted sidebar link.
Since every focusable element however should have a focus outline, we
make the highlighted link unfocusable by setting tabindex=-1 (which also
makes sense since the link to the current page doesn't do anything
anyway).

Part of #15948.
2020-07-29 11:40:39 -07:00
Anders Kaseorg b9fd2a2b37 webpack: Inline getExposeLoaders abstraction.
We only have two of these and don’t intend to add more.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg 767ad1d90e debug: Remove debug from globals.
This is used rarely enough that it’s easier to document how to use it
as a non-global than to document the horrifying things that might go
wrong as a global.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg 226598edc4 js: Use Handlebars as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Priyansh Garg c752f955de registration: Improve registration form.
Improved markup of help-text.
Showing Email as plain-text instead of disabled input.
Changed page heading to 'Create your organization' in realm creation form
and 'Create your account' in normal signup form.
Grouped org settings and user settings with fieldsets.
Reduced space between Password field and Password strength bar.

Also, updated the corresponding test cases.

Partially Fixes: #15750.
2020-07-28 17:07:25 -07:00
sahil839 dcc24992b9 streams: Store list of stream ids instead of names for sorting.
We will store list of stream ids to sort streams instead of names.
We have added a compare_function for sorting the list of stream_ids
by comparing stream names.

This change helps us to remove a couple of get_sub calls and using
stream ids instead of name also helps in avoiding bugs caused due
to live update on renaming of stream.
2020-07-28 17:01:17 -07:00
sahil839 ed96758614 stream_data: Add subscribed_stream_ids function.
We add a function subscribed_stream_ids which returns an array
of stream ids of all subscribed streams.

This is a prep commit for changing the logic for sorting streams
to store stream ids instead of names.
2020-07-28 16:57:50 -07:00
Aman Agrawal 08701d0287 recent_topics: Add support for vim keys.
User can now user `j`, `k`, `l`, `h` keys to navigate along
with arrow keys, which is inline with our message navigation
hotkeys.
2020-07-28 16:33:32 -07:00
Aman Agrawal b34d46e00b css: Rename #home id to #message_feed_container. 2020-07-28 16:33:32 -07:00
Aman Agrawal 0859a91b14 hashchange: Go through hashchange to narrow to All messsages.
We should not allow every function who wants to narrow to All
messages to come up with their own method to do so. This
commit makes existing such functions use hashchange library to
do so.

Remove click event on All message button, it already contains
an <a> tag which navigates correctly.
2020-07-28 16:33:32 -07:00
Aman Agrawal 8b29c38e62 info_overlay: Make them overlays from quasi-overlays.
We always use hashchange.go_to_location method now to open the
info_overlay, this makes sure that the url hash are reliable and
hotkeys don't get confused if an overlay is open or not.

We don't want to change hash to "" (this also doesn't navigates
us to 'All messages' view, hence the bug was not noticed.) on
exit of info_overlay.
2020-07-28 16:33:25 -07:00
Gittenburg 87d8a54b91 help: Stop collapsing sidebar sections.
Three reasons:

1. The sliding was disorienting.
2. The collapsing disallowed searching for other pages with Ctrl+F.
3. The collapsing mechanism wasn't accessible (not usable with the
   keyboard / no ARIA tags).

Tweaked by tabbott to center the left sidebar on the selected page.

Part of #15948.
2020-07-28 16:28:58 -07:00
Mohit Gupta 49d0d7f3cc popovers: Export user_sidebar_popped function in popovers.js.
This is a preparatory commit that exports user_sidebar_popped function
so that it can be used in hotkey.js for keyboard navigation support in
popover in right sidebar.
2020-07-28 16:17:18 -07:00
Mohit Gupta 4c8827aef6 popovers: Export popover_items_handle_keyboard from popovers.js.
This commit is a preparotory commit to add support of keyboard
navigation by enabling movement using arrow keys and clicking of items
using enter key. So popover_items_handle_keyboard function so that it
can be resused other places.
2020-07-28 16:12:29 -07:00
Mohit Gupta 6bccadd0b6 popovers: Export focus_first_popover_item function from popovers.js.
This commit is preparatory commit to adding support for keyboard
navigation by focusing om first menu item of all of our popovers. So
exporting focus_first_popover_item so that it can be reused in other
places.
2020-07-28 16:12:11 -07:00
Gittenburg 253ae8ee51 css: Remove hover effect over active sub filter.
Previously when hovering over a selected topic in the left sidebar
a barely different hover color was employed (and overriden in the dark
mode). This resulted in a small UX issue because after selecting a topic
in the sidebar it should immediately be colored as such (and not just
after moving the mouse cursor away).
2020-07-28 15:30:54 -07:00
Gittenburg 12fe4301e5 css: Unify sidebar hover effects.
Previously the left sidebar used a darker hover background than the
right sidebar, presumably to stand out more when hovering over an active
filter (which have a blue background in the light theme).  This can be
more elegantly solved by using a transparent hover background.
2020-07-28 15:30:54 -07:00
Gittenburg 2367d56f74 integrations: Fix the search input autofocus.
There were two problems preventing the autofocus:

* The focus was triggered at the wrong time.
* transition: all; affected the visibility, making browsers
  abort the focus since the input was still hidden.
2020-07-28 15:17:00 -07:00
Anders Kaseorg e350e57747 js: Fix more incorrectly converted trigger calls.
Commit a9ca5f603b (#15863) incorrectly
converted these too; indexing a jQuery object gives you a DOM element.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 12:43:17 -07:00
Anders Kaseorg a1fec42574 blueslip_stacktrace: Add missing exception handlers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 11:01:35 -07:00
Anders Kaseorg 0e0baca41e typescript: Enable strictNullChecks.
Let’s do this right from the beginning instead of making a mess to
clean up later.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 11:01:35 -07:00
Anders Kaseorg a43307bc4e js: Use Moment.js as a module.
Note that require("moment") and require("moment-timezone") resolve to
the same thing, but the latter adds timezone support as a side effect.
So I went with the latter in every file where .tz is used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg 584d6bfa41 stats: Use Plotly.js as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg eb09c137cf click_handlers: Use WinChan as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg 114cc1ec25 settings_profile_fields: Use SortableJS as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg 1d59fc272c js: Use Marked.js as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg bcab7efb37 js: Use XDate as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg c66931d4cd js: Use clipboard.js as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg f0021df3d4 people: Use blueimp-md5 as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Hashir Sarwar 946836455c typeahead: Fix binding of event handler to `blur` event.
This was a bug in 0f76e98 that prevented typeahead from
closing unless we select an option from it.

Fixes #15905 and #15907.
2020-07-27 17:52:19 -07:00
Vinit Singh 1f54918c8a message_controls: Use a template instead of passing html as a string.
This commit adds a handlebar template for the View source/Edit message
button in message controls in the message view.

This change also fixes the broken html titles that were added in
commit fdbab54614, and adds proper
internationalization for the title text.
2020-07-27 11:05:44 -07:00
Ryan Rehman 15c5dadb73 message view: Move live update logic of stream name to `message_store`. 2020-07-27 11:00:31 -07:00
Ryan Rehman 131a1dd54f message view: Move live update logic of avatar url to `message_store`. 2020-07-27 11:00:31 -07:00
Ryan Rehman 06d0dc1ffa message view: Move live update logic of full name to `message_store`.
This is done to decouple our message view related update events
from MessageListData as there are plans to create multiple
MessageListData objects. Instead we update the `stored_messages`
which tracks the complete data for all messages.
2020-07-27 11:00:31 -07:00
Ryan Rehman e85bc853d6 message list: Refactor and update API to include `rerender_view`.
This is a necessary prep commit as our message live update
functions will call this function, outside the MessageList class.
2020-07-27 11:00:31 -07:00
Anders Kaseorg 0b4483c8d2 settings_panel_menu: Convert make_menu to an ES6 class SettingsPanelMenu.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg 025f49dbc4 poll_widget: Convert poll_data_holder to an ES6 class PollData.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg 2e94914be4 list_cursor: Convert list_cursor to an ES6 class ListCursor.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg 9d90ae0e69 fetch_status: Convert FetchStatus to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg a1796325de buddy_list: Convert buddy_list_create to an ES6 class BuddyList.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg a1295936a4 message_list_view: Convert MessageListView to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg 8e5574fbe6 message_list_data: Convert MessageListData to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Anders Kaseorg 7249103ab4 message_list: Convert MessageList to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 17:00:05 -07:00
Steve Howell 49db62c240 refactor: Have markdown depend directly on emoji.
Now that emoji is in our shared library, we can
require it directly from markdown without
re-introducing any `window` dependencies.
2020-07-26 16:50:14 -07:00
Anders Kaseorg d2520cd7e0 js: Replace underscore with lodash and remove it from globals.
Tweaked by tabbott to bump PROVISION_VERSION.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 16:12:06 -07:00
Anders Kaseorg 9c7a3cc0f4 compose: Replace accidental usage of underscore for “translation”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 16:08:52 -07:00
Steve Howell 0eb206f97e mobile sharing: Make emoji.js a shared ES6 module.
This is a pretty straightforward conversion.

The bulk of the diff is just changing emoji.js
to ES6 syntax.

There is one little todo that can be deferred
to the next commit--we are now set up to have
markdown.js require emoji.js directly, since
it is no longer on `window`.
2020-07-26 16:07:17 -07:00
Steve Howell a028aa5f8a emoji refactor: Avoid util dep with minor hack.
We copy in a one-line function from util that
will soon be replaced with lodash.
2020-07-26 16:07:17 -07:00
Steve Howell 92ed76e3c1 emoji refactor: Pass in emoji_codes from ui_init.
We don't want emoji.js to depend on a JSON file
(and specifically the location of said JSON file)
when we start sharing our code with mobile.
2020-07-26 16:07:17 -07:00
Steve Howell 3e30a7f66e emoji refactor: Move function higher in file.
This preps for ES6 linting rules.  (And it's
nicer for now, too.)
2020-07-26 16:07:17 -07:00
Steve Howell 979c126b07 emoji refactor: Avoid unnecessary exports.
`default_emoji_aliases` was around for a while, and
the `server_realm_emoji_data` was added really
recently by me (oops).
2020-07-26 16:07:17 -07:00
Steve Howell aedf1660f8 dispatch tests: Make realm_emoji test more robust.
The main thing here is that we check that the
actual data got put into our data structures.

(In general we want to move away from stubbing
data modules; any place where we stub data modules
is a relic of earlier days, where we were just
trying to set the bar for 100% line coverage,
even though some of the original coverage was
quite shallow.)

I also use real stubs instead of noops for
the calls out to UI-oriented modules.

In passing I tweak some comments in the actual
dispatch code.
2020-07-26 16:07:17 -07:00
Steve Howell 69c082e2f6 refactor: Have emoji_picker pull from emoji.
This makes it so that the authoritative holder
of all emoji data is emoji.js, and all our
UI components that need emoji data consistently
pull data from emoji.js as needed.

Or to put it another way, we no longer need the
dispatch module to know that emoji_picker is
coupled to emoji precisely by the active_realm_emojis
data; it can now make fewer assumptions.
2020-07-26 16:07:17 -07:00
Steve Howell 6e9d9b42ca refactor: Rename func to emoji_picker.rebuild_catalog. 2020-07-26 16:07:17 -07:00
Steve Howell ef40767edf emoji: Promote blueslip.error to caller.
The only function that called blueslip had only
one caller, and we are trying to get emoji.js
ready for ES6.
2020-07-26 16:07:17 -07:00
Anders Kaseorg 7727dae441 shared: Add missing katex dependency to shared package.json.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-25 12:22:25 -07:00
Vishnu KS 5b0b1efb15 support: Add functionality to approve sponsorship requests.
This should make it much easier to process these requests.
2020-07-24 17:55:38 -07:00
Vishnu KS 1a1396d07e support: Show customer plan details in support page. 2020-07-24 17:37:41 -07:00
Anders Kaseorg b900e38dc6 topic_list: Convert widget to an ES6 class TopicListWidget.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:58:22 -07:00
Anders Kaseorg 4517c48de2 todo_widget: Convert task_data_holder to an ES6 class TaskData.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:58:22 -07:00
Anders Kaseorg c5e397d469 tictactoe_widget: Convert tictactoe_data_holder to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:58:22 -07:00
Anders Kaseorg cd913b7ebc sent_messages: Convert message_state to an ES6 class MessageState.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:56:28 -07:00
Anders Kaseorg daf5a78e98 search_suggestion: Convert make_attacher to an ES6 class Attacher.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:56:28 -07:00
Anders Kaseorg f96bd3839c user_search: Convert user_search to an ES6 class UserSearch.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 41778d81d2 unread: Convert unread_topic_counter to an ES6 class UnreadTopicCounter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg e5ff78e893 unread: Convert unread_pm_counter to an ES6 class UnreadPMCounter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 44053eba3f unread: Convert make_bucketer to an ES6 class Bucketer.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 557e88df77 pm_conversations: Convert recent to an ES6 class RecentPrivateMessages.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 2bf6731f5a stream_topic_history: Convert per_stream_history to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg e47fd521e3 stream_list: Convert build_stream_sidebar_row to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 2aae92b6e3 stream_list: Convert stream_sidebar to an ES6 class StreamSidebar.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 0ad8da139e stream_data: Convert BinaryDict to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 30e4b51731 stream_create: Convert stream_name_error to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg 3319848768 stream_create: Convert stream_subscription_error to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:50:23 -07:00
Anders Kaseorg ba4ef5bf90 blueslip: Convert Logger to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:40:42 -07:00
Anders Kaseorg 58c84940f4 blueslip: Convert BlueslipError to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:40:42 -07:00
Anders Kaseorg abe52e2191 filter: Convert Filter to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:40:42 -07:00
Anders Kaseorg aee95ecf7e util: Convert CachedValue to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:40:42 -07:00
Anders Kaseorg 4ad00c1aea lightbox_canvas: Remove old-style window.onload handler.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:32:53 -07:00
Anders Kaseorg fc21417d67 lightbox_canvas: Convert LightboxCanvas to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:32:53 -07:00
Anders Kaseorg d5a0ee612f lightbox_canvas: Make parameter type error fatal.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:32:53 -07:00
Anders Kaseorg c4024e30c2 debug: Convert IterationProfiler to an ES6 class.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 16:32:53 -07:00
Gittenburg 8f99820120 composebox_typeahead: Remove deprecated workaround.
The Chromium bug[1] was fixed in 2015.

[1]: https://bugs.chromium.org/p/chromium/issues/detail?id=32865
2020-07-24 15:31:26 -07:00
Anders Kaseorg 5f0bd44d58 notifications: Fix incorrectly converted focus method call.
Commit a9ca5f603b (#15863) incorrectly
converted this; window is quite obviously a DOM element, not a jQuery
element.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 14:48:47 -07:00
Anders Kaseorg f0c4cc9e46 js: Fix new import/order errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 13:04:07 -07:00
Steve Howell f5bc454b3a emoji: Remove dependence on page_params.
This sets us up to make emoji a leaf module.
2020-07-24 12:57:52 -07:00
Steve Howell 5280b87f19 emoji refactor: Let emoji.js own the data.
We now only use page_params.realm_emoji at
intialization time, and then settings_emoji
gets the data from emoji.js.
2020-07-24 12:57:52 -07:00
Steve Howell d11c6686a1 minor: Remove parameter to populate_emoji.
This is an easy prep step to help out phase
out page_params.realm_emoji.

All callers pass in what's effectively
page_params.realm_emoji.  (The dispatch
code does it indirectly.)
2020-07-24 12:57:52 -07:00
Steve Howell cc31403112 mobile sharing: Move fenced_code.js to shared/js.
We also take fenced_code out of the global namespace,
since it only requires katex and underscore.

And we fix the exports to be ES6 style.
2020-07-24 12:57:52 -07:00
Anders Kaseorg ea7effbe8a recent_topics: Skip non-stream messages in update_topics_of_message_ids.
Fixes an exception when deleting a private message, introduced by
commit 5d5434ec2f (#15803).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 10:58:21 -07:00
Vinit Singh fdbab54614 i18n: Translate Edit/View Source button's hmtl tooltip text.
This commit tags the html tooltip text for internationalization.
2020-07-24 10:54:34 -07:00
Vishnu KS 3ec64b6092 team: Include users without an associated GitHub profile.
Including anon=1 in API requests will retrieve all contributors
of the repo. If there is no asscoiated GitHub account present for
the commits then the email and name of the author mentioned in
commit messages is returned.
2020-07-24 10:51:47 -07:00
Anders Kaseorg e3b3df328d eslint: Replace sort-imports with import/order.
import/order sorts require() calls as well as import statements.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 09:42:56 -07:00
Anders Kaseorg a83c2c6296 eslint: Make subdirectory configurations more consistent.
Enable ES2020 everywhere except Casper.  Disable Node-specific globals
in static.  Disable browser-specific and CommonJS globals in shared.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 09:42:56 -07:00
Anders Kaseorg 40be4df57a lint: Format JSON files with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 09:42:56 -07:00
Gittenburg f9459bba12 upload: Do not open compose box when editing.
Previously editing a message and uploading a file in
the edit textarea opened the message compose box.

Fixes #15890.
2020-07-23 11:29:32 -07:00
Anders Kaseorg e123f8f723 subs: Fix set_muted parameter order.
The status_element parameter is optional, and the other caller in
stream_popover.js does not provide it.  This fixes a regression in
commit e6a66063a9 (#15868).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-23 11:22:47 -07:00
Gittenburg 02485441fd message_edit: Fix invisible delete spinner.
Introduced in 953d475274.
2020-07-23 10:24:15 -07:00
Vishnu KS 6b9e7a4022 team: Rename contrib_total_commits to calculate_total_commits. 2020-07-23 10:22:28 -07:00