Commit Graph

3758 Commits

Author SHA1 Message Date
Brock Whittaker 6c3606cf36 Change admin deactivated users table to render progressively. 2017-05-05 14:14:37 -07:00
Brock Whittaker 7408656218 Improve list_render implementation's edit flow.
The list_render class "list" prop was immutable so when the
data prop would be updated it would not appropriately update
the data inside the primary list for filtering.

This commit also fixes an issue where if a jQuery selection was
passed in, all the nodes rather than just the first get copied over.
2017-05-05 14:14:12 -07:00
Brock Whittaker c8902d5d71 settings: Make settings overlay more responsive.
This doesn't completely fix settings responsiveness, but it's a big
step along the way.  Outstanding issues include:

1. When switching tabs from settings to organization, it will launch
the first item which is more annoying in this view since it brings you
into that tab. Haven’t decided on an elegant solution to this yet.

2. Sidebar scrolling doesn’t work. I have to restructure how the top
section and bottom sections of content are displayed to fix this.
Likely by enforcing min-height of 100% - bottom height on the top piece.

3. Most of it is actually reasonably responsive but some isn’t, and
should be fixed on a case-by-case.
2017-05-05 13:42:09 -07:00
Brock Whittaker 2ae23054ee informational-overlays: Focus overlay body on shortcut "?".
This focuses the body content of the informational overlay after
going to it from "?" so that you can use up and down arrows to then
scroll the content easily.

Fixes: #4480.
2017-05-05 09:53:58 -07:00
Cory Lynch 3d0cf35f49 message_edit.js: Fix bug with ctrl+enter hotkey not working.
This was a regression introduced in ba7b7a9. The ID of the
edit boxes were changed in that commit, but this event
listener was not updated to reflect that.
2017-05-04 19:46:10 -07:00
Brock Whittaker 1bb260325c settings: Improve general table styling.
This generally makes the tables that have thead attributes look
uniform with the tables that use the first tbody column as a thead.
2017-05-04 16:43:34 -07:00
Tim Abbott e219dda071 reload: Fix tracebacks on browsers without local storage.
This fixes an issue where browsers without local storage (aka the
Zulip ancient QT-based desktop app) would throw an exception trying to
reload in modern Zulip.
2017-05-04 16:21:58 -07:00
Tim Abbott a493694e10 reload: Clean up handling of invalid reload tokens.
Previously, we'd log an exception whenever an invalid hashchange
reload token appeared, which is probably a bit excessive given that
this can happen without anything being wrong.

We instead just log something for debugging in the blueslip log and
make sure the #reload hash is cleared.
2017-05-04 16:16:35 -07:00
Tim Abbott f207450cdb presence: Avoid throwing exceptions for "missing users" when offline.
This should eliminate the most common javascript traceback one gets
running Zulip in production.
2017-05-04 16:11:05 -07:00
Tim Abbott a28f5db050 presence: Check for unsuspend status on receiving responses.
This is the first part of handling an annoying race that would cause
us to try drawing the right sidebar using (in part) users that we
haven't learned about yet (because we were offline/suspended when they
were created, and we haven't quite realized our event queue is gone yet).
2017-05-04 16:11:05 -07:00
Tim Abbott b0bd501c0d portico: Remove now-unused hello-footer code. 2017-05-04 16:09:12 -07:00
Brock Whittaker d21e1ccc1c Unify styling on password reset flow pages. 2017-05-04 16:09:12 -07:00
Brock Whittaker 55b1d480ec Fix avatar sizing issue.
The avatars were previously their natural width, however the avatars
should always be 100% width since the height and width of the images
are known to always be equal.
2017-05-04 16:09:12 -07:00
Brock Whittaker 736701f900 Add account_send_confirm styling. 2017-05-04 16:09:12 -07:00
Brock Whittaker 48ac49385e Fix lack of uniformity with box content layout.
The various portico pages had various styling differences that made
them less consistent when responsive.
2017-05-04 16:09:12 -07:00
Brock Whittaker 89242da269 Remove .footer_padder in favor of proper screen tolerances.
This removes the .footer_padder element in favor of just having correct
min/max heights and margins on the footers.
2017-05-04 16:09:12 -07:00
Brock Whittaker 58d00af6c3 portico-pages: Fix flex height issues with content.
This fixes the existing issue where the titles of content is chopped
off when the screen height is too small.
2017-05-04 16:09:12 -07:00
derAnfaenger 37a8a43cc4 Change cursor to pointer when hovering over streams.
Before this commit, hovering over the blank area of a stream
would not reflect its "clickability". This behavior is
inconsistent with other clickable lists, such as the user sidebar.
This commit changes the cursor to a pointer when hovering over a
stream and removes annoying pointer-default-pointer changes when
hovering with the mouse over multiple users in the user sidebar.
2017-05-04 15:55:51 -07:00
Brock Whittaker ed4866b9f9 message-feed: Improve scroll perf by removing scaling on emojis.
This removes scaling from the emojis by changing the background size to
a lower value and then allowing for the widths and heights of the
emojis to be proportionally smaller.

The transform: scale property would cause many more repaints in Chrome
and other browsers than should have been necessary which would render
messages above and below the feed light grey boxes that would
momentarily flash as blank before filling with content.

Modified by tabbott to use a percentage in the background-size.

Fixes #4660.
2017-05-03 14:49:47 -07:00
Tim Abbott b20a24875a emoji: Switch to using iamcal sprite sheets for reactions and pickers.
Without changing how we render emoji in messages or changing the data
set used for emoji names, this switches us to the superior
percentage-based system for choosing which emoji from the spritesheet
to select and the iamcal sprite sheets.

It requires some small changes to CSS to ensure emoji are centered
properly in the new design.

Based on Harshit Gupta's work on "Interrelated emoji infrastructure changes".
2017-05-03 13:30:42 -07:00
Tim Abbott ddd3bbd32c echo: Separate realm emoji formatting from normal emoji. 2017-05-03 13:28:50 -07:00
Cory Lynch 5d6724345a Fix scrollbar stylining for reactions picker.
Scrollbar previously collapsed when searching for
emoji and became misaligned. Fixed in CSS.
2017-05-02 14:23:26 -07:00
Tim Abbott 07db233ffd register: Remove long-unused company-email HTML/CSS. 2017-05-01 17:18:03 -07:00
Rohitt Vashishtha 47eb19331d ux: Display error on login/registration if no auth backends are enabled.
Also makes a small tweak to CSS to ensure the styling is consistent on
the two pages.

Fixes #4525.
2017-05-01 17:17:37 -07:00
Brock Whittaker 2fafc6bec5 Change streams subscriber lists to render progressively. 2017-05-01 16:56:54 -07:00
Brock Whittaker 4e980ad545 Change <thead> styling in settings containers.
Tables were previously improperly using the <tbody> to show the headers
so it was not obvious that the styling for <thead> did not represent
the styling of the rest of the tables anymore, so this normalizes
the styling to be consistent with how it looked when the first row
was in the <tbody>.
2017-05-01 16:56:54 -07:00
Brock Whittaker 0ffdfa3699 Change from `toLowerCase` => `toLocaleLowerCase`.
This now respects the locale of the string set and will lowercase it
respective of the character set rather than standard latin/English.
2017-05-01 16:56:54 -07:00
Steve Howell 23df948457 left sidebar: Scroll to newly pinned streams.
If we pin a stream, we now scroll up as needed to make sure the
stream is still in view after pinning it.  (Note that we don't do
this in the un-pinning case, since users un-pinning stuff may be
doing cleanup on pinned streams they no longer care about.)

Fixes #1714.
2017-05-01 16:39:37 -07:00
Steve Howell 07633b3872 left sidebar: Scroll to newly activated streams.
When we activate a stream (or one of its topics), we now scroll
the sidebar so that the stream comes into view.  We scroll it
just enough to get it to the top or the bottom, depending on
where it had been offscreen before.
2017-05-01 16:39:37 -07:00
Brock Whittaker f599b517d3 Switch checkbox styling to new style in #invite.
The checkboxes in invite are now converted in this commit to the new
style.
2017-05-01 16:01:36 -07:00
Brock Whittaker 3ff55034fe admin: Restyle administration checkboxes to match new style.
This restyles the administration checkboxes to look similar to those
that are currently present in the settings section.
2017-05-01 16:01:36 -07:00
Tim Abbott f4262e0169 message_edit: Fix exception closing "view source".
This fixes a regression introduced in
81a575e4d5.
2017-05-01 15:08:01 -07:00
Tim Abbott 03b7be17a6 settings: Fix unnecessary/ugly exclamations in error messages.
The previous code would produce errors of the form "Failed!: ...".
2017-05-01 14:50:20 -07:00
K.Kanakhin f13d6a18eb realm-emoji: Add realm emoji uploading instead url providing.
- Add file_name field to `RealmEmoji` model and migration.
- Add emoji upload supporting to Upload backends.
- Add uploaded file processing to emoji views.
- Use emoji source url as based for display url.
- Change emoji form for image uploading.
- Fix back-end tests.
- Fix front-end tests.
- Add tests for emoji uploading.

Fixes #1134
2017-05-01 14:50:20 -07:00
Tim Abbott 0785c377a4 zephyr: Fix link to webathena login from error bar.
This was apparently broken when we moved the webathena login errors
out of the right sidebar.
2017-04-30 21:31:25 -07:00
Tim Abbott cfeff245c1 emoji: Manage Zulip emoji as a custom/extra realm emoji.
This is prerequisite for converting our emoji system to work off of
iamcal sprite sheets.

Also, fixes #4308.
2017-04-30 16:40:31 -07:00
Tim Abbott 5321e2e2c1 hotkey: Reorder compose and emoji picker escape handlers.
This fixes an issue where escape could close the compose box, not the
compose emoji picker.
2017-04-30 15:15:33 -07:00
Jack Zhang df817f12f4 emoji: Rename reaction-popover to emoji-popover.
The name emoji-popover should now be more appropiate, as there's no more
need to distinguish between reacting to messages and composing messages.
2017-04-30 15:15:33 -07:00
Jack Zhang a9505654da emoji: Replace the old compose emoji picker with the reactions picker.
This removes the old compose emoji picker in its entirety, changing
the few callbacks needed to launch the reactions-style emoji picker
instead and hook it up properly.

Callbacks for reactions and composing messages are distinguished by
selecting for, respectively, the .reaction and .composition classes.

