Commit Graph

3273 Commits

Author SHA1 Message Date
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