Commit Graph

22 Commits

Author SHA1 Message Date
Anders Kaseorg
28f3dfa284 js: Automatically convert var to let and const in most files.
This commit was originally automatically generated using `tools/lint
--only=eslint --fix`.  It was then modified by tabbott to contain only
changes to a set of files that are unlikely to result in significant
merge conflicts with any open pull request, excluding about 20 files.
His plan is to merge the remaining changes with more precise care,
potentially involving merging parts of conflicting pull requests
before running the `eslint --fix` operation.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-11-03 12:42:39 -08:00
Anders Kaseorg
d17b577d0c js: Purge useless IIFEs.
With webpack, variables declared in each file are already file-local
(Global variables need to be explicitly exported), so these IIFEs are
no longer needed.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-25 13:51:21 -07:00
Anders Kaseorg
46e562f990 bootstrap: Change tooltip html default to false.
Bootstrap v2.2.0^2~40^2~6 changes this default to false, so this is a
prerequisite to upgrading Bootstrap, and it’s also safer.

This closes an HTML injection path via user full names in the emoji
reaction tooltip.  It doesn’t appear to be exploitable for cross-site
scripting because we disallow `>` in full names, and the code happens
to be written such that the next `>` is in a different parser
invocation.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-09-19 20:53:10 -07:00
Anders Kaseorg
db0b33842c templates: Replace templates.render with require calls.
This removes an unnecessary layer of indirection and allows webpack to
catch filename mistakes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg
141088586b Completely replace perfect-scrollbar with SimpleBar.
perfect-scrollbar replaces both the appearance and the behavior of the
scrollbar, and its emulated behavior will never feel native on most
platforms.  SimpleBar customizes the appearance while preserving the
native behavior.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-05-17 12:06:51 -07:00
Yashashvi Dave
3c4971edc1 subscriptions: Fix error when guest user is subscribed to public stream.
When guest user is subscribed to public stream, it throws json
error. Because when guest user is subscribed to public stream,
the `stream-sub-count` element is not initialized.
This commit fix this error, by editing the function
`rerender_subscribers_count` to intialize the element
first, when guest user is subscribed.
2019-05-13 17:47:22 -07:00
Yashashvi Dave
3f38fc6b79 streams: Redirect to subscribed-tab on unsubscription for guest user.
This commit add code to redirect guest users to
subscribed-stream-tab and removes the recently-unsubscribed
stream from settings tab on unsubscription.
2019-05-13 17:27:32 -07:00
Yashashvi Dave
46f45f35d2 stream_ui_updates: Add generic initialize_disable_btn_hint_popover func. 2019-05-08 15:09:16 -07:00
Yashashvi Dave
ccd3b49555 streams: Disable sub-btn with explanation if user not allowed to subscribe. 2019-05-07 16:38:36 -07:00
Yashashvi Dave
9d21b61f99 streams: Disable sub-check-btn if user is not allowed to subscribe.
This commit disable the subscription checkmark button in stream list
view, if user is not allowed to subscribe to stream.
2019-05-07 16:33:01 -07:00
Yashashvi Dave
81bcdf2e94 streams: Fix minor false html element selection. 2019-05-06 17:30:33 -07:00
Yashashvi Dave
6ae6da5d22 stream_ui_updates: Move function update_add_subscriptions_elements. 2019-05-06 17:30:33 -07:00
Yashashvi Dave
71e561de76 stream_ui_updates: Extract update_subscribers_list function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave
7d7cf3d786 stream_ui_updates: Extract update_subscribers_count function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave
4cd33f23bc stream_ui_updates: Refactor update-stream-privacy-type function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave
d86ee6b4f0 stream_ui_updates: Extract update_stream_privacy function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave
a593f73e9a static/js/subs.js: Extract update_stream_row_in_settings_tab function. 2019-05-01 17:23:44 -07:00
Yashashvi Dave
7a168216ff stream_ui_updates: Extract update_change_stream_privacy_settings. 2019-04-30 14:37:30 -07:00
Yashashvi Dave
ecc165b899 stream_ui_updates: Extract update_regular_sub_settings. 2019-04-30 14:37:24 -07:00
Yashashvi Dave
2d1b80e2b4 stream_ui_updates: Extract update_settings_button_for_sub. 2019-04-30 14:37:14 -07:00
Yashashvi Dave
859ba9e892 stream_ui_updates: Extract update_check_button_for_sub func. 2019-04-30 14:37:05 -07:00
Yashashvi Dave
3649a9f15c subs: Add stream_ui_updates.js module for managing ui elements.
This commit adds `stream_ui_updates.js` module. This module
will includes functions which will update different ui elements
(i.e. subscription button, subscriber count).
2019-04-30 14:36:52 -07:00