Fixes #4122.
2017-04-30 15:14:42 -07:00
Jack Zhang 58a92a0eff emoji: Extend reaction_popover_content template for compose. 2017-04-30 15:09:43 -07:00
Tim Abbott 87d06268ca toggle_reactions_popover: Support being passed no message ID.
This is intended to facilitate calling this function for the compose
picker, where there is no message yet.
2017-04-30 15:08:51 -07:00
Jack Zhang 3c257a19c0 emoji-picker: Extract generate_emoji_picker_content.
This is a pure refactor, with no functional changes.
2017-04-30 15:02:12 -07:00
Tim Abbott 66f927762b emoji_picker: Extract compute_placement function.
Thanks to Jack Zhang for identifying this useful refactoring.
2017-04-30 14:41:54 -07:00
Jack Zhang f8b3ce7d15 emoji: Move all emoji picker logic/events into emoji_picker module.
Added emoji_picker.js to static asset pipeline.
2017-04-30 14:13:36 -07:00
Aditya Bansal cab87fef2a Refactor: Extract default-language-modal to be a partial.
We are doing this refactor for the sake of keeping our template
consistent with the indentation policy and maintaining its
readability at the same time.
2017-04-29 08:35:25 -07:00
fionabunny 78f2df5649 home.py: move initial_pointer as pointer to register_ret.
This is the last of the fields in page_params that could come from
register_ret but wasn't doing so.
2017-04-28 23:39:14 -07:00
fionabunny d3e7e6542a home.py: move user_profile full_name to register_ret.
Move the user_profile data section down into fetch_initial_state_data
so it entirely pulls from register_ret for #3853.
2017-04-28 23:31:28 -07:00
Tim Abbott df8f4a837c home: Get page_params.enable_desktop_notifications from register_ret. 2017-04-28 23:15:35 -07:00
Tim Abbott c4eeb13353 account-settings: Always display the medium-size avatar. 2017-04-28 23:09:32 -07:00
fionabunny 4696819629 Restructure format of avatar events and push into register_ret.
This moves the avatar_ fields in page_params to come from
register_ret.  Unlike many fields, changing this had a bit of
complexity, because the avatar update events didn't actually contain
some of the details required for moving these into register_ret to
work correctly without races.

We fix that as part of this change.

Modified significantly by tabbott.
2017-04-28 23:04:01 -07:00
Tim Abbott 2a16cc1d24 home: Get enable_stream_desktop_notifications from register_ret. 2017-04-28 22:01:46 -07:00
Tim Abbott 2a8a101fe2 home: Get page_params.enable_stream_sounds from register_ret. 2017-04-28 21:56:58 -07:00
Tim Abbott 30db811167 home: Get page_params.enable_sounds from register_ret. 2017-04-28 21:54:05 -07:00
fionabunny 78bcbc79d6 home.py: move people_list as realm_users to register_ret.
Simplify the page_params generation logic #3853
2017-04-28 21:33:33 -07:00
fionabunny 7db8c61aac home.py: move event_queue_id as queue_id to register_ret.
Simplify the page_params generation logic #3853
2017-04-28 21:33:17 -07:00
Tim Abbott 27f07e6a99 activity: Remove page_params.presences after use.
This is just meant to avoid there being any confusion about whether
this field does anything after this point.
2017-04-28 21:31:19 -07:00
fionabunny 453fc06686 home.py: move initial_presences as presenses to register_ret.
Simplify the page_params generation logic #3853.
2017-04-28 21:30:29 -07:00
fionabunny 84c4d67916 home.py: move bot_list as realm_bots to register_ret.
Simplify the page_params generation logic #3853
2017-04-28 21:24:44 -07:00
fionabunny a7192f4334 home.py: move neversubbed_info as never_subscribed to register_ret.
Simplify the page_params generation logic #3853
2017-04-28 21:24:44 -07:00
fionabunny 5676eaab50 home.py: move unsubbed_info as unsubscribed to register_ret.
Simplify the page_params generation logic #3853
2017-04-28 21:24:43 -07:00
fionabunny 26d080cf64 home.py: rename subbed_info and move to register_ret. 2017-04-28 21:24:43 -07:00
fionabunny b7c6d46bf9 home.py: move password_auth_enabled as realm_password_auth_enabled.
Part of #3853.
2017-04-28 21:23:48 -07:00
fionabunny 635a05fe80 home.py: move name_changes_disabled as realm_name_changes_disabled.
This appears to have been partially completed prior.  Part of #3853.
2017-04-28 21:12:23 -07:00
fionabunny 70fe2eab60 home.py: move is_zephyr_mirror_realm as realm_is_zephyr_mirror_realm.
Part of #3853.
2017-04-28 21:12:16 -07:00
fionabunny 935ddf3b17 home.py: move show_digest_email as realm_show_digest_email.
Part of #3853.
2017-04-28 21:12:10 -07:00
fionabunny 64041e0da1 home.py: move mandatory_topics as realm_mandatory_topics to register_ret.
Part of #3853.
2017-04-28 21:12:05 -07:00
fionabunny 6d2785c853 home.py: move domains as realm_domains to register_ret.
Part of #3853.
2017-04-28 21:11:56 -07:00
Cory Lynch e972453a73 message edit: Remove Topic and Content labels.
Removed the components from the template and
cleaned up the relevant css.

Fixes #4562
2017-04-28 20:57:06 -07:00
Steve Howell 4762673929 Fix how we calculate fields in stream_data.js.
We used to have code scattered in multiple places to
calculate things like admin options, preview urls,
subscriber counts, and rendered descriptions for
streams before we rendered templates in the "Manage
Stream" code.

These are all consolidated into a new function
called stream_data.update_calculated_fields().

This is mostly code cleanup, but it also fixes a bug where
the "View Stream" button would not work for a newly created
stream.
2017-04-28 17:49:33 -07:00
Rafid Aslam 7b2ef7c1a9 compose: Validate subscriptions in browser when !autosubscribe.
This doesn't quite complete the goals of #4650, which has a plan for
how to remove this entirely, but it causes this problematic code to
now be contained to a very rare case.

Refactored significantly by tabbott just due to rebase age.

Fixes #3629.
2017-04-28 17:46:15 -07:00
Tim Abbott 3f1df50c7b compose: Remove unnecessary check_stream_existence wrapper.
This function had become just an empty shell.
2017-04-28 17:41:12 -07:00
Tim Abbott e0954d8811 compose: Refactor check_stream_for_send error handling.
The extra lines in removed were already part of compose_error.
2017-04-28 17:41:02 -07:00
Cory Lynch 0965c43238 Add typeahead for syntax highlighting languages.
Modified composebox_typeahead.js to recognize the triple backtick
and tilde for code blocks, and added appropriate typeahead functions
in that file and in typeahead_helper.js.

Additionally, a new file pygments_data.js contains a dictionary of
the supported languages, mapping to relative popularity
rankings. These rankings determine the order of sort of the
languages in the typeahead.

This JavaScript file is actually in static/generated/pygments_data.js, as it
is generated by a Python script, tools/build_pymgents_data.py. This is
so that if Pygments adds support for new languages, the JavaScript file
will be updated appropriately. This python script uses a set of popularity
rankings defined in lang.json.

Corresponding unit tests were also added.

Fixes #4111.
2017-04-28 17:22:59 -07:00
Steve Howell 5965dc092a Move check_stream_existence() to compose.js.
The function check_stream_existence() temporarliy got moved
to stream_create.js, and our call from compose.js was still trying
to find it in subs.js.  Now we move the function to compose.js,
since we no longer use it stream_create.js.

This function is pretty dubious, and we may want to only check
for duplicate stream names locally.
2017-04-28 16:17:52 -07:00
Steve Howell d999827465 Improve how we report errors when we name new streams.
When the user creates a stream, we no longer do a synchronous
check on the back end to find if the stream name already exists.
Instead, we only check our local data, which will prevent many
typical errors, and then we let the back end capture duplicates for
stream names that the client doesn't know about.

We also tone down errors when the stream name is blank--we
only whine about empty streams right before submitting the form.

Also, since our check for duplicate streams is less expensive,
we now capture the "input" event instead of the "focusout" event,
so that if you fix up the name to avoid a collision, you get more
immediate feedback.

When we do detect stream name errors, we conveniently focus the
text field to let the user correct the problem.
2017-04-28 16:17:52 -07:00
Rishi Gupta cf90fed418 stats: Remove users_today from Active Users.
It's technically the number of users yesterday. Also, "number of active
users today" suggests something like daily actives today, whereas this graph
currently shows 2-week actives.
2017-04-28 16:15:07 -07:00
Tim Abbott a0e276c54a settings: Fix autocomplete in email change form. 2017-04-28 14:39:18 -07:00
Tim Abbott 6c9daf7c3b alerts: Clean up network error messages a bit. 2017-04-28 12:58:30 -07:00
Brock Whittaker c7cb20d873 alerts: Polish .alert-box .alert styling.
This polishes the styling on the alerts inside of the .alert-box to
have more appropriate colors, margins, and padding.
2017-04-28 12:50:04 -07:00
Cory Lynch ba7b7a9a36 Change edit_message_content to have unique IDs for different messages.
Fixes bugs of when multiple messages are being edited simultaneously.
Specifically, typeahead is no longer broken, copying messages to clipboard
is less buggy, and resizing is no longer
broken when multiple messages are being edited.
2017-04-28 12:15:34 -07:00
Cory Lynch 81a575e4d5 Add cleanup for resize listeners on message editing.
I changed the watch_manual_resize function to return the listener
functions it creates, and then these are used to remove the event
listeners before the edit box is hidden.
2017-04-28 12:15:34 -07:00
Cory Lynch f9d1bff167 Fix textarea resize for editing messages.
Reusing code from the main compose_message component so that resizing now
behaves correctly. This means that when the user tries to resize vertically,
the autoresize code is disabled, and the textbox reverts to manual resizing.
Fixes #4573
2017-04-28 12:15:34 -07:00
Brock Whittaker dcc2b3a900 left-sidebar: Restructure <a> to cover the <li>.
This restructures the <a> tag to be clickable essentially anywhere
within the <li> tags, unlike before where due to it being “inline”, you
had to hover over the text in particular.
2017-04-28 09:56:15 -07:00
Brock Whittaker e7ac6710e9 Resize <li> text and align icons.
This resizes the text of the line items to be 5% larger and aligns
the #global_filters icons to be centered vertically.
2017-04-28 09:56:15 -07:00
Steve Howell 0ced7cfc55 Make newly subscribed streams appear active.
When you subscribe to a stream, we now set a newly_subscribed
flag on the object, and we return true during the is_active()
call.

