Commit Graph

2964 Commits

Author SHA1 Message Date
Cory Lynch
30c7629212 Change code block typeahead to only sometimes close fence.
Fixes #5556.
Some tests needed to be moved around to make sure the
stubbing wouldn't break future tests.
2017-07-03 11:05:18 -04:00
Cory Lynch
802ea9abf5 Refactor to delete mousewheel.js.
This old third party library added support
for a "mousewheel" event to detect scrolling.
However, it is not compatible with jQuery 3
and is obsolete now that there is a standard
"wheel" event that accomplishes the same thing.
2017-07-03 11:04:20 -04:00
Harshit Bansal
4cb8ac100a emoji: Fix the title and alt text for unicode emojis.
Unicode emojis when rendered should display canonical short name.
Similarly, the alt text should be of the format `:<short_name>:`.
For both of these we currently display the actual unicode symbol.
As some systems don't have the fonts necessary for displaying them
properly, they are rendered as empty square blocks. This commit also
ensures that the markup generated for emoji generated by canonical
name and by an unicode emoji is same.

Fixes: #5555.
2017-07-01 11:14:24 -07:00
Cory Lynch
8abbb6d781 search: Remove in:all token from suggestions. 2017-07-01 12:19:52 -04:00
Steve Howell
0f4b7496e1 Use _.each to set page_params values for update_dict events. 2017-07-01 08:50:50 -04:00
Aditya Bansal
28ec32d757 compose.js: Use get_subscriber_count in show_all_everyone_warning(). 2017-06-30 19:57:14 +05:30
Umair Khan
4f33a650af i18n: Use double lowdash instead of handlebars.
We do not allow handlebars within {{#tr}}{{/tr}}.
2017-06-30 10:12:31 -04:00
Steve Howell
ef815e9e79 Remove unused channel.abort_all(). 2017-06-30 09:48:04 -04:00
Aditya Bansal
2be5046144 compose.js: Use stream_data.get_subscriber_count in message mentions.
In this commit we basically start using the get_subscriber_count
function from stream data to get subscriber count.
2017-06-29 10:34:47 -04:00
Aditya Bansal
7531a85c4d stream_data: Add get_subscriber_count() function. 2017-06-29 10:34:47 -04:00
Aditya Bansal
7a0387e0b1 compose.js: Add return true for subscribed streams.
This is basically going to fix a regression which was introduced in
89090cd which made code early return in case of subscribed streams.
2017-06-29 18:02:25 +05:30
Umair Khan
d44c62e894 update_starred: Make the status translatable. 2017-06-29 07:39:20 -04:00
Umair Khan
8921496ccc message_list_view: Add starred_status to message objs.
This starred_status property can be used to provide the context in
the single_message.handlebars template to show the proper tooltip.
2017-06-29 07:39:20 -04:00
Steve Howell
9b75daaa60 Extract reactions.view.remove_reaction(). 2017-06-29 07:19:52 -04:00
Steve Howell
e2ae4aeb16 Extract reactions.view.update_existing_reaction(). 2017-06-29 07:19:52 -04:00
Steve Howell
8cf6ef95b1 Extract reactions.view.insert_new_reaction(). 2017-06-29 07:19:52 -04:00
Steve Howell
791e489938 Use a proper context in insert_new_reaction().
Before this change, we were piggybacking fields on to the event
object, which coupled us to any other function that relies on
the event.
2017-06-29 07:19:52 -04:00
Aditya Bansal
84b52661bb compose.js: Remove small piece of dead code.
In this commit we remove a small piece of dead code from
check_stream_for_send() function and also rename it to
check_unsubscribed_stream_for_send() which makes more sense.
2017-06-28 07:45:21 -04:00
Aditya Bansal
89090cd3af compose.js: Refactor validate_stream_message_address_info().
In this commit we just refactor validate_stream_message_address_info
function to early return in case of stream_data.is_subscribed()
returns true.
2017-06-28 07:45:21 -04:00
Aditya Bansal
eec9a9babb compose.js: Export validate_stream_message_address_info(). 2017-06-28 07:45:21 -04:00
Harshit Bansal
efa1cf6fb5 subs: Fix the traceback when an user subscribes/unsubscribes.
On receiving a `peer_add`/`peer_remove` event we were performing a
subscribers list re-rendering even when the stream settings form was
not open which was causing a traceback. This commit fixes this behavior
by first checking if the corresponding stream settings form is open and
performs a re-rendering only when it is open.
2017-06-27 16:23:00 -04:00
Joshua Pan
ac64ee355d compose_actions.js: Allow compose to empty narrow.
This allows r/enter hotkeys to compose to
an empty narrow (no messages).

Fixes #4500.
2017-06-27 14:06:59 -04:00
Joshua Pan
c4914eeec9 narrow.js: Create narrowed_by_stream_reply().
This function returns if you are narrowed
to a stream.
2017-06-27 14:06:59 -04:00
Yago González
9be3ff2b3f composebox_typeahead: Remove unnecessary autocomplete_checks.
The validations that autocomplete_checks did were already managed by
tokenize_compose_str and the main "if" statements in
compose_content_begins_typeahead.
2017-06-26 19:33:25 -04:00
Yago González
c348b907e7 composebox_typeahead: Optimize token identification. 2017-06-26 19:33:25 -04:00
Yago González
67433691a9 templates: Fix typo in error message. 2017-06-26 19:33:25 -04:00
Aditya Bansal
411883365a compose.js: Create initialize() function. 2017-06-26 15:55:10 -04:00
Yago González
5b0954c29d node tests: Remove unreachable match case.
Since util.extract_pm_recipients() won't return a recipient if it's only
composed by whitespaces, considering such recipient in the matcher is
unnecessary.
2017-06-26 08:38:21 -04:00
Sampriti Panda
b2a1754f8a drafts: Re-narrow on restoring draft.
Fixes #4587
2017-06-25 12:26:42 -04:00
Vishnu Ks
9fbd990d1a tutorial.js: Narrow to PM with welcome-bot when user logins for first time. 2017-06-25 11:23:45 -04:00
Cory Lynch
090d7487cf search_suggestion: Use person matching function from people.js.
Instead of having a custom (duplicate) matching function in
search suggestion, it was refactored to use the function in
people.js. This also gets the diacritic-ignoring feature
of the function in people.js.

Fixes #5315.
2017-06-23 08:29:20 -04:00
Cory Lynch
46d224f021 people.js: Refactor to split out 'person_matches_query' function. 2017-06-23 08:29:20 -04:00
Harshit Bansal
6615f2f2e8 common.js: Migrate common.js module to use IIFE module style.
This module was exposing its functions as globals. This PR fixes
it use the IIFE module style that we use in our other modules.
2017-06-22 19:06:32 -04:00
digi0ps
f228700ef2 webpack: Migrate translations.js to use ES2015 syntax. 2017-06-22 16:43:33 -04:00
Harshit Bansal
0994726035 composebox_typeahead: Fix the behavior on inserting an emoji on new-line.
Autocompleting an emoji on a line was adding an extra space.

Fixes: #5516.
2017-06-22 14:16:44 -04:00
Harshit Bansal
4912acf409 composebox_typeahead: Fix the autcomplete behavior while editing message.
On editing a multi-line message inserting an emoji or stream name,
the autocomplete was incorrectly sending the cursor to the the end
of the message.

Fixes: #5515.
2017-06-22 14:16:44 -04:00
Abhijeet Kaur
534aa0b105 bots: Add a widget file to directly create bot from integration pages.
Add a widget file to create and subscribe bot to the stream user wishes
the incoming webhook services to send messages.
2017-06-22 11:07:30 -04:00
Vaida Plankyte
c52e964db3 frontend: Toggle aria-hidden for overlay container visibility. 2017-06-22 10:57:37 -04:00
Cory Lynch
df83cee86b people.js: Ignore diacritics in search bar.
Fixes #5315
2017-06-21 19:13:44 -04:00
Yago González
e7bd18ec09 timerender: Make get_full_time produce a ISO 8601 date string.
Having get_full_time produce a date string non-compliant with RFC2822 or
ISO 8601 caused problems when showing edition timestamps on a message's
edit history.

Now it returns an ISO 8601 date string (1978-10-31T13:37:42Z).
2017-06-21 16:46:39 -04:00
Cynthia Lin
e832ebdc98 hotkeys: Add collapse/show message hotkey.
Fixes #4540
2017-06-21 15:54:09 -04:00
Cynthia Lin
a9afe43735 hotkeys: Add u hotkey for opening message sender profile.
Fixes #4873
2017-06-21 10:38:05 -04:00
Abhijeet Kaur
14fdc2aea6 bots: Add 'Bot type' column to bots list in organization settings. 2017-06-20 23:04:46 -04:00
Cory Lynch
c19be5e39e Change conversation links to contain user's own email.
Fixes #2360.
2017-06-20 21:22:45 -04:00
Cory Lynch
6d90d7ccbb people.js: Ignore own email address in group PMs. 2017-06-20 21:22:45 -04:00
Cory Lynch
ff9498f85b bookend: Hide re-subscribe button for private streams.
Fixes #5181
2017-06-20 20:56:26 -04:00
vaibhav
d9bc3932ec settings: Move "download personal API key" from "your-bots" to "your account"
Fixes: #5355.
2017-06-20 15:46:23 -04:00
Harshit Bansal
aee130bf06 subs: Fix the real-time sync when adding/removing the subscribers.
We were incorrectly amending the HTML directly whenever a subscriber
was added/removed. For updating any list which is being managed by
`list_rendering.js`, instead of modifying the HTML directly we should
just update the data in list render instance and perform a re-render.

Fixes: #4812.
2017-06-20 15:44:20 -04:00
Harshit Bansal
e82a53117a stream_edit.js: Add rerender_subscribers_list() function.
This function can be used for updating the subscribers list correctly
when a subscriber is added or removed.
2017-06-20 15:44:20 -04:00
Harshit Bansal
3f0ccd66c5 stream_edit.js: Extract get_email_for_subscribers() function.
This function can be used for mapping subscribers's id to their email.
2017-06-20 15:44:20 -04:00