This solves the problem that immediately after you subscribe, you
don't have any messages in the stream, so it would appear active
by our old criteria.

This is still something of a workaround, as once you reload, the
stream will become inactive again, unless other messages come in.

A more permanent solution here would be to have the backend
indicate newly subscribed streams to us (apart from the initial
event), but we may not really need that in practice.
2017-04-28 07:40:25 -07:00
Steve Howell f9b3ff8f68 Change argument type for stream_data.is_active().
The function now takes a "sub" object instead of a stream
name.
2017-04-28 07:39:52 -07:00
Brock Whittaker 7afbc9ddd6 Redesign login and registration pages.
This completes a major redesign of the Zulip login and registration
pages, making them look much more slick and modern.

Major features include:
* Display of the realm name, description and icon on the login page
  and registration pages in the subdomains case.
* Much slicker looking buttons and input fields.
* A new overall style for the exterior of these portico pages.
2017-04-26 18:04:05 -07:00
Brock Whittaker 6e512dddcb left-sidebar: Make <li> height and icon size consistent.
This makes the height of the list-items all 24px and changes
the home icon to be a slightly larger 16px instead of 14px which
looked visually smaller than the other icons.
2017-04-26 17:13:03 -07:00
Cory Lynch 088d881159 compose: Improve ordering in streams typeahead.
The new logic has 4 tiers of priority:
* Whether a match is found in the name, start of description, middle
of description, etc.
* Importance to the user / activity -- more specifically, the order
used in the left sidebar. This means pinned streams first, active
streams, then inactive streams.
* Subscriber count: How big is the stream?  Bigger is better.
* Alphabetical ordering is a final tiebreak.

Fixes #4508.
2017-04-26 12:46:14 -07:00
Brock Whittaker 2fce6a4dc3 message-feed: Fix message drag uncaught errors.
There is a mechanism to prevent a user from "clicking" on a message
if they drag over it, to allow people to copy message contents without
triggering the compose box to open.

In the case that a user would start dragging from outside a message
and finish dragging within a message, data on where the cursor started
at is missing.

This is fixed by checking if start data exists and if it doesn't, we
just throw a drag distance of Infinity which will tell the program to
not count the action as a "click" on the message. This now does not
have an uncaught error because it instead validates "start" as existing
before attempting to access its properties.
2017-04-26 12:31:14 -07:00
Tim Abbott 5d7aa4fae7 hashchange: Fix buggy narrowing to wrong message.
Due to a past refactoring, the from_reload argument to do_hashchange
changed from having true/undefined as the possible values to
true/false instead.  The check that sets the from_reload and
first_unread_from_server narrow options was thus incorreclty treating
from_reload of false the same as a from_reload of undefined.

As a result, if the browser had been loaded with a
page_params.initial_narrow_pointer (aka via the background reload code
path), then for the duration of that browser session, every time one
narrowed via a hashchange rather than an explicit click handler (which
apparently includes clicking on a PM thread in the left sidebar), we'd
end up narrowing with a then_select_id of the that initial narrow
pointer, not the correct first unread message.

The fix is simply changing the check for truthiness, not undefined, in
do_hashchange.
2017-04-26 12:07:56 -07:00
Umair Khan f4a9651346 reload: Garbage collect previously preserved state.
This fixes a minor local storage data leak.

Fixes: #4545.
2017-04-26 09:14:46 -07:00
Umair Khan 58a82e7c55 localstorage: Allow regex based delete. 2017-04-26 09:11:44 -07:00
Aditya Bansal e961d6a834 Clean account-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 6f49579e65 Clean actions_popover_content.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal acef0b1f32 Clean bot_avatar_row.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal ae2585ac8d Clean admin_user_list.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal af880b8bab Clean ui-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 73cd6948de Clean realm-filter-settings-admin.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal d5bb128f56 Clean notification-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 338c2d618a Clean display-settings.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal a2d0976002 Clean deactivation-user-modal.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Aditya Bansal 4219bec14f Clean auth-methods-settings-admin.handlebars to use 4 space indents. 2017-04-26 00:16:22 -07:00
Tim Abbott b43385ec34 Shrink max display width of topics.
This fixes an issue with topic names overlapping in the left sidebar.
While we're doing that, it makes sense to shrink the maximum size of
the topic input box, to discourage sending with topics that will be
cut off.
2017-04-25 17:51:47 -07:00
Brock Whittaker 3d64d190c1 Change right sidebar unread counts to be rounded.
This changes the right sidebar unread count styling to match the left
sidebar styling — in that they all now should have a 4px border radius
on the edges of the unread count blocks.
2017-04-25 17:47:36 -07:00
Brock Whittaker c506a92d05 left-sidebar: Restyle to have new look.
This restyles the color swatches to either be locks or hashes,
and changes the notifications to be rounded rather than squared.
2017-04-25 17:47:36 -07:00
digi0ps 8fb9d2bff3 settings: Redesign settings/administration panel buttons.
This redesigns all the ugly bold-colored buttons in the settings and
administration pages.
2017-04-25 16:33:59 -07:00
Cory Lynch 0d9b77c8b7 composebox_typeahead.js: Add typeahead cancelling for '# '.
If somebody types '# ', then close the typeahead dialog and
don't autocomplete. Relevant node tests were also added.

Fixes #4505.
2017-04-25 15:55:23 -07:00
digi0ps 1cc9cb969b sidebar: Make topic name width consistent. 2017-04-25 11:58:33 -07:00
digi0ps eb852ef19e sidebar: Move chevron in the stream list further from the scrollbar.
Previously, the chevrons were too close to the scrollbar. This commit
fixes that by moving it farther from the scrollbar.
2017-04-25 11:58:33 -07:00
Steve Howell 8eb86335b9 Extract narrow_state.js.
Despite the length of this commit, it is a very straightforward
moving of code from narrow.js -> narrow_state.js, and then
everything else is just s/narrow.foo()/narrow_state.foo()/
(with a few tiny cleanups to remove some code duplication
in certain callers).

The only new functions are simple setter/getters that
encapsulate the current_filter variable:

    narrow_state.reset_current_filter()
    narrow_state.set_current_filter()
    narrow_state.get_current_filter()

We removed narrow.predicate() as part of this, since it was dead
code.

Also, we removed the shim for narrow_state.set_compose_defaults(),
and since that was the last shim, we removed shim.js from the app.
2017-04-25 09:57:32 -07:00
Steve Howell 7326971380 Extract stream_edit.js.
This code makes the right pane work in "Manage Streams" when
you are editing a stream subscription.  It handles basic
functionality (submitting forms, etc.), live updates, and
showing the pane as needed.

Most of the code here was simply moved from subs.js, but some
functions were pulled out of larger functions:

    live update:
        add_me_to_member_list
        update_stream_name
        update_stream_description

    collapse/show:
        collapse
        show_sub

We also now export subs.show_subs_pane.

We eventually want stream_edit not to call into subs.js, and
this should be fairly easy--we just need to move some shared
methods to a new module.
2017-04-25 09:57:32 -07:00
Steve Howell ca2aea8d01 Extract stream_create.js.
This new modules handles the UI to create streams.  It mostly moves
code from subs.js.

It introduces an API around what used to be called meta.stream_created:

    reset_created_stream()
    set_name()
    get_name()

It only partially moves new_stream_clicked().
2017-04-25 09:57:32 -07:00
Cynthia Lin ef2ff9f9a0 integrations: Remove deprecated Stash integration. 2017-04-24 22:35:23 -07:00
Harshit Bansal 6cb03ea78e frontend: Add UI necessary to change emoji set.
Note that this code is disabled until the infrastructure for the
feature can be finished.

Tweaked by tabbott to use slightly cleaner names for the various sets.
2017-04-24 22:31:30 -07:00
Brock Whittaker ba51c077be Add assets for portico signin pages.
This adds some of the required assets for the portico signin pages such
as logos and validation signals.
2017-04-24 16:19:18 -07:00
wangjames 744f4aa663 Fix modals dependency cycle.
This commit forces the files that create modals to create their own
modal closing function instead of creating all of them in the modals
file. These functions are then passed to the modals.close object. This
is intended to remove modals.js's dependencies on these other files.
2017-04-24 14:30:02 -07:00
Steve Howell c999bdf823 compose: Distinguish get_message_type() from composing().
We now only call compose_state.composing() in a boolean context,
where we simply care whether or not the compose box is open.  The
function now also returns true/false.

Callers who need to know the actual message type (e.g. "stream" or
"private") now call compose_state.get_message_type().
2017-04-24 12:42:06 -07:00
Steve Howell d938afaedc Extract narrow.narrow_to_next_topic().
This borrows some code from a PR from Mahim Goyal.
2017-04-22 11:46:47 -07:00
Shayan Toqraee 534c951ec4 Add rtl.js library for detecting direction of text.
This comes complete with some documentation and node tests, and is a
key step towards implementing RTL support in Zulip.
2017-04-22 11:25:54 -07:00
Steve Howell ddbe877909 Add narrow.stream_topic(). 2017-04-21 21:59:22 -07:00
Steve Howell 6ddbf12376 Add topic_generator.get_next_topic(). 2017-04-21 21:59:22 -07:00
Steve Howell 079885770b Add unread.topic_has_any_unread(). 2017-04-21 21:59:22 -07:00
Steve Howell 4871b491f3 Add Dict.is_empty(). 2017-04-21 21:59:22 -07:00
Steve Howell b27180a645 Have next_topic() return stream/topic objects.
We now use "map" to have our inner generator of topics be
mapped to objects with both the stream and topic.  Thanks to
Mahim Goyal for helping with this design.
2017-04-21 21:59:22 -07:00
Steve Howell d332df8cc6 Add topic_generator.map(). 2017-04-21 21:59:22 -07:00
Tim Abbott f4a4c23380 KaTeX: Fix path to KaTeX bundle in production. 2017-04-21 14:56:19 -07:00
Tim Abbott 7d8d9c1bf9 Fix message-edit animations being displayed after sending.
This fixes a regression in 3041480600
that would cause anything rendered on the backend differently than on
the frontend to experience this animation.

We actually only want to do the animation when the message content was
changed in a way that generates an edit history event, i.e. a
user-facing edit, not in cases where we're either transparently
swapping in post-backend-rendering content (e.g. with link previews)
or cases where there's a discrepancy between the exact HTML from the
frontend and backend markdown processes (e.g. mentions).
2017-04-21 11:46:35 -07:00
Steve Howell cc6c0104c8 Refine compose box behavior for topic narrows.
The comments that were added in the code for this commit explain
the cases here, but essentially for topics, we need to decide
among a few possible behaviors with regard to composing:

- Leave it closed.
- Cancel the compose.
- Leave the compose box as it was before.
- Fill in the new topic.

Before this commit, we were cancelling compose in all cases (or
leaving it closed).

Now we leave it alone in some cases where there is already content.
And we fill in the topic when the stream was correct and the topic
was empty.

Fixes #3300
2017-04-20 16:15:07 -07:00
Tim Abbott b3c8562bd9 css: Remove use of under-specified 'thin' borders.
This was causing buggy behavior in our emoji reactions when zoomed to
200%.
2017-04-20 15:07:26 -07:00
Tim Abbott f3c36147d9 /me: Fix alignment of name with non-/me messages. 2017-04-20 14:58:22 -07:00
Brock Whittaker 83d51b2bdb Hide status message on edit.
When editing a /me, the status message element should be hidden.
2017-04-20 14:36:17 -07:00
Brock Whittaker 323ff6edca /me: Fix presentation and markup for /me statuses.
This fixes the /me elements to be display inline-block and inline
rather than display block with top and left properties.

This also fixes an unrelated issue with emoji reactions not being
able to be clicked on with /me messages.

Fixes: #4218.
2017-04-20 14:36:17 -07:00
Joshua Pan 728594c74a activity.js: Stop opening compose box in user search.
This prevents compose box from opening when you
just press enter with an empty search field in
user search.

Fixes #4376.
2017-04-19 22:18:08 -07:00
Brock Whittaker 3041480600 message-edit: Fade in message on update.
When a message update comes back from the server and replaces an
old message, it should fade in. There are two components to the fade:

1. The message fades in from opacity: 0 =>  1.
2. The "edited" text will transform from X: -10 => X: 0.
2017-04-19 22:14:58 -07:00
Steve Howell c7a9a02667 Consolidate code for narrow/compose interactions.
This commit extracts the method compose_actions.on_narrow()
to handle changing the compose box (as appropriate) after
any narrowing action.

This change should be mostly non-user-facing, but it's not
exactly a trivial extraction.

For the case where the user already had content in their
compose box, we continue to leave the compose box alone,
but we now update compose fading 150+ lines later in
narrow.activate().

Likewise, for cases where we cancel composing, this will
also happen later in the function.

Finally, for PM narrows, where we auto-open the compose box, we
no longer call compose.cancel() before calling compose.start(),
because either a) the compose box would have not been open
in the first place or b) the start() function can handle
clearing the old fields.
2017-04-19 10:06:00 -07:00
Tim Abbott 326cf9a73e stream_list: Add divider before dormant streams in list.
Fixes #4309.
2017-04-19 09:18:29 -07:00
Steve Howell 7962710132 Remove 40-streams criterion for flagging dormant streams.
Before this change, we would move "dormant" streams to the bottom
of your stream sidebar, but only if you had 40+ streams.

Now we do this in all cases to be more consistent.

This commit also changes the redraw strategy when we remove rows.
Before this change, we were doing incremental updates, but now we
call build_stream_list to do a complete rebuild.  This was partly
motivated by adding the new divider, which would have complicated
the incrememental approach when you removed the last remaining
dormant stream.
2017-04-19 09:18:18 -07:00
Steve Howell 9591b3a95b Extract stream_sort.js. 2017-04-19 09:16:37 -07:00
Joshua Pan 4fb450d4a9 hotkey.js: Add reactions popover navigation.
Fixes #4197.
2017-04-18 23:25:45 -07:00
Joshua Pan a7327422a8 reaction.js: Create reaction_navigate(). 2017-04-19 06:17:15 +00:00
Joshua Pan abda711c66 reaction.js: Extract reaction_show_list functions.
This creates get_emoji_at_index() and
find_index_for_emoji() functions, which search for
emojis and indices in reactions_show_list. Update
maybe_select_emoji with newly created functions.
2017-04-19 06:17:15 +00:00
Joshua Pan e075c84ca5 reaction.js: Maintain reaction_show_list.
This updates reaction_show_list whenever the popover
gets opened and whenever the search filter for reactions
gets used.
2017-04-19 06:17:15 +00:00
Joshua Pan cd28ea6d07 reaction.js: Update toggle_reaction().
Created get_selected_emoji() function.
toggle_reaction() now doesn't require emoji_name
and automatically looks for a selected_emoji
if possible.
2017-04-19 06:16:30 +00:00
Tim Abbott 540bfce83f reactions: Use perfectScrollbar for emoji reactions scrollbar.
This fixed the fact that the scrollbar for this popover was super ugly
on Linux, while also ensuring that we have a consistent 6 emoji per
row in the popover (an important detail for the arrow hotkeys).
2017-04-18 22:58:11 -07:00
Joshua Pan c6d0e49cdf Add tabindex to reaction popover content handlebars. 2017-04-18 22:31:08 -07:00
Steve Howell 70b7d4c00b Extract compose_state.js.
This is mostly just moving methods out of compose.js.

The variable `is_composing_message`, which isn't a boolean, has
been renamed to `message_type`, and there are new functions
set_message_type() and get_message_type() that wrap it.

This commit removes some shims related to the global variable
`compose_state`; now, `compose_state` is a typical global
variable with a 1:1 relationship with the module by the same
name.

The new module has 100% line coverage, most of it coming
via the tests on compose_actions.js.  (The methods here are
super simple, so it's a good thing that the tests are somewhat
integrated with a higher layer.)
2017-04-18 12:26:58 -07:00
Tejas Kasetty 7e4155cd42 update_emojis: Handle the case involving deletion of realm emoji. 2017-04-18 12:18:52 -07:00
Tejas Kasetty d227a8e35c compose: Re-render emoji picker when realm_emoji is added/deleted.
* reset the emoji popover in case of an event
regarding update of realm_emoji.
* test-node-with-js: Add dependency - popovers module;
In dispath.js to support popovers object.
2017-04-18 12:18:52 -07:00
Tejas Kasetty b7aa81f122 compose: Render the emoji picker only once.
* Whenever the emoji picker is opened a call is made to render
  the emoji's. This rendering happend everytime the emoji picker
  was opened. Thus, resulting in duplicates of emoji's getting
  appended in the emoji picker over multiple open and close.

* This commit, is a fix to render the emoji's only once when the
  emoji picker is opened for the first time. Further calls just
  toggles the emoji picker showing the already rendered emoji's.
  This enhances the performance of Emoji picker considerably
  because there is no overhead of making a request to get the emoji's
  from the server, each time the emoji picker is opened.

* Other changes -- on closing the emoji picker, the compose box
  remains in focus.

Fixes: #4300.
See Also: #3952.
2017-04-18 12:18:52 -07:00
Joshua Pan 6fe567846c Extract drafts_scroll() function.
Fixes #4334.
2017-04-18 12:14:41 -07:00
Joshua Pan 0377b5aba6 Extract drafts_initialize_focus().
This function takes care of focusing a draft if a draft
is not already focused in draft modal.
2017-04-18 12:14:41 -07:00
Joshua Pan 6fe26b6c04 Extract drafts process enter key to drafts.js.
Extracted draft code from hotkey.process_enter_key to drafts.js.
2017-04-18 12:14:41 -07:00
Aditya Bansal 065dd9ae10 Clean emoji-settings-admin.handlebars to use 4 space indents. 2017-04-18 12:06:31 -07:00
Aditya Bansal 1f09e38101 Clean bot-settings.handlebars to use 4 space indents. 2017-04-18 12:06:30 -07:00
Aditya Bansal c12f93efc4 Clean stream_privacy.handlebars to use 4 space indents. 2017-04-18 12:06:28 -07:00
Aditya Bansal c98cf5ba63 Clean message_edit_history.handlebars to use 4 space indents. 2017-04-18 12:06:28 -07:00
Aditya Bansal 23f8ec9759 Clean single_message.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 5f7c89b087 Clean stream_sidebar_row.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 83da92c316 Clean recipient_row.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 0494944f3f Clean draft.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal face3562af Clean subscription_settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal bdcff375ab Clean deactivated-users-admin.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 4c1b89a2ef Clean attachment-item.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal e5d57c31b8 Clean muted-topics-settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 2a15fa17b9 Clean admin_auth_methods_list.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal c0ca8b10ed Clean deactivation-stream-modal.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 0e906b683d Clean realm-domains-modal.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 257b930492 Clean admin-realm-domains-list.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal e21731c1ae Clean streams-list-admin.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 71c5444b86 Clean alert-word-settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal b11866c2a8 Clean message_edit_form.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Steve Howell 78803b2e56 Add narrowed_by_topic_reply() helper. 2017-04-17 22:54:36 -07:00
Steve Howell 9d4f0bf704 Open compose box more aggressively for PM narrows.
We now auto-open the compose box whenever somebody narrows to
a "pure" PM narrow.  We already did this for buddy list clicks,
so this make it work the same for other ways of narrowing to
PM conversation.  Here, we optimize for composing, vs. reading,
since PM conversations tend to have lots of back and forth.

(Contrast this to stream conversations, where there's a higher
likelihood of lurking or doing a quick narrow to re-read some
message from the stream.)
2017-04-17 22:54:36 -07:00
Steve Howell bdca28a14b Avoid opening compose box for topic sidebar clicks.
We don't want to auto-open the compose box for topic
sidebar clicks, because we want to convenience folks
reading messages, not writing messages, since on
stream narrows, people tend to do much more reading
than writing.  (Also, opening the compose box explicitly
is super easy.)

The part of this change that affects behavior is that
we remove the call to compose_actions.start('stream').

Then the simplification is that we replace the checks
to narrowed_by_reply() and !narrowed_to_topic() with
a single call to narrowed_by_pm_reply().

Fixes #3886.
2017-04-17 22:54:36 -07:00
Steve Howell af887822b5 Add narrowed_by_pm_reply() helper. 2017-04-17 22:54:36 -07:00
Italo Batista d77d7dc493 analytics: Add a 'me' option for messages_sent_over_time.
With some tweaked by Rishi Gupta.

Fixes #3630.
2017-04-17 22:18:24 -07:00
Cynthia Lin 0e6815fbf6 user docs: Document nested list bullets.
Fixes #4456
2017-04-17 21:51:14 -07:00
Cynthia Lin 619238ecf8 integrations: Strip metadata from integration logos to reduce file size. 2017-04-17 21:37:19 -07:00
Cynthia Lin 1e8bd51608 integrations: Fix warped Zendesk logo.
Fixes #4523
2017-04-17 21:37:19 -07:00
Steve Howell 22e21cddcb admin/settings: Lazy-load Organization sections.
We now wait to load Organization sections until you
click on the section (or virtually click by using arrow
keys).

Some of the sections are coupled in terms of their setup,
so some sections will already be loaded if you had clicked
on a related section.
2017-04-17 20:55:42 -07:00
Steve Howell eae91eab08 Fix internals of message_store.get_pm_emails().
We now make sure we get the email based off the user ids
in message.display_recipient.
2017-04-17 20:36:59 -07:00
Steve Howell 31e7472cdb Fix quirk with message_store.get_pm_full_names().
After Iago changed his email, you would see strings like
"You and Iago, Cordelia," which was a consequence of looking up
Iago's full name using his old email.  Now we use user ids
internally for the lookup.
2017-04-17 20:36:59 -07:00
Steve Howell e9e1441217 Fix warnings related to email changes.
We now call people.pm_reply_user_string to populate
message.to_user_ids.  The old way of computing this used emails
instead of user ids, so if an email wasn't known, you'd get a
warning.
2017-04-17 20:36:59 -07:00
Benjamin Gilbert 4775f55ca7 Fix spelling of "occurred" in various places. 2017-04-17 20:29:07 -07:00
Raghav Jajodia 6be6aec825 components: Add new css to text input fields. 2017-04-17 11:12:01 -07:00
Raghav Jajodia d4e1f0a9a8 stream_filter: Add clear-search button to Search stream input field. 2017-04-17 11:12:01 -07:00
Raghav Jajodia 99f8750684 Refactor code associated with clear_search button.
Transfer css from right-sidebar.css to components.css to make it reusable.
The 'margin-bottom' property is removed from 'input-append' class as
it does not affect the styling of the element.
2017-04-17 11:12:01 -07:00
Tim Abbott c47dd65c14 Organization settings: Fix 'save changes' button on auth methods.
This shouldn't be shown for non-administrators.
2017-04-16 12:21:36 -07:00
Abhijeet Kaur c9166581fe Organization settings: Update "organization settings" view-only support.
Remove "Save changes" button for non-administrator users.
2017-04-16 12:21:36 -07:00
Abhijeet Kaur ddfdf0e4c6 Organization settings: "Filter settings" tab view-only support.
This changes the layout of "organization settings" for
non-administrators such that they can view "Filter settings".
("Actions" column and form to add a new filter are not available).

Fixes: #3636
2017-04-16 12:21:36 -07:00
Abhijeet Kaur dc801eb5ed Organization settings: "Default streams" tab view-only support.
This changes the layout of "organization settings" for
non-administrators such that they can view "Default streams" ("Actions"
and the form to add new default stream is not visible).
2017-04-16 12:21:36 -07:00
Abhijeet Kaur f1e966bfaa Organization settings: "Bots" tab view-only support.
This changes the layout of "organization settings" for
non-administrators such that they can view "Bots" ("Actions"
column is not made visible).
2017-04-16 12:21:36 -07:00
Abhijeet Kaur 3f0e33e498 Organization settings: "Users" tab view-only support.
This changes the layout of "organization settings" for
non-administrators such that they can view "Users" (Actions are not
visible).
2017-04-16 12:21:30 -07:00
Abhijeet Kaur 2c88e073fc Organization settings: "Authentication methods" view-only support.
This changes the layout of "organization settings" for
non-administrators such that they can view Authentication methods.
2017-04-15 08:12:56 -07:00
Tim Abbott cc51b459be admin: Show/hide menu items after setup.
This allows disabling of UI elements in cases like the authentication
methods checkboxes that are rendered during the setup method.
2017-04-15 08:12:55 -07:00
Yago González e710110a9e i18n: Automatically strip Handlebars strings.
Some Handlebars strings contained whitespaces characters at their ends.
With this, such characters are removed, as well as multiple spaces
(like the ones produced by code indentation).

This also includes a couple of fixes that removes spaces that were
intentionally placed before/after the string to translate.
2017-04-14 17:37:25 -07:00
Tim Abbott 496158c2d7 popovers: Move historical notice to actions popover.
This is still kinda ugly, so may need further work, but it at least is
now in a per-message location, not a per-sender-block location.
2017-04-14 17:17:19 -07:00
Brock Whittaker 9576d5caef frontend: Implement list_render class.
This implements a list_render closure class that allows for
progressive, responsive rendering of long, scrollable lists, with
filtering support.

It isn't used, at present.
2017-04-14 14:52:50 -07:00
Brock Whittaker 5e1471f5a3 Add preview_node functionality to util.js.
This shows a preview of a node given a reference to it like:
<tag id=“id” class=“className”></tag>.

It's intended to be used for reporting errors that are introduced by
developers in features such as the upcoming progressive list rendering.
2017-04-14 14:42:16 -07:00
Brock Whittaker f08c8b1c56 Fix settings page height issue.
The height of the settings page content is not quite as tall as the
settings page could allow which makes for an empty white space at the
bottom of the settings content container.
2017-04-14 14:38:45 -07:00
Yago González f62b8ea080 css: Properly wrap text inside tabs.
The tabs can have text inside them that is wider than 90px, especially
in some unexpected cases (e.g. a translation longer than the original
English string).

This type of tabs can be seen in the following popover menus:

 - Stream subscriptions
 - Help (with hotkeys, formatting info, etc.)
 - Settings

Now text wider than the tab is ellipsized so it doesn't cause any
problem with the rest of the layout, except in the help popover (where
it gets wrapped).
2017-04-14 14:15:37 -07:00
Raghav Jajodia 09090fa8a6 message_edit: Replace image tag with inline SVG tag for clipboard image. 2017-04-14 14:07:59 -07:00
Raghav Jajodia ae48eaa90d single_message: Show "Copied!" success message after copying.
As the user clicks the "Copy and close" button, the message_edit
closes and a success message is shown for a few seconds.
2017-04-14 14:07:36 -07:00
Raghav Jajodia 2bb632824e message_edit: Modify css for hover over 'Copy' button.
Replace background-image of copy button with an image
and change color on hover.
2017-04-14 14:01:57 -07:00
Raghav Jajodia fd5ad3658d message_edit: Only show "Copy" button for View Source/Topic-edit-only.
The "Copy" button will only be shown for "View Source"
or "Topic editing only". Also replaced "Copy to clipboard"
with "Copy and close" to make autoclose less surprising.

Fixes #4238.
2017-04-14 14:01:57 -07:00
Steve Howell 5ba79f9c3a refactor: Move respond/reply methods to compose_actions.js.
This moves respond_to_mention() and reply_with_mention() to
compose_actions.js.  These methods are basically thin layers
on top of compose_actions.start().
2017-04-14 13:09:19 -07:00
Steve Howell dd0c50f0df Extract compose_actions.js.
This module extracts these two functions that get called by
several other modules:

    start()
    cancel()

It is a little bit arbitrary which functions got pulled over
with them, but it's generally functions that would have only
been called via start/cancel.

There are two goals for splitting out this code.  The first
goal is simply to make `compose.js` have fewer responsibilities.
The second goal is to help break up circular dependencies.
The extraction of this module does more to clarify
dependencies than actually break them.  The methods start()
and cancel() had actually been shimmed in an earlier commit,
and now they no longer have a shim.

Besides start/cancel, most of the functions here are only
exported to facilitate test stubbing.  An exception is
decorate_stream_bar(), which is currently called from
ui_init.js.  We probably should move the "blur" handler out
of there, but cleaning up ui_init.js is a project for another
day.

It may seem slightly odd that this commit doesn't pull over
finish() into this module, but finish() would bring in the
whole send-message codepath.  You can think of it like this:

* compose_actions basically just populates the compose box
* compose.finish() makes the compose box do its real job,
  which is to send a message
2017-04-14 13:09:19 -07:00
Steve Howell 703074215a Export compose.abort_xhr(). 2017-04-14 13:09:19 -07:00
Steve Howell 254b9559da Export compose.clear_preview_area(). 2017-04-14 13:09:19 -07:00
Steve Howell 9bd096f3cf compose: Extract blur_textarea(). 2017-04-14 13:09:19 -07:00
Steve Howell ec8bd077d1 compose: Extract clear_textarea(). 2017-04-14 13:09:19 -07:00
Brock Whittaker fe8f63c389 message view: Fix rare cases where click-to-reply was not handled.
The comment explains this change is fairly good detail.  This change
is designed to fix complaints that sometimes clicking on a message to
reply doesn't work, which we can reproduce as being caused by clicks
that happen simultaneous with a few pixels of mouse motion at the same
time as the click.

Comment and commit message rewritten by tabbott for clarity.
2017-04-14 11:25:15 -07:00
hackerkid cd5334c827 Show local time of user in user_popover. 2017-04-14 10:38:29 -07:00
hackerkid 15cdd23525 Add option for setting timezone in user display settings. 2017-04-14 10:38:21 -07:00
hackerkid bf3b2ac673 Include timezone in user_dict fields.
Tweaked by tabbott to avoid adding timezone to bot dicts, since bots
don't need a timezone.
2017-04-14 10:33:55 -07:00
derAnfaenger ecf9a50610 Clarify UI description of message retention. 2017-04-14 10:13:34 -07:00
Steve Howell e23b660ccc compose: Extract set_focus().
Most of the code here was in show_box(), but we also pull in the
call to get_focus_area() from compose.start().
2017-04-13 17:13:19 -07:00
Steve Howell 0841320966 compose: Extract maybe_scroll_up_selected_message().
The extraction here is straightforward, but where we put the
caller is a slightly subtle change.  Instead of continuing to
invoke this code at the end of show_box(), we instead call it
at the beginning of complete_starting_tasks().  This change is
valid, because show_box() and complete_starting_tasks() are only
ever called from compose.start().
2017-04-13 17:13:19 -07:00
Steve Howell aa5409cf3a compose: Extract complete_starting_tasks(). 2017-04-13 17:13:19 -07:00
Steve Howell e73b56c7b5 compose: Extract expand_compose_box(). 2017-04-13 17:13:19 -07:00
Steve Howell 79ff32a01e compose: Extract autosize_message_content(). 2017-04-13 17:13:19 -07:00
Steve Howell f06bd41586 Fix PM list sort ordering during scrollback situations.
Before this fix, if you scrolled back in your PM history for a
person that you've had recent conversations with, then we would
backdate the record of their most recent conversation, and this
would make the sort ordering under the "Private messages"
section incorrect.

This commit fixes this error by re-writing the function
message_store.insert_recent_private_message() to check any
prior timestamps for that user.  It also optimizes the function
a bit to short-circuit in O(1) time for cases where a recipient
already has a more recent timestamp, by having a Dict keyed
on user_ids_string.
2017-04-13 12:13:20 -07:00
Steve Howell f5550301cf Extract message_store.insert_recent_private_message().
This function is slightly easier to unit test, and it isolates us
from changing message formats.  This removes some extraneous
code that would ensure that message timestamps were >= 0 that
probaby dates back to some really old migrations.
2017-04-13 12:13:20 -07:00
Steve Howell 6b549248e8 Extract settings_filters.js. 2017-04-13 10:39:39 -07:00
Steve Howell 3e37f64f71 Extract settings_streams.js. 2017-04-13 10:39:39 -07:00
Steve Howell 70afb59cff Extract settings_users.js.
This affects three admin sections:

    * Users
    * Deactivated users
    * Bots
2017-04-13 10:39:39 -07:00
Steve Howell 0fc7b9907f Extract settings_org.js (and fix live updates).
This is mostly moving code, but we do add short-circuit logic
for some live-updating methods here.

Note that this affects two different sections of the admin app:

    * Organization settings
    * Authentication methods

We really want to move to one module per section, but there is some
legacy coupling that makes this difficult for now.
2017-04-13 10:39:39 -07:00
Steve Howell a3b44148af Extract settings_emoji.js. 2017-04-13 10:39:39 -07:00
Steve Howell 76ec9cf60b Fix bug with (un)subscribe button showing on wrong narrow.
We had a bug for a while where if somebody subscribed you to a
stream, and you were narrowed to another stream, we'd show
a button in the "trailing bookend" to "Unsubscribe" from the
current stream.  I'm not sure how long we had that bug, but it
was at least a couple months old, and I couldn't track down an
issue for it.

Now we make sure that the stream event for the subscription is
related to the current narrow.

Users should still see messages when they subscribe/unsubscribe
themselves or when another user re-subscribes them to the stream
that they are narrowed to.
2017-04-13 08:01:44 -07:00
Steve Howell 33eb5ad237 Add narrow.is_for_stream_id() helper. 2017-04-13 07:49:55 -07:00
Brock Whittaker ec956d6d6e integrations: Preserve scroll position on integration inspect.
This preserves the scrolltop state of the user when they enter into
an integration's specifics, so when they exit out it scrolls them
back down the page.

Fixes: #4424.
2017-04-12 21:14:21 -07:00
Brock Whittaker e3d510154d drafts: Move the draft empty placeholder logic to template render path.
This moves the logic to embed the translated string “(no topic)” to
only render in the handlebars template rather than saving in
localStorage and therefore being added to the message topic and
eventually put in the database if not changed.

Fixes: #4378.
2017-04-12 14:15:31 -07:00
Brock Whittaker b6d285f1f4 integrations: Fixup inconsistent lozenge heights.
This normalizes images to all take up 100px even if they fall short
so that the text that is underneath will always be horizontally
aligned.
2017-04-12 13:10:41 -07:00
Umair Khan 24295e6ac8 i18next: Add expirationTime option to cache.
This ensures that we don't fill up local storage with cached
translations data when using a server that restarts often (e.g. a
development environment).

Fixes: #4443.
2017-04-12 09:32:49 -07:00
Umair Khan 0cd7c400e1 i18next: Add i18next: to the local storage cache prefix.
This just makes it easier to see what these local storage entries are
related to.
2017-04-12 09:32:31 -07:00
Brock Whittaker ffa654f780 left-sidebar: Remove <hr> divider if last pinned stream is unpinned.
The <hr> is supposed to separate the pinned streams from the unpinned
streams, so if the <hr> is the first element (checked by doing
$hr.prev().length === 0), then it means there are no longer any pinned
streams and therefore it isn’t necessary to have a divider.

Fixes: #4395.
2017-04-11 17:06:37 -07:00
Brock Whittaker d74f72f08f gear-menu: Re-add the organization settings link.
This re-adds the organization settings link and toggles the text
dependent on whether the user is an administrator or not.

Fixes: #4201.
2017-04-11 16:31:33 -07:00
Brock Whittaker 1f8d9a46f0 Remove extra "Unsubscribe" on left-sidebar stream popover.
An extra "Unsubscribe" was left over from when it was a CSS :pseudo
content rather than text in the templates.
2017-04-11 16:14:55 -07:00
Brock Whittaker 473214b32f stats: Change popover font size and weight to be more readable.
This changes the font size and weight of the popver at the bottom
of the screen (hover over "?" to see) to be a larger font size
(increased to 0.75rem from 11px) and to a bolder font weight
(500 from 300) which improves the readability of it.
2017-04-11 14:00:27 -07:00
Aditya Bansal d56100693d profile-popover: Fix position to hide the pointed-to message border.
In this commit we just adjust the position of user profile popover
opened when we click upon buddy from buddy list to view user profile.
The new position ensures that the little blue border visible from back
due to pointed to message is completely hidden by the popover.
2017-04-07 17:34:57 -07:00
Aditya Bansal 5ff87892ee profile-popover: Fix extra padding in user-profile popovers.
In this commit we remove the extra padding appearing around the
user profile images. This can be only reproduced when opening
user profile from buddy list.
2017-04-07 17:34:57 -07:00
Abhijeet Kaur 8f88b045a4 Rename "Administration" to "Organization" in the settings UI.
This better sets expectatations for the fact that in Zulip, the
Organization settings UI is available read-only to non-administrator
users.

Tweaked by tabbott to update some additional references.
2017-04-07 17:32:56 -07:00
Steve Howell 06f9c28fd2 settings: Lazy-load settings sections.
For the settings UI, we now wait until a user goes to a particular
settings section before calling the appropriate function to set
up the section (which usually involves setting up click handlers
and populating initial data).
2017-04-07 15:20:12 -07:00
Steve Howell c4b4979a74 Add Dict.clear() method. 2017-04-07 15:20:12 -07:00
Steve Howell 46af691e76 minor: Move line of code to hide digest settings.
This line was overlooked when extracting code to
settings_notifications.js.  It was not causing a user facing
error, but it was in the wrong place.
2017-04-07 15:20:12 -07:00
Steve Howell 7f17fc020f Extract settings_bots.js. 2017-04-07 15:20:12 -07:00
Steve Howell 153c24d071 Remove dead code related to bot/stream settings.
We had never-enabled code to allow users to set default
streams for their bots (for event registration, default sending, etc.).

This commit removes the code.
2017-04-07 15:20:12 -07:00
Abhijeet Kaur 015229fc68 Rename "Administration" to "Organization" in settings.
Rename "Administration" tab in Settings to "Organization."

Also rename the same in the navigation-bar for admin-users.
2017-04-07 07:18:50 -07:00
Aditya Bansal 17d32b959b scroll-bar: Fix perfect-scrollbar scrolling improperly in more topics.
In this commit we fix the issue of scrollbar occasionally scrolling
down too far when we click more topics option. Upon scrolling to top
the scroll gets reset everything returns to normal. This sometimes
leads to big blank space upon clicking more topics. This has been
fixed by reseting the scroll upon narrowing.
Fixes: #4440.
2017-04-07 07:11:17 -07:00
Brock Whittaker 406c113ce1 integrations: Remove left-over integration instruction blocks.
In cases where a user goes from one hash to another in which
neither hash is "#", it will not properly clear the last instruction
block.

Fixes: #4407.
2017-04-06 13:49:54 -07:00
Steve Howell 262a4d5da6 Create topic_generator.js. 2017-04-06 12:23:44 -07:00
Brock Whittaker 3db61ecd20 settings-bots: Fix bots styling to prevent content from overflowing.
This fixes the styling of the container so that the text will not
overflow to the next line but instead will just wrap around the
container correctly.
2017-04-06 11:56:11 -07:00
Steve Howell f37ce1eeb1 Extract settings_lab.js. 2017-04-06 11:28:36 -07:00
Steve Howell 89128a2272 Extract settings_muting.js. 2017-04-06 11:28:36 -07:00
Steve Howell 1f38884b27 Extract settings_notifications.js. 2017-04-06 11:28:36 -07:00
Steve Howell fa143d4582 Extract settings_display.js 2017-04-06 11:28:36 -07:00
Steve Howell 47bdecdc4f Extract settings_account.js.
This code handles the settings pane for "Your account," which
has email/name/password/avatar/etc.
2017-04-06 11:28:36 -07:00
Aditya Bansal 9387fce024 loading-spinner: Fix improper display in upload avatar setting.
In this commit we fix the improper display of loading spinner in
upload avatar setting upon uploading new avatar repetitively one
after the other.
2017-04-06 09:06:14 +05:30
Aditya Bansal aa10127cb6 loading-spinner: Fix position of spinner on home page.
In this we fix the positioning of the loading spinner on the home page
when its loaded for the first time. First time here does not mean first
time use but means first time of a new session.
2017-04-06 06:43:25 +05:30
Tim Abbott 97af418be2 subs: Fix going down from 'Filter streams'.
The correct behavior here should be selecting the very first row.
2017-04-05 12:30:36 -07:00
Raghav Jajodia 40018f29fc create_stream: Disable up/down arrow keys when creating new streams.
Prevent switching of stream rows on pressing arrow key when focussed
on the 'Create stream' section (this would cancel the curren stream
creation flow).
2017-04-05 12:30:36 -07:00
digi0ps a935325420 settings: Fix positioning of user upload spinner.
Previously the "Uploading" text was floating outside the upload
widget.

Fixes #4223.
2017-04-05 12:22:15 -07:00
Steve Howell e2a21303eb hotkeys: Simplify up/down handling for stream settings.
We've had this kind of hacky setting called message_view_only for
a long time in the hotkeys code, and it originally helped optimize
the code a bit.  It wasn't well maintained, and people started
adding non-message-view behavior to the arrow keys without flipping
that flag to false.  This change finally flips the flag to false,
which simplifies some of our logic.
2017-04-05 11:53:52 -07:00
Steve Howell 4a3211d6af hotkeys: Clean up dispatching of drafts hotkeys.
We now explicitly return true from process_hotkey() when we
handle up/down/backspace for the drafts modal.  Also, we no longer
call preventDefault() from drafts.draft_handle_events(), since the
caller does that, and we no longer return `true`, since we were
never inspecting the return value anyway.
2017-04-05 11:53:52 -07:00
Steve Howell 2ef9957cbc hotkeys: Handle up/down arrows in settings page.
The up/down arrows now navigate the left pane of the settings menu.
The code here was originally implemented as part of our settings
redesign, but the code was added in a place that became unreachable
after we fixed a bug with home_tab_obscured().  This commit
resurrects the code and places the guts of it in settings.js.  It
is possible that we want to clean this code up eventually to deal
better with hidden blocks.
2017-04-05 11:53:52 -07:00
Steve Howell 4bbd73a9a2 Extract list_util.js for navigating lists.
The code here used to live in hotkey.js.  Its complicated calling
protocol made it difficult to unit test.  We are also trying to
slim down hotkey.js.

Our arrow navigation for things like `#stream_filters` has always
been kind of awkward, since it's difficult to get the focus to
their list items.  This commit does nothing to fix that yet.
2017-04-05 11:53:52 -07:00
Cynthia Lin 59bfd4e1c7 integrations: Update logos.
Fixes #3219
2017-04-05 11:45:51 -07:00
Brock Whittaker bccda3c76a Change subscriber data source to come from in-memory.
The subscriber data is currently pulled from the web needlessly
when it exists in memory. This processes data returned from
the `stream_data.get_sub_by_id(n).subscribers` and the
`people.get_person_from_user_id(n).email` methods to build the
same list of subscribers that is sent from the server.

Fixes: #4314.
2017-04-04 18:26:17 -07:00
Brock Whittaker 35bb02ead6 Fix incorrect content height on settings overlay.
This fixes the height of the content body to be 100% - 45px instead
of 100% - 60px which is a fix necessary due to the previous change
in height of the settings navbar.
2017-04-04 18:14:54 -07:00
Brock Whittaker 904611cfef Add `overflow: hidden` to .content-wrapper to prevent sidebar flash.
This prevents the non-deterministic flash of the sidebar outside
of the overlay in some browsers.
2017-04-04 18:14:54 -07:00
Brock Whittaker 5501dafd2f settings: Fix avatar settings 'float' property.
This fixes the float of the avatar box so it does not visually
extend past the .settings-section container.
2017-04-04 17:53:40 -07:00
Raghav Jajodia 4b0ca4c852 streams: Restore stream name in 'Create streams'.
On filling out the name and description for new stream,
and changing the tab (e.g. by clicking on a stream on the left),
then come back to 'Create streams', it should restore stream name
similar to the stream description.

Fix #4311.
2017-04-04 17:17:20 -07:00
Steve Howell ec59b0d9eb admin screens: Change "Never" to "Unknown" for last activity.
Admins might not know whether users have "never" had activity;
more likely it's just been a long time.
2017-04-04 15:57:10 -07:00
Steve Howell 205f2c1562 Add ping_only flag for presence updates.
The web app doesn't need any presence data for its first ping to
the server, because it already has up-to-date presence info in
page_params.  So now we can tell the server not to send us a big
payload that we were already ignoring.
2017-04-04 15:57:10 -07:00
Steve Howell 2420df8415 buddy list: Make small realms show all users.
For small-ish realms (<= 250 users), we ensure that the presence
info includes all realm users the front end knows about, even in
cases where the server sends down a slimmed version of presence
data.  We make the users "offline" by default, of course.

This commit sets us up to optimize larger realms without concerns
of breaking small realms.  Small realms may want to continue to
show all users, even users who may have been offline several weeks,
since it doesn't clutter their API as much as it would for big
realms.
2017-04-04 15:57:10 -07:00
Steve Howell a4d5a12ca0 Add people.get_realm_count(). 2017-04-04 15:57:10 -07:00
Steve Howell 2718bd0b5d Extract presence.js to track presence info.
Most of this code was simply moved from activity.js with some
minor renaming of functions like set_presence_info -> set_info.

Some functions were slightly nontrivial extractions:

    is_not_offline:
        came from activity.huddle_fraction_present

    get_status/get_mobile:
        simple getters

    set_user_status:
        partial extraction from activity.set_user_status

    last_active_date:
        pulled out of admin.js code

We also fixed activity.filter_and_sort to take user_ids.
2017-04-04 15:57:10 -07:00
Harshit Bansal 0605a9fb0f templates: Rename `admin-alias-list.handlebars`.
Rename `admin-alias-list.handlebars` to
`admin-realm-domains-list.handlebars`.

Fixes: #3145.
2017-04-04 15:48:03 -07:00
Harshit Bansal 885ec07192 frontend: `realm_alias` to `realm_domain` migration.
* Change the classes and ids of different widgets and modals
and make suitable changes in `admin.js`.

* Remove any other occurrences of `alias` or `realm_alias`
from admin.js.
2017-04-04 15:48:03 -07:00
Harshit Bansal 711a3f8037 actions.py: Rename remaining occurrences of `alias' to `realm_domain`. 2017-04-04 15:48:03 -07:00
Maxim Averin 08690132fe Decrease maximum number of search suggestions.
This fixes an issue with the menu going below the bottom of screen
with non-tiny windows, and it was rare that anyone benefitted from the
extra suggestions.

Fixes: #4133.
2017-04-04 13:02:10 -07:00
Brock Whittaker 51f68fce79 Remove `overflow: hidden` constraint on .settings-section.
This `overflow: hidden` constraint would make it so that modals
embedded in the sections would have their edges cut off. This fixes
that and doesn’t seem to cause any other regressions.

Fixes #4208.
2017-04-04 12:18:18 -07:00
Kamal Marhubi 8d787ed887 style: Increase messagebox inter-paragraph spacing
The default is too tight for easily distinguishing paragraphs. This
change increases it slightly, while keeping the last paragraph's
margin at the original value.
2017-04-03 17:28:42 -07:00
Yago González 8f8efb4664 frontend: Show KaTeX errors not related to syntax. 2017-04-03 17:01:50 -07:00
Steve Howell 4da74b3cde Remove duplicate copy of get_full_name(). 2017-04-03 16:34:16 -07:00
Tim Abbott 943a3b1cff alerts: Fix "Try Now" retry get_events button.
This has apparently been broken since we renamed get_updates to
get_events.
2017-04-03 16:22:05 -07:00
Brock Whittaker 34f9ccb87c alerts: Change sidebar alerts to be at top of the screen.
This changes the alerts to be individual boxes that slide down from
the top of the screen for a better UI experience.
2017-04-03 16:22:05 -07:00
Steve Howell 2d52463b61 Extract ui_report.js.
This moves the implementations of error/report/message from
ui.js to ui_report.js.  They had been shimmed before, so calling
modules still use the same names to call the functions, but we
no longer need the shims.
2017-04-03 07:13:25 -07:00
Brock Whittaker 28a63da02f Fix the grid labels to have a min-width of 200px.
The labels should respect their original width of 200px but overflow
if the language or content is too long.
2017-04-02 14:36:26 -07:00
Brock Whittaker 5546f037a7 admin: Remove 200px width limitation on .grid label.
This removes the 200px width limitation that was part of a previous
style guide for the settings/administration pages. It force-wraps
lines that shouldn't be wrapped and no longer serves its original
purpose.

Fixes: #4312.
2017-03-30 13:30:45 -07:00
Sampriti Panda 32e76c2c60 drafts: Move snapshot_message from compose to drafts
Previously drafts called compose.snapshot_message which would then
get the message object from compose.create_message_object. This method often
checked for the validity of stream/user recipients which would often cause tracebacks.

The new method in drafts.snapshot message just gets the data from the fields and
stores them in the draft model without any additional checking.
2017-03-30 10:20:37 -07:00
Rohitt Vashishtha 4659f97649 sidebar: Make icon clickable for '< All Streams' in left sidebar. 2017-03-30 10:12:19 -07:00
Rishi Gupta daed1fc2aa user_info_popover_content: Fix padding issues.
Removes 1px padding around edge of avatar added by bootstrap.
Removes column of whitespace to right of avatar.
2017-03-29 11:36:51 -07:00
Rishi Gupta 07592a6692 user_info_popover_content: Change wording to match search autocomplete.
The new wording is also more active, and shorter.
2017-03-29 11:36:51 -07:00
Rishi Gupta 4063ab6cf7 user_info_popover_content: Reorder actions into sections. 2017-03-29 11:36:51 -07:00
Amy Liu 6f061beb46 hotspots: Add backend support for tutorial hotspots.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
2017-03-29 11:34:32 -07:00
JPJPJPOPOP f7d2889c1d drafts.js: Prevent delete from triggering in the back of draft overlay.
Fixes #4340.
2017-03-27 18:13:57 -07:00
Yago González 2f5addc174 i18n: Add missed strings. 2017-03-27 14:30:28 -07:00
Yago González 58880b6695 frontend: Remove unnecessary punctuation. 2017-03-27 14:30:28 -07:00
Brock Whittaker 45a5932236 Merge ./static/images/landing-page/assets into parent folder.
There appears to be an issue in which on production the
./landing-page/assets folder is excluded from the build process,
so move it to the parent folder to fix the assets to appear in
production.
2017-03-27 14:08:45 -07:00
Jonathan Pan 5556d2341c hotkey.js: Add hotkey for drafts.
* 'd' in message view opens drafts.

This also adds hotkeys within the drafts UI:
* Up/down arrow keys navigate the drafts.
* Pressing enter edits the selected draft.
* Pressing backspace deletes the selected draft.

Some variable names tweaked by tabbott.
2017-03-27 14:05:00 -07:00
Harshit Bansal d17b759fa2 admin: Display last active time of users in admin users table.
Fixes: #2097.
2017-03-27 13:39:47 -07:00
Tim Abbott d565990c68 reload: catch exceptions trying to preserve state. 2017-03-27 13:36:31 -07:00
Tim Abbott 2eacc7317d reload: Remove cleanup_before_reload logic.
Zulip's logic for garbage-collecting data structures before reloading
was a fix for a Chrome memory leak that lasted across reloads a few
years ago.  That memory leak is probably now fixed, and thus logic is
causing lots of JavaScript tracebacks that are probably not useful.

So, let's try removing this cleanup logic (everything but the
still-useful deletion of the event queue).
2017-03-27 13:23:10 -07:00
Steve Howell 24ee369d43 Improve error message in message_list.select_id(). 2017-03-27 10:26:30 -07:00
Steve Howell 6314f60edc Keep compose open if left arrow does not cause message edit.
If somebody hits the left arrow to edit a message, but there are
no messages available to edit, then leave them in the compose box.
2017-03-27 10:15:05 -07:00
Steve Howell 293c89ba94 message edit: Only enable left-arrow-editing for content.
We no longer let the left arrow put you into the message edit
UI for a message where you can only edit topics, since that is
just confusing to most users.

This change also improves error handling a bit, and it removes
an unnecessary call to rows.id().

Finally, it moves some logic out of message_list.js, so that we
don't have a circular dependency for this codepath.

Fixes #4259
2017-03-27 10:02:19 -07:00
Steve Howell c0a6038a95 css: Enforce one selector per line.
While it's sometimes nice to put a few selectors on the same line,
it is generally better to have a consistent way of formatting our
selectors, and most of our code up until now lists them vertically.
This change fixes the linter to enforce one selector per line, and
it cleans up the places in the CSS where we had multiple selectors
on the same line.

The advantages of one-per-line are as followers:
    * cleaner diffs
    * easier to see when multiple areas of the app may have the
      same format
    * less likely to go over 80 cols
    * makes it more clear where we have deep nesting in the
      individual selectors
    * makes it easier for our linting tools to enforce
      whitespace violations

This also fixed an old bug where we had ".landing_page h2, h4", which
sets "h4" styles outside of the landing page.
2017-03-26 16:57:33 -07:00
Steve Howell 3d76088f59 tools: Make CSS style more consistent with opening brace.
We now always put the opening brace of a CSS section on
the same line as the last selector (with a space in front).
2017-03-26 16:57:33 -07:00
Steve Howell cf6545a71f reactions: Only warn for unknown user ids.
If we get reactions for deactivated users, or otherwise missing
users, we only issue a blueslip warning now.  The function
get_message_reactions() was indirectly causing blueslip errors
before this fix, but we can downgrade to warnings now that this
function has better unit tests around it.

We eventually want to track deactivated users on the client.

Fixes #4289
2017-03-26 11:51:36 -07:00
Steve Howell 3da047e10e Add people.is_known_user_id(). 2017-03-26 11:39:06 -07:00
Steve Howell 80addd902c Extract local vars in get_message_reactions(). 2017-03-26 11:39:05 -07:00
Tim Abbott 5672618b82 css: Extract popovers.css. 2017-03-25 20:14:17 -07:00
Cynthia Lin f41883ce8d subs.js: Refactor row data functions to return objects. 2017-03-25 18:35:21 -07:00
Cynthia Lin 6e2d180a34 hotkeys: Add hotkey `n` for opening New streams modal in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin ca460fad1f hotkeys: Add hotkey `V` for viewing selected stream in Streams menu. 2017-03-25 18:35:21 -07:00
Cynthia Lin a027e9318d hotkeys: Move cursor to Filter streams input if at top of Streams menu.
Fixes #4227
2017-03-25 18:35:21 -07:00
Cynthia Lin b800cb05c0 hotkeys: Add left/right arrow keys to toggle views in Streams menu.
Fixes #4228
2017-03-25 18:35:21 -07:00
Cynthia Lin fb89d8a2bf subs.js: Refactor modal row functions. 2017-03-25 18:35:21 -07:00
Cynthia Lin 69c32daffa hotkeys: Add `U` hotkey for unsubscribing/subscribing in Streams menu.
Fixes #4229
2017-03-25 18:35:21 -07:00
Cynthia Lin d17131dcb4 hotkeys: Rename subs.arrow_keys() to subs.switch_rows(). 2017-03-25 18:35:21 -07:00
Aditya Bansal 42265fe035 Fix '@' in userprofile popover to use font-awesome icon. 2017-03-25 18:30:58 -07:00
Aditya Bansal 91962aa6ab font-awesome: Fix font-awesome 4.7.0 upgrade in a hacky way.
What actually has been done below is to just copy the css class defination
from the latest font-awesome css to be here and since the rest of the stuff
in /third/fontawesome was updated in ee0b16b1ef
we should be able to use this safely until we update all font-awesome class
usage in templates.

Fixes #4302.
2017-03-25 18:30:40 -07:00
K.Kanakhin 234a1f8e61 retention-period: Add retention period to front-end admin organization settings.
- Add message retention period field to organization settings form.
- Add css for retention period field.
- Add convertor to not negative int or to None.
- Add retention period setting processing to back-end.
- Fix tests.

Modified by tabbott to hide the setting, since it doesn't work yet.
The goal of merging this setting code now is to avoid unnecessary
merge conflicts in the future.

Part of #106.
2017-03-25 17:57:18 -07:00
Joshua Pan 16b2313165 muting_ui.js: Remove any popups when unmuting. 2017-03-25 12:49:14 -07:00
Joshua Pan 76e84288d9 Add M hotkey to toggle mute/unmute topics.
Get rid of current_msg_list.selected_message() redundancy.
2017-03-25 09:42:49 -07:00
Joshua Pan dc9f83005f Add toggle_mute to muting_ui.js. 2017-03-25 09:42:49 -07:00
Joshua Pan 32837804d8 Extract stream_popover.topic_ops to muting_ui.js. 2017-03-25 09:42:49 -07:00
Brock Whittaker efd72d3338 Modify lightbox to only display valid images and YT Videos.
This modifies the lightbox to only display images inside the
".message_inline_image" class, rather than all images inside the
message body, which currently includes things like the bot icon.
2017-03-25 09:19:26 -07:00
Steve Howell b3e4aa4c44 reactions: Downgrade blueslip error to a warning.
When we get a server error for adding/removing a reaction, we
no longer make a blueslip error, since it is somewhat common for
users to retry actions before the server sends an event.  The
code comment that is part of this commit explains this further.

Fixes #4290.
2017-03-24 18:24:15 -07:00
wizsid11 95789eb879 Add Slack webhook.
Adds a new webhook integration for Slack to receive messages
from one's Slack team's public channels.
Contains negative tests for broken, missing or invalid data.

Allows two different option for integration:
1. Receive notification on a single stream with different topics
for each of Slack's public channels.
2. Receive notification on different streams for each of Slack's
public channels.

Steps to choose between the two options is described in the documentation.

Fixes #3569.
2017-03-23 23:32:38 -07:00
Tomasz Kolek be0a2cb20b Add basecamp3 webhook integration.
Fixes: #3949.
2017-03-23 23:28:53 -07:00
Tim Abbott 69323d12c9 Fix click message_content covering bottom half of avatar.
This causes clicks to correctly hit the avatar an open the profile
popover.

Fixes #4251.
2017-03-23 15:22:06 -07:00
Aditya Bansal 17a4c5d0d8 Fix horizontal scroll for super long lines in bullet lists.
Fixes: #4245.
2017-03-23 15:19:28 -07:00
Moritz Neeb 9866805937 docs: fix a typo in hashchange.js 2017-03-23 15:16:02 -07:00
Joshua Pan f40b43a491 hotkeys: Add hotkey `G` an alias for End.
Fixes #4195.
2017-03-23 11:38:36 -07:00
Tim Abbott 5d030e9173 casper: Add test for the reload hashchange logic. 2017-03-22 23:06:08 -07:00
Tim Abbott 04db0b5df0 reload: Fix passing data to next browser session.
Apparently, Django's CSRF protection mechanism changed at some point,
and now we get a different CSRF token every time the webapp is loaded.
This, in turn, caused our reload logic to avoid losing state to be
completely ineffective, since the CSRF check in reload.initialize
always failed.

We fix this in a secure fashion by passing the reload instructions
from the browser to its reloaded self via localstorage, keyed by a
randomly generated token.  The token randomization is primarily
relevant for handling several Zulip tabs in the same browser, but also
servers to make it very difficult for an attacker to ever trigger this
code path by redirecting a browser to `/#reload` URLs.

Fixes #3411.
Fixes #3687.
2017-03-22 22:46:54 -07:00
Tim Abbott 64acf84ab1 reload: Save narrow when event queues expire.
Along with the issues with our reload data passing system that are
fixed in the next commit, this is responsible for #3411.
2017-03-22 22:28:35 -07:00
Tim Abbott ee4b948873 bankruptcy: Fix narrow being lost on declaring bankruptcy.
This was actually being done in 2 ways: via not saving the narrow in
the reload and second through calling `change_tab_to('#home')`.  The
code is so ancient that it seems unlikely that this behavior was still
intentional.

Fixes part of #3687 (the remainder is fixed in a few commits).
2017-03-22 22:28:18 -07:00
Tim Abbott 37ac0e6e6d server_events: Remove obsolete 'tool old' handler.
This error predates the transition to an event queue system and hasn't
been possible for years.
2017-03-22 21:16:39 -07:00
Tim Abbott 61e6ed8c31 bankruptcy: Fix clicking outside bankruptcy modal.
Previously, this would leave the unread UI disabled forever, showing 0
unread counts for anything, which was a super confusing failure mode.
2017-03-22 20:50:44 -07:00
Tim Abbott 977e7b0fdc unread: Move bankruptcy code out of click_handlers.js. 2017-03-22 20:49:05 -07:00
Tim Abbott 1f89058023 Fix broken size for message actions popover.
This fixes a regression introduced in
23a5f56023 where the `.popover-inner`
CSS wasn't scoped properly.
2017-03-22 16:44:23 -07:00
Tim Abbott ccb38a1e9c compose: Fix missing opts argument to show_box.
This fixes a regression in the recent compose.get_focus_area
refactoring that I did.
2017-03-22 16:32:53 -07:00
hackerkid 97bd9d5186 Fix positioning of message-info-popover. 2017-03-22 16:04:38 -07:00
hackerkid ed72ee476f Make user_popover use user_info_popover template. 2017-03-22 16:04:38 -07:00
hackerkid b2fc8d6fa2 Rename message_info_popover* templates to user_info_popover*. 2017-03-22 16:04:38 -07:00
hackerkid 23a5f56023 Add sender avatar in message popover. 2017-03-22 16:04:38 -07:00