Commit Graph

4360 Commits

Author SHA1 Message Date
Tim Abbott 93418c6eb4 translations: Remove unnecessary cache clearing code.
Since the browser reloads when new server versions are deployed, the
other similar block already handles this issue.
2017-07-28 12:18:15 -07:00
Tim Abbott e729814cfd recent_senders: Fix exception in certain typeahead flows.
It appears that a regression introduced in
3f60074c33 caused undefined to be passed
as the subject to the recent_senders library much more often; this
fixing that, and makes the library handle such cases reasonably
without an exception regardless.

This was causing a huge number of "Tried to call a Dict method with an
undefined key." exceptions.
2017-07-28 11:04:11 -07:00
Umair Khan 6536384e4b i18next: Remove older translation caches.
Any cache entry which doesn't belong to the current server_generation
is removed.

Fixes #5545.
2017-07-28 11:04:11 -07:00
Umair Khan fd9b7210ef i18next: Clear cache on restart event. 2017-07-28 11:04:11 -07:00
Brock Whittaker 36f6da9ebf /register/: Hide sign up on invite-only realms.
This hides the right-hand sign up form for realms that are
invite-only, and shows some text that states the realm is invite-only.
2017-07-27 16:53:57 -07:00
Steve Howell 724e988102 Add topic_data.add_history(). 2017-07-27 14:26:22 -07:00
Steve Howell a9e296db74 Remove topic_data.process_message().
We now call topic_data.add_message() and
topic_data.remove_message() when we get info about
incoming messages.  The old way of passing in a boolean
made the calling code hard to read and added unncessary
conditional logic to the codepath.

We also have vague plans to change how we handle
removing topics, since increment/decrement logic is now
kind of fragile, so making the "remove" path more explicit
prepares us to something smarter in the future, like just
figure out when the last topic has been removed by calling
a filter function or something outside of topic_data.js.

Another thing to note here is that the code changed here
in echo.js is dead code, since we've disabled
message editing for locally edited messages.  I considered
removing this code in a preparatory commit, but there's
other PR activity related to local echo that I don't want
to conflict with.

One nice aspect of removing process_message() is that
the new topic_data.js module does not refer to the legacy
field "subject" any more, nor do its node tests.
2017-07-27 14:26:22 -07:00
Steve Howell 5a8bccfe08 topic_data.js: Refactor topic history internals.
This commit introduces a per-stream topic_history class
inside of topic_data.js to better encapsulate how we store topic
history.

To the callers, nothing changes here.  (Some of our non-black-box
node tests change their way of setting up data, though, since the
internal data structures are different.)

The new class has the following improvements:

    * We use message_id instead of timestamp as our sorting key.
      (We could have done this in a prep commit, but it wouldn't
      have made the diff much cleaner here.)

    * We use a dictionary instead of a sorted list to store the
      data, so that writes are O(1) instead of O(NlogN).  Reads
      now do sorts, so they're O(NlogN) instead of O(N), but reads
      are fairly infrequent.  (The main goal here isn't actually
      performance, but instead it just simplifies the
      implementation.)

    * We isolate `topic_history` from the format of the messages.
      This prepares us for upcoming changes where updates to the
      data structure may come from topic history queries as well
      as messages.

    * We split out the message-add path from the message-remove
      path.  This prepares us to eventually get rid of the "count"
      mechanism that is kind of fragile and which has to be
      bypassed for historical topics.
2017-07-27 14:26:22 -07:00
Steve Howell 49a25ce070 topic_data: Rename recent_topics to stream_dict.
The var in question is indexed by stream_id, so stream_dict seems
like a good name for it.  We want to distinguish per-stream data
structures from the stream-level entry points.
2017-07-27 14:26:22 -07:00
Steve Howell bc0761b22b Extract topic_data.js.
This new module tracks the recent topic names for any given
stream.

The code was pulled over almost verbatim from stream_data.js,
with minor renames to the function names.

We introduced a minor one-line function called stream_has_topics.
2017-07-27 14:26:22 -07:00
Steve Howell b95e785335 recent topics: Extract get_recent_topic_names().
We now have all of our callers into recent_topics code just
receive a list of topic names from get_recent_topic_names().

This is more encapsulated than handing off tiny little
structures to the three callers, two of whom immediately
mapped the objects to names, and one of whom needlessly
used the now defunct name canon_subject field.

The consolidation here removes some "subject" references, and
now all lookup are by stream id, not stream name.

The diff here is a bit daunting, but it's mostly simplification
of tests and calling code.  Two of the callers now need to look
up stream ids, but they are otherwise streamlined.

The main change here is to stream_data.js, and we replace the
`canon_subject` and `subject` fields with `name`.
2017-07-27 14:26:22 -07:00
Brock Whittaker d01549e8e3 Fix outerHeight to OR with 0 to not produce NaN.
This is an issue where in jQuery v3 the result of outerHeight on a node
that doesn’t exist is now “undefined” rather than “null”, which means
it will no longer cast to a Number but rather NaN. For this, we create
the safeOuterHeight and safeOuterWidth functions to safely return a
result (or 0).

This is a better solution than manually going to each instance and
ORing it with 0 for type safety.

https://stackoverflow.com/questions/41454285/jquery-outerheight-returns-
undefined-instead-of-null
2017-07-27 14:16:57 -07:00
Brock Whittaker ac4ac63353 Change from deprecated $.parseJSON to JSON.parse.
The jQuery function `parseJSON` is now deprecated so we should push to
switch to native `JSON.parse` since all browsers support it.
2017-07-27 14:16:57 -07:00
Brock Whittaker aa645eb72b eslint: Remove `no-new` rule.
This removes the `no-new` rule which is relatively detrimental to
code cleanliness in our codebase because third-party libraries may
utilize data structures that don't fly well with our linting rules.

This also fixes abstractions that were created due to the limitations
and impositions of this lint rule.
2017-07-27 11:31:33 -07:00
Brock Whittaker 056418b54c user-profile: Break long emails into multiple lines.
Before the user profile bounding box width was not set so it
would overflow the 240px and there would be grey space next to
the avatar. Now the width is always maintained and long text
is cut into multiple lines.
2017-07-27 11:10:09 -07:00
Brock Whittaker a770b07f2e /apps/: Change hero to be darker, more contrasty colors.
This changes the hero to be about 20% darker to increase the
legibility of the navbar fonts over it.
2017-07-27 09:13:04 -07:00
Brock Whittaker 59ffb97ea9 Fix: Change .on => .bind.
This changes a typo where a function was attempting to execute the
scope of the parent's "this" by using `function () {}.on()`, rather
than using the `Function.prototype.bind` built-in.
2017-07-26 17:30:25 -07:00
Vishnu Ks 2396619ec6 popover: User .on('load') instead of .load().
.load is deprecated since jQuery 1.8. We are currently on
jQuery 3.2.1.
2017-07-26 11:32:33 -07:00
Brock Whittaker e3ba44710e /apps/: Fix failing tests.
The ES6 backticks in /static/js/portico/landing-page.js were causing
the server to trip up. This was fixed by switching from JS string
interpolation to string concatenation (ES5).
2017-07-26 11:08:43 -07:00
Brock Whittaker dc671ac0bd /apps/: Redesign apps page.
Tweaked by tabbott to update the URLs to point to the Electron desktop app.
2017-07-26 09:56:04 -07:00
digi0ps 3f60074c33 emoji: Create tests to check the typeahead resuts.
Also, this commit exports the typeahead matcher and sorter functions.
Fixes #4126.
2017-07-26 09:27:17 -07:00
digi0ps 9a179b486b emoji: Allow searching of emojis using spaces in emoji picker. 2017-07-26 09:27:17 -07:00
digi0ps 2d92f9dc0b emoji: Change emoji image titles to use spaces instead of underscores.
Previously, the emoji images title display `🍼`.
This commit changes the title to display `baby bottle`.
2017-07-26 09:27:17 -07:00
digi0ps 0f3c1c04d5 emoji: Use spaces instead of underscores for emojis in composebox.
Adds support to use spaces for multi word emojis instead of
underscore in compose box.
2017-07-26 09:27:17 -07:00
David Coleman 159064ccaa uploads: Only display year uploaded if previous year.
Modified timerender.js absolute_time() to include the year
in the returned string when the supplied timestamp is in
an older year. This included adding an optional second
argument to specify the current date to facilitate unit
tests.

Fixes #5737.
2017-07-25 23:06:58 -07:00
hollywoodno f7d1abaa25 compose.js: Prevent sending empty messages in preview mode.
This commit specifically addresses the issue when in preview mode,
while "enter sends" is enabled. Previously the messages were just
sent, now they must pass validation.

Fixes #5574.
2017-07-25 22:33:22 -04:00
Vaida Plankyte 85d5296863 frontend: Add focus indicator to sign in/sign up buttons. 2017-07-25 18:12:19 -07:00
Greg Price 192ec7c0f6 middleware: Use a proper error code on CSRF failure.
This allows us to reliably parse the error in code, rather than
attempt to parse the error text.  Because the error text gets
translated into the user's language, this error-handling path
wasn't functioning at all for users using Zulip in any of the
seven non-English languages for which we had a translation for
this string.

Together with 709c3b50f which fixed a similar issue in a
different error-handling path, this fixes #5598.
2017-07-25 14:02:12 -07:00
Vaida Plankyte 388acbbfcb frontend: Remove old required div & css from registration pages.
Removes class="required" divs that used to contain an asterisk
for valid/invalid input, and their associated css.
2017-07-25 13:39:34 -07:00
Cynthia Lin 89abe5d398 user docs: Document Analytics feature.
Fixes #3648.
2017-07-25 11:18:44 -07:00
Sarah 31e47954f7 settings_org: Change update_realm_description to read from page_params.
Also refactor server_events_dispatch, move update_realm_description
into the realm_settings object.

Fixes #5696.
2017-07-24 17:36:50 -07:00
Sarah f132652717 server_events_dispatch: Deduplicate realm and user_display settings code.
Deduplicate code updating page_params for realm settings
and user display settings.

Addresses issue #5696.
2017-07-24 17:35:41 -07:00
Rishi Gupta ad47d3b651 settings: Update wording in organization-permissions-admin.handlebars. 2017-07-24 17:33:14 -07:00
Rishi Gupta f91098143b settings: Reorder options in organization-permissions-admin.handlebars.
Also adds <hr>'s to separate the options into sections.
2017-07-24 17:33:14 -07:00
Rishi Gupta ace67c6669 settings: Remove tooltip for user settings -> full name.
It's hinted in the registation process, and as long as one person in the
realm does it, everyone else will know. The tooltip also draws too much
visual attention.
2017-07-24 17:33:14 -07:00
Rishi Gupta 481c85fb48 settings: Update text in templates. 2017-07-24 17:33:14 -07:00
Harshit Bansal f7f4d1ca58 markdown: Fix the broken rendering of tables.
It was a regression introduced in the commit
`0d08acaa1b5713be464dfca4836e5b238f45621c`.
2017-07-24 17:31:08 -07:00
Greg Price 709c3b50fc tornado: Use a machine-readable error code when an event queue is gone.
This fixes the original issue that #5598 was the root cause of; when
the user returns to a Zulip browser tab after they've been idle past
the timeout (10 min, per IDLE_EVENT_QUEUE_TIMEOUT_SECS), we now
correctly reload the page even if they're using Zulip in German or
another non-English language where we have a translation for the
relevant error message.
2017-07-24 16:41:22 -07:00
Cory Lynch d32e89aae4 jQuery: Remove broken use of "removeAttr".
This function no longer sets properties to false, so the supported
way of doing this is to instead use prop(foo, false). Some tests
had to be fixed to accommodate this.
2017-07-24 10:54:47 -07:00
Cory Lynch 9f91d4c265 Remove deprecated jQuery "delegate" function.
Replaced by "on".
2017-07-24 10:47:16 -07:00
Cory Lynch 274cabff98 Remove instances of deprecated jQuery "bind".
They have been replaced with "on".
2017-07-24 10:47:16 -07:00
Shubham Gupta caee548074 overlays: Fix compose box closing when clicking on overlays.
This was a bug introduced by a recent refactoring to rename .modal to
.overlay for consistency.

Fixes #5886.
2017-07-22 12:06:00 -07:00
Brock Whittaker 04ece5e5c5 portico: Redesign /why-zulip and /for/ open-source to be more readable.
This redesigns these pages to be more readable and more in line with
the rest of the portico page styling.
2017-07-21 14:17:20 -07:00
Harshit Bansal c1dc48f41b emoji: Merge the two semantically same tips on the `Custom emoji` page.
In case the user was not allowed to upload an emoji, we were displaying
two different but sematically same tips. This commit merges them and
also updates `update_custom_emoji_ui()` function in settings_emoji.js
to live update tooltip.
2017-07-21 13:29:27 -07:00
Jack Zhang 1c9426fdce registration: Divide form into user and org sections. 2017-07-21 13:09:06 -07:00
Jack Zhang 948d9c8d29 registration: Add domain text next to subdomain input field. 2017-07-21 13:09:06 -07:00
Jack Zhang 149572e14a registration: Style register form into a centered layout. 2017-07-21 13:09:06 -07:00
Jack Zhang 0995780f82 portico: Auto-correct and error-handle short name input. 2017-07-21 13:09:06 -07:00
Jack Zhang c938c3be2d portico: Remove green checkboxes from forms.
More than half of these are buggy. Adding them back will be
separate project for the future.
2017-07-21 13:09:06 -07:00
Cynthia Lin e21c3e1cb7 settings: Nest PM content setting in Desktop notification setting.
Fixes #5879
2017-07-21 12:13:43 -07:00
Steve Howell 0e25055c1d Add explicit message field for locally_echoed.
We now set locally_echoed to true for messages that are
locally echoed, and we change some of our code to look
for this flag.
2017-07-21 11:38:25 -07:00
Steve Howell fca158e387 local echo: Remove pencil icon on failed messages.
Our code to edit messages that were echoed locally but failed
by the server was broken.  We just disable it for now.

We have opened #5841 to try to restore this functionality.
2017-07-21 11:38:25 -07:00
Steve Howell 7134bbfbe3 message edit: Prevent editing any failed messages.
Our logic for editing failed messages is broken in various ways,
so we are removing the codepath for editing for now.  We will
try to restore these features as part of #5841.
2017-07-21 11:38:25 -07:00
Steve Howell bd59b91faa reactions: Simplify markup related to message ids.
Because of local echo, message ids can change in message rows.
Having reactions use markup to indicate their message id just
creates more moving parts, since we would need to handle
message_id_changed events.

Now our handlers just call row.get_message_id() as needed.
2017-07-21 11:38:25 -07:00
Steve Howell 9a239f682d rows.js: Add get_message_id() helper. 2017-07-21 11:38:25 -07:00
Steve Howell c256b1663e local echo: Extract message_store.reify_message_id().
We no longer do the message_store piece of reifying ids
via a trigger.  We now make an explicit call to an
ordinary function.

This has several benefits:
    - no more initialize() function
    - no more scary comments about garbage collection
    - the function has a real name now
    - the function is less indented
    - we can easily see when the message_store step happens
    - simpler node tests
    - simpler tracebacks (no jQuery cruft)
2017-07-21 11:38:25 -07:00
Jack Zhang 4ea45743d0 landing-page: Remove navbar content max width.
Zulip's logo and navigation options stay aligned with the page
content on screens larger than 1440px.

Addresses #5693.
2017-07-20 16:56:29 -07:00
Steve Howell 084fc9c32a Indent topics in the left sidebar.
While demoing Zulip at PyCon, I learned that it is hard to
distinguish topics from streams in our left sidebar.
Indenting them by a few pixel seems to make it more clear
that topics belong to a stream.
2017-07-20 16:47:46 -07:00
Greg Price 0da71dfa48 gitignore: Forget obsolete path static/js/bundle.js .
We used to generate a file at this path in the static build,
but since 3f5d0e69f the corresponding output goes into
static/webpack-bundles instead.  Clear the now-dead path
from our gitignore files.
2017-07-19 14:19:20 -07:00
Greg Price 2ed02a0c5d gitignore: Anchor patterns that should be anchored. 2017-07-19 14:03:49 -07:00
Greg Price d35f062040 gitignore: Give some organization to the root .gitignore file.
Also add a comment explaining an important non-obvious wrinkle in how
paths in the format are interpreted, and adjust some paths to a
consistent style.
2017-07-19 14:02:28 -07:00
Steve Howell 8de28ec66d hotkeys: Fix glitch related to closing message edits.
If you use the escape key to close a message edit, we need
to blur out the text fields.  Otherwise, hotkeys.js thinks
we are still editing the text.  This bug would disable the
use of things like arrow keys until the user subsequently
focused another field.

We probably eventually want hotkeys.js to be smarter about
ignoring hidden fields that still have the focus, but there's
also no reason not to blur the fields here, and this is a more
local, less risky fix.
2017-07-19 10:10:35 -07:00
Brock Whittaker b78e99aa0e message-feed: Remove underline from external link icon. (#5848)
Currently when hovering over the external link icon generated when a topic contains a 
realm filter, an underline appears. This commit removes that underline.
2017-07-18 15:54:35 -07:00
Steve Howell 0deb59052e Extract get_local_notify_mix_reason().
There are also minor cleanups to notify_local_mixes() here.
2017-07-18 12:11:43 -07:00
Steve Howell eb2659a26a local echo: Rename function to notify_local_mixes().
This commit renames possibly_notify_new_messages_outside_viewport()
to the more concise name notify_local_mixes().

We really only need to call this function in one place, so we
have the caller check the `local_id` condition.  We can eventually
upstream this code even further so that it's completely
obvious that it's only ever called from the local-echo codepath.
2017-07-18 12:11:43 -07:00
Steve Howell b5cb21ab2c Remove unneeded call in maybe_add_narrowed_messages().
We were calling maybe_add_narrowed_messages() in a place
where local_id is guaranteed to be undefined, since
we always set local_id to undefined when
can_apply_locally() fails.

In turn maybe_add_narrowed_messages() was calling
possibly_notify_new_messages_outside_viewport(), which
requires a local_id to do anything meaningful.

This removes all the associated dead code--passing in
a parameter that we know always was undefined and
calling a function that we know always would no-op.

Not only does this simplify the code a bit, but it avoids
us stepping on the toes of the alternative code path that
deals with non-locally-echoed messages.
2017-07-18 12:11:43 -07:00
Steve Howell 0f7addf5e3 Clean up possibly_notify_new_messages_outside_viewport.
This commit early-exits before our loop when local_id is none,
and it tries to more clearly indicate that the callers will
generally be just calling this with messages sent on the
local-echo path.
2017-07-18 12:11:43 -07:00
Steve Howell 7d49bb8dbd Extract maybe_advance_to_recently_sent_message.
All the rest of the code in its caller was high-level dispatch
stuff, so it just looked fine of funny.
2017-07-18 12:11:43 -07:00
Steve Howell 1fd38e7e26 local echo: Make get_next_local_id() less aggressive.
We now make it so that get_next_local_id() only returns up
to 5 local ids relative to any given max id.

For example, if your pointer is at message 999, we'd give out
999.01, 999.02, ..., 999.05.

We also avoid giving out the same local id twice.  This prevents
a bug where if you had aborted a previously failed locally echoed
message, a subsequent local echo would get into a funny state.

In order to to prevent false alarms on using the same local id
twice, we call get_next_local_id() later in the try_deliver_locally()
function.
2017-07-18 12:03:16 -07:00
Steve Howell 92ad988144 local echo: Remove buggy restart-related code.
We had code that would try to re-render locally echoed messages
that were rendered right before a browser restart.  This code
has gotten buggy over time, so we are removing it for now.

We will try to re-solve the problem as part of #5825, but
possibly with a different strategy.
2017-07-18 12:03:16 -07:00
Joshua Pan 5e5ca48063 markdown.js: Fix inconsistent #**stream** on new line.
This commit removes all code related to headers because
(1) we don't need the code and (2) it splits #**stream**
as a paragraph, which we don't want. This commit also
fixes the inconsistency when #**stream** is on a new line.

Fixes #4678.
2017-07-18 11:07:25 -07:00
Pweaver (Paul Weaver) d3ffc81726 Enable Hot Module Replacement in webpack.
This allow the webbpack dev server to properly reload JavaScript modules
while running in dev without restarting the server. We need to connect
to webpack-dev-server directly because SockJS doesn't support more than
one connection on the same host/port.
2017-07-18 11:02:05 -07:00
Steve Howell 1ed35be88c stream_list: Use more direct code in build_stream_list.
We eliminate `.get(0)` calls in buld_stream_list.

The easy case is that we stop building jQuery objects
for the splitters only to pull out the DOM immediately.

The more subtle case is that we also don't do `.get(0)` calls
to get DOM out of our individual list items.  By passing
in full jQuery objects to `append()`, we should prevent ourself
from orphaning the old objects, which may in the future have
things like tooltip logic attached to them.
2017-07-18 09:58:16 -07:00
Tim Abbott 2317819e47 nginx: Use the Django 404 page for files under static/.
This elimintes the need for us to maintain duplicate copies of the
Zulip 404 error pages.

Fixes #5382.
2017-07-18 09:55:30 -07:00
Rishi Gupta a05de7ce84 settings: Fix Display Settings categorized as Language Settings.
"Display user list on left side in narrow windows." was a duplicate and
was removed.
2017-07-18 00:19:31 -07:00
Joshua Pan ec669a0c45 markdown.js: Fix inconsistent user mention on new line.
The user mention regex was checking for multiple lines,
so it broke when the user mention was on a new line.
This changes the regex AND adds a couple tests to
test inline markdown regexes.
2017-07-18 00:07:49 -07:00
Brock Whittaker 0d3ea50379 settings: Change .btn => .button components.
This changes all of the old bootstrap .btn buttons in the settings UI
to the new .button classes that they should be.
2017-07-17 17:20:09 -07:00
Vaida Plankyte c9bc803118 frontend: Change inaccurate aria-hidden assignments on buttons.
This either removes aria-hidden=true assignments from buttons with
text, or adds a span to only hide the 'x' symbol rather than the
button for closing buttons.
2017-07-17 16:40:28 -07:00
Brock Whittaker 1e7665effe message_feed: Remove unnecessary "user-select: none".
There is a "user-select: none" (cross-browser) that was put on
the #bottom_whitespace div, but the div doesn't actually have any
content that can be selected, and it also makes it difficult to
deselect selected text because when clicked over it will save the
current selection.
2017-07-17 16:27:30 -07:00
Brock Whittaker e5e73f364b settings: Change [Change] button styles. 2017-07-17 16:18:46 -07:00
Brock Whittaker 563847e5fe settings: Redesign and responsively fix account settings.
This makes the avatar portion more responsive and efficient on many
screen settings and also fixes some of the design incongruences present
on the page.
2017-07-17 16:18:31 -07:00
Brock Whittaker 3b9d084b29 settings: Modify notification settings headers for consistency.
This changes bold h4 headers to be thin h3 headers like the rest of the
pages.
2017-07-17 16:18:31 -07:00
Brock Whittaker 330a3bd144 setttings: Indent display settings checkboxes and fix header styles.
Aside from the indentation of checkboxes, the headers are added and
changed to become more unified with other page styling.
2017-07-17 16:15:04 -07:00
Brock Whittaker 005a58ecd6 settings: Add border-top to <li> for logout.
This makes the logout option in settings look more consistent with the
rest of the settings UI.
2017-07-17 16:14:46 -07:00
Brock Whittaker 38440d6ba4 Change product page nav and hero styling. 2017-07-17 16:12:36 -07:00
Brock Whittaker c27f57ed4b Change top of the /hello/ page to lighter scheme.
This changes the top of the page to a lighter scheme that uses a
gradient rather than having a dark blue background.
2017-07-17 16:10:54 -07:00
Vaida Plankyte 32c3d1b6f9 frontend: Add aria-label to organization overlay elements. 2017-07-17 11:46:41 -07:00
Vaida Plankyte 8512218899 frontend: Fix ARIA state and property values must be valid. 2017-07-17 11:46:41 -07:00
Brock Whittaker e5926d562e /help/: Fix responsiveness on mobile.
This changes the markdown section and sidebar to be the correct
height on mobile along with correcting the broken footer to always
appear below the content.

Fixes: #5798.
2017-07-17 10:59:20 -07:00
Vishnu Ks 32fddf9a8b analytics: Add translation tags to stats.js. 2017-07-16 16:20:20 -07:00
Durga Akhil Mundroy 146dfa6f0b org-permissions: Add allow_edit_history organiztion setting.
This new setting controls whether or not users are allowed to see the
edit history in a Zulip organization.  It controls access through 2
key mechanisms:

* For long-ago edited messages, get_messages removes the edit history
  content from messages it sends to clients.

* For newly edited messages, clients are responsible for checking the
  setting and not saving the edit history data.  Since the webapp was
  the only client displaying it before this change, this just required
  some changes in message_events.js.

Significantly modified by tabbott to fix some logic bugs and add a
test.
2017-07-16 10:10:06 -07:00
Cory Lynch 1dba70ca0d search_suggestion: Fix highlighting for multi-word streams.
I deleted a test case that involved a highlighted stream, but
the query was empty. This produces kind of a weird result with
typeahead_helper.highlight_with_escaping, but this function already
has coverage in node_tests/typeahead_helper.js, so the check here
was essentially redundant anyway. Specifically, the highlighter
wraps every character individually with <strong>, and looks really
messy in html.
2017-07-14 17:33:09 -07:00
Cory Lynch 76e4350d4d filter.js: Allow quotes to handle spaces in operand.
Fixes #3496. This was just a simple regex addition to filter
to accept the format `operand:"foo bar"` as a token. Also,
it will now accept an additional space after the separating colon.
2017-07-14 17:33:09 -07:00
Vaida Plankyte 28ea174ed9 backend: Implement high contrast mode display setting. 2017-07-14 14:53:24 -07:00
Tim Abbott 5cdfd61f2b lint: Require translation tags on aria-label tags.
Since these are, by their nature, directly user-facing strings, they
should always be tagged for translation.
2017-07-14 14:48:17 -07:00
Vaida Plankyte 216900b9e3 frontend: Add aria-label attributes to textareas/input fields. 2017-07-14 14:45:10 -07:00
Vaida Plankyte 6be210052e frontend: Fix label 'for' attribute to include correct name. 2017-07-14 14:45:10 -07:00
Vaida Plankyte b533732c6b frontend: Change custom_invite_body to use an ID. 2017-07-14 14:45:10 -07:00
Vaida Plankyte 1675867f30 frontend: Make ID assignments unique. 2017-07-14 14:45:09 -07:00
Steve Howell 475eb21a5e Revert commits related to client_message_id.
I pushed a bunch of commits that attempted to introduce
the concept of `client_message_id` into our server, as
part of cleaning up our codepaths related to messages you
sent (both for the locally echoed case and for the host
case).

When we deployed this, we had some strange failures involving
double-echoed messages and issues advancing the pointer that appeared
related to #5779.  We didn't get to the bottom of exactly why the PR
caused havoc, but I decided there was a cleaner approach, anyway.
2017-07-14 12:13:35 -07:00
Sawant Shah d3cce041a4 documentation: Make entire li element clickable.
documentation: Make the whole 'li' element clickable in left sidebar
links in /help/ page, instead of just the link part.

Fixes: #5797.
2017-07-14 09:52:36 -07:00
Vaida Plankyte c7c533fd4d frontend: Add feature illustrations to landing page. 2017-07-13 22:12:26 -07:00
Abhijeet Kaur 85b7a89d85 bots UI: Display message for empty 'Active/Inactive bots' tab.
Add a line of text stating that there are no active or inactive bots.

This is for better understanding of the user, as blank screen that
used to appear in case of no bots being present might seem broken
to some.

Tweaked by tabbott to improve the English.
2017-07-13 21:51:48 -07:00
Tim Abbott cbd5223429 i18next: Disable i18n cache in development. 2017-07-13 21:37:56 -07:00
Tim Abbott 8c5cce7f2b i18next: Decrease cache expiration time to a couple days. 2017-07-13 21:34:35 -07:00
Brock Whittaker e3f1d025ae i18n: Garbage collect old translations from localStorage.
The old translation copies in localStorage were not being removed
when they were no longer needed, so we can free up the storage
by deleting them.

This was accidentally not merged months ago when originally
implemented, but it was written to fix #4443 and in fact does so.
2017-07-13 21:33:49 -07:00
Steve Howell fe66d4f3b0 Encapsulate message_state.maybe_restart_event_loop().
We now set the timer for missing events inside the
message_state class, where it's easier for us to know
which state we're in.
2017-07-13 23:42:27 -04:00
Steve Howell bc67f6a8ca Add sent_messages.track_messages().
This change has us tracking messages as soon as we start
sending the message to the server.  The next step is to
reconfigure the timeouts a bit to deal with the server not
responding.
2017-07-13 23:42:27 -04:00
Steve Howell 9ee2be4a0d Use client_message_id as key for sent_messages lookups.
We now use a client-side message id to track the state of our
sent messages.  This sets up future commits to start tracking
state earlier in the message's life cycle.

It also avoids ugly reify logic where we capture an event to
update our data structure to key on the server's message id
instead of the local id.  That eliminates the node test as well.

Another node test gets deleted here, just because it's not
worth the trouble with upcoming refactorings.
2017-07-13 23:42:27 -04:00
Steve Howell 7e88fb25b3 Move sent_messages callbacks into transmit_message().
This mostly sets the stage for a subsequent commit to start
using client_message_id as the key into sent_messages.

It has the nice side effect of making it more explicit that
certain things should always happen when transmit_message()
succeeds.

This commit does regress our node test coverage a bit.
2017-07-13 23:42:27 -04:00
Steve Howell 68f8ba0449 Generate client_message_id() sequentially.
This commit starts to decouple client_message_id from local_id.

We don't really take advantage of the decoupling in this
commit--in fact, it's a bit of a pain at first.  But this should
be a fully working checkpoint commit.
2017-07-13 23:42:27 -04:00
Steve Howell 25b59d0044 Extract sent_messages.message_state class.
This class helps us encapsulate the state of a message, with all
the dates/flags that get sent as part of /json/report_send_time.
2017-07-13 23:42:27 -04:00
Steve Howell f6d670ae3d Extract sent_messages.js.
This is mostly straightforward moving of code out of compose.js.

The code that was moved currently supports sending time
reports for sent messages, but we intend to grow out the new
module to track more state about sent messages.

The following function names in this commit are new, but their
code was basically pulled over verbatim:

    process_success (was process_send_time)
    set_timer_for_restarting_event_loop
    clear
    initialize

All the code in the new module is covered by previous tests that
had been written for compose.js.  This commit only modifies
a few things to keep those tests.

The new module has 100% node coverage, so we updated `enforce_fully_covered`.
2017-07-13 23:42:27 -04:00
Steve Howell 8fbb55df85 Introduce client_message_id on the server.
We are deprecating local_id/local_message_id on the Python server.
Instead of the server knowing about the client's implementation of
local id, with the message id = 9999.01 scheme, we just send the
server an opaque id to send back to us.

This commit changes the name from local_id -> client_message_id,
but it doesn't change the actual values passed yet.

The goal for client_key in future commits will be to:
    * Have it for all messages, not just locally rendered messages
    * Not have it overlap with server-side message ids.

The history behind local_id having numbers like 9999.01 is that
they are actually interim message ids and the numerical value is
used for rendering the message list when we do client-side rendering.
2017-07-13 23:42:27 -04:00
Jack Zhang bab96ab8a0 landing-page: Adjust font size for long integration categories/names. 2017-07-13 20:37:09 -07:00
Jack Zhang 6e2f90c8c9 Improve /integrations page load time.
Prior to this commit, 7 megabytes of images (through 253 individual requests)
were heavily slowing down the initial load. With this commit, we load only the
logos (60 or so images).

Documentation and images for the individual integration sub-pages is requested
separately using the /integrations/doc/ endpoint, which returns HTML.
2017-07-13 20:37:09 -07:00
Jack Zhang 9ddef6a4da landing-page: Add 'Create your own!' integration tile. 2017-07-13 20:37:09 -07:00
Jack Zhang a7e2e9512b landing-page: Fix individual integration display on mobile. 2017-07-13 20:35:37 -07:00
Jack Zhang 7e0d67ab74 landing-page: Hide integration category labels when filtered. 2017-07-13 20:34:36 -07:00
Jack Zhang 9a53514577 landing-page: Decrease integrations catalog minimum height. 2017-07-13 20:33:02 -07:00
Brock Whittaker 1cf7ee966b help: Redesign /help/ pages to be a single page app.
This redesigns the /help/ page sets to be a single page app that uses
history.pushState to work the same as the old app.

The big new feature is that now we have the index in a nicely designed
left sidebar.
2017-07-13 15:43:44 -07:00
Harshit Bansal 1f826c20a2 emoji: Live update `Custom emoji` UI.
When the `add_emoji_by_admins_only` setting is changed, reflect the changes
in the `Custom emoji` UI.

Fixes: #5769.
2017-07-13 14:08:30 -07:00
Harshit Bansal 42ac7fa5cc server_events: Fix the updation code for `add_emoji_by_admins_only`.
`add_emoji_by_admins_only` backend setting is represented by page_param's
`realm_add_emoji_by_admins_only` attribute. When this setting was changed
we were wrongly updating the `add_emoji_by_admins_only` attribute which
doesn't exist.
2017-07-13 14:08:30 -07:00
Harshit Bansal 86de196d12 emoji: Don't lock out admins when only admins are allowed to upload emoji.
Prior to this, when the setting for controlling whether can admins only
upload an emoji was set to true, we were not displaying upload emoji form
even for admins and as a result they were locked out.
2017-07-13 14:08:30 -07:00
Vaida 281ca8263d frontend: Increase contrast of text on login/register pages.
Darkened login/register texts: google and github buttons,
login description links, footers.
2017-07-12 17:40:54 -07:00
Tim Abbott ac3e9256bb frontend: Remove unused sender_name_hovered CSS. 2017-07-11 16:30:34 -07:00
Vaida Plankyte 74ab5b607a frontend: Change main UI content to not be background images. 2017-07-11 16:30:07 -07:00
Srimukh b2f105ac7e landing: Prevent selecting the of X icon in mobile navigation.
This prevents accidental selection of the close button (X) of the left
sidebar on mobile landing page.

Fixes #5259.
2017-07-11 15:35:18 -07:00
Eeshan Garg b37ace33ee help: Document bot types in add-a-bot-or-integration. 2017-07-11 13:25:51 -04:00
Eeshan Garg 37fbed0993 webhooks: Recommend creating "incoming webhook" bot.
In all our webhooks' docs, we now recommend creating a bot with the
"Incoming webhook" bot type.
2017-07-11 13:25:51 -04:00
Aditya Bansal 2342a8f0e4 compose.js: Remove dead code from get_invalid_recipient_emails().
The piece of code is dead since there can be no instance where
email === ''. This is ensured by util.extract_pm_recipients
by filtering for empty strings in the pm_recipients list.
2017-07-11 12:14:09 -04:00
Aditya Bansal 93a003749e compose.js: Remove dead code from mark_end_to_end_display_time().
This piece was dead because exports.send_times_data[message_id]
cannot be undefined since the only place this function is called
from is exports.report_as_received() and that function has a call
to mark_end_to_end_receive_time() before a call is made to the
function in question for dead code. The function call to
mark_end_to_end_receive_time results in
exports.send_times_data[message_id] = {} if this was not defined
already. So there can be no instance where we end up the code
being removed.
2017-07-11 12:14:09 -04:00
Aditya Bansal 237ec76bdc compose.js: Remove broken test_send_many_messages(). 2017-07-11 12:14:09 -04:00
Vaida Plankyte 96321b3069 frontend: Darken the static error pages text. 2017-07-09 13:54:29 -07:00
Durga Akhil Mundroy 38b70f27d9 typeahead: Use recent_senders/pm_conversations to sort suggestions.
In typeahead_helper.js, added a compare function to first sort by
subscription, then by pm partners and lastly based on recency in the
current topic. Altered function sort_for_at_mention to take topic data
and sort using the above function. Also altered node tests for
typeahead_helper.js to test for the above added functionality.

Fixes: #4249
2017-07-09 10:51:19 -04:00
Steve Howell ff80ba4f99 autofocus: Remove unneeded `$(...)[0]` idiom.
Using the first element of a jQuery collection is either
unnecessary or extremely brittle.
2017-07-09 08:31:22 -04:00
Steve Howell 1cf18cfbeb compose: Avoid render for duplicate mentions.
There is no reason to render the template for compose mention
warnings if the user is already in the widget.

This commit also restructures the unit test significantly to more
carefully exercise each case, particularly in regard to when
templates get rendered.
2017-07-09 08:30:46 -04:00
Aditya Bansal 05a21b3729 compose.js: Fix Jquery selector to use more prominent syntax. 2017-07-09 07:26:09 -04:00
Abhijeet Kaur 6869e6a1ec bots UI: Create a new bot switches tab to "Active bots".
Creating a new bot (by filling out the bots related fields and clicking
"Create bot" button) changes tab from "Add a new bot" to "Active bots".
This is done to make users know/confirm that the bot has been created and
the user can view it in this tab.

Fixes: #5731
2017-07-08 14:30:45 -07:00
Abhijeet Kaur 09b8e1f644 bots UI: Make "Active bots" the default tab in "#settings/your-bots".
This is to make viewing bots easy from user's perspective. As the
most used tab in "Active bots", "Inactive bots" and "Add a new bot"
would be the first one.
2017-07-08 14:30:45 -07:00
Abhijeet Kaur 1214505ab7 bots UI: Make "Add a new bot" tab the third tab instead of the first one. 2017-07-08 14:30:45 -07:00
Cory Lynch 4f8a2d0c57 filter.js: Make from/sender descriptions more concise. 2017-07-07 20:54:54 -07:00
Cory Lynch 2ce7a20237 search_suggestion: Support autocompleting operator names.
Fixes #5399
2017-07-07 20:54:54 -07:00
Cory Lynch 2e9ec5e958 search_suggestion: Remove unknown operand from 'is'.
Fixes #5400
2017-07-07 20:54:54 -07:00
Tim Abbott e226073d1d stream_create: Use stream_name as local variable for stream names.
This is a lot clearer than using "stream", which could refer to an
actual object.
2017-07-07 19:31:47 -07:00
Tim Abbott cbdffeda82 subscriptions: Edit copy for the new stream creation confirmation flow.
The new text is a bit simpler and clearer.

We also decrease the threshhold for this page to 50 subscribers.
2017-07-07 19:22:34 -07:00
Harshit Bansal 60e5071843 subscriptions: Confirm inviting 100+ users to a new stream.
Our current workflow for creating a new stream allows the user to
invite as many other users as they like but since there can be
mistakes in doing so, we now open a modal with a warning if the
number of invites are more than 100 just to confirm that user indeed
wanted to do this.

Fixes: #1663.
2017-07-07 19:08:04 -07:00
Tim Abbott 054f7db63b stream_create: Extract create_stream. 2017-07-07 19:07:36 -07:00
Tim Abbott 989d58fd06 stream_create: Extract get_principals. 2017-07-07 19:04:55 -07:00
Tim Abbott a4a654034c errors: Fix paths to error page art.
Previously, these only worked with certain base URLs.
2017-07-07 18:50:13 -07:00
Brock Whittaker 626c5ef55e analytics: Restyle and refactor /stats page.
This completes a major redesign of the /stats page.
2017-07-07 18:22:32 -07:00
Tim Abbott 33e8edef98 frontend: Use CSS classes, not IDs, for error_page CSS.
This makes our templates linter happy and is a bit cleaner.
2017-07-07 17:45:11 -07:00
Tim Abbott 2ccd5aa758 devtools: Document better solution for editing error pages. 2017-07-07 17:45:11 -07:00
Vaida Plankyte 1b12a9122f frontend: Redesign 4xx page. 2017-07-07 17:45:10 -07:00
Vaida Plankyte 14865770a0 frontend: Redesign 5xx error page to be pretty. 2017-07-07 17:27:21 -07:00
Tim Abbott f2379d66a2 i18n: Fix capitalization of Zulip Botserver download code. 2017-07-07 17:02:39 -07:00
Greg Price 4b765ae304 i18n: Fix a smattering of strings that weren't getting translated.
These are some strings I spotted in English when playing around a bit
with the UI set to German, where our translations are near complete.

It'd be great to have a more systematic way of spotting this kind of
omission.  Probably a fairly simple linter could catch a lot of cases.
2017-07-07 16:59:23 -07:00
Greg Price 038a2c7692 unread_ui: Wait for i18n setup before rendering.
Without this, the "Since you were last here" text got rendered in
English for me every time when I tested in German, both in dev
and on chat.zulip.org.

This brings us to 9 places we invoke `ensure_i18n`.  That seems
like a sign that there may well be more places we're still
missing, and that we should probably find a more systematic way
to make sure all our frontend UI rendering waits for translation
to be ready.  Anyway, for now, fix this one.
2017-07-07 16:59:23 -07:00
Brock Whittaker 28861c225b settings: Move streams list table filter closer to table.
The filter input was at the top of the page above a creation modal when
it should be directly above the table.
2017-07-07 16:07:58 -07:00
Brock Whittaker 7b098d77e4 settings: Change notification settings top text to tip. 2017-07-07 16:06:47 -07:00
Brock Whittaker 375b25c91f settings: Indent UI settings checkboxes. 2017-07-07 16:05:07 -07:00
Brock Whittaker 968c4e7586 settings: Change UI settings top text to tip. 2017-07-07 16:05:04 -07:00
Brock Whittaker bd664b0dd5 portico: Fix background color; remove need for bg-image classes. 2017-07-07 15:30:47 -07:00
Jack Zhang c5cdede891 portico-css: Reposition header, portico-page content, and footer. 2017-07-07 15:29:43 -07:00
Vaida d5517bae36 Delete the old zulip.com "referrals" system.
This system hasn't been in active use for several years, and had some 
problems with it's design.  So it makes sense to just remove it to declutter
the codebase.

Fixes #5655.
2017-07-07 14:59:18 -07:00
Vishnu Ks fcd944447e common.js: Don't set default password quality/length in frontend.
The min quality/length values are always available via data
attributes. So there is no point of specefying a default value
in common.js.
2017-07-07 14:48:06 -07:00
Vishnu Ks f2e6e16fe4 account-settings: Include password length and quality data attributes. 2017-07-07 14:48:06 -07:00
Vishnu Ks f273e83a85 portico: Explain why password is weak to user. 2017-07-07 14:48:06 -07:00
Vaida Plankyte 6e3308a5ac frontend: Make table headers fixed.
Tweaked by tabbott to update the users list as well.

Fixes #4746.
2017-07-07 12:18:58 -07:00
Cory Lynch 75617d07de search_suggestions: Prioritize recent huddles.
Fixes #5612. What this specifically does is that if you are
typing a group PM, this logic iterates through the possible
search suggestions for the next autocomplete. If that suggestion
contains a group PM that already exists, then prioritize it with
the most recent one on top.
2017-07-07 12:12:30 -07:00
Cory Lynch 7efba29b0c search_suggestions: Hide own name in huddle suggestions. 2017-07-07 12:12:30 -07:00
Vishnu Ks 9067890120 urls: Use POST for zerver.views.user_settings.set_avatar_backend.
The set_avatar_backend is changed from PUT to POST becuase this
is not idempotent.
2017-07-07 10:31:43 -07:00
Vishnu Ks df5df76961 urls: Use POST for zerver.views.realm_emoji.upload_emoji.
The upload_emoji endpoint is changed from PUT to POST because
this endpoint is not idempotent.
2017-07-07 10:31:43 -07:00
Vishnu Ks cf2dec539f urls: Use POST for zerver.views.realm_icon.upload_icon.
This upload_icon endpoint is changed from PUT to POST becuase
this endpoint is not idempotent.
2017-07-07 10:31:43 -07:00
Aditya Bansal c7ec7f98d9 compose.js: Use on() instead of deprecated bind(). 2017-07-07 07:50:02 -04:00
Jack Zhang 16385db3d7 landing-page.js: Implement fuzzysearch and category filtering.
On /integrations.

For scalability and people who type fast, update_integrations is
debounced; the function will postpone its execution until after
50 milliseconds after it was last invoked.
2017-07-06 15:28:50 -07:00
Jack Zhang 3f9bfd2ae2 portico: Create search/catalog visuals in /integrations.
Responsive designs for the search bar, categories sidebar,
categories dropdown, and integration tiles.
2017-07-06 15:28:50 -07:00
Jack Zhang 9d242ad7df Match size of headings on /apps with /integrations for consistency. 2017-07-06 15:28:50 -07:00
Jack Zhang 37a80d5cc4 portico: Redesign and rewrite /integrations text headings. 2017-07-06 15:28:50 -07:00
Aditya Bansal 2b14714e3b compose.js: Export send_message().
We do this in order to have the definition of send_message()
accessible to the outside world. This will help in testing
this function.
2017-07-06 17:44:27 -04:00
Abhijeet Kaur 343cb20d57 bots: Move "Add a new bot" to its own tab in settings UI.
"Add a new bot" UI used to be common in "Active bots" and
"Inactive bots". "Add a new bot" UI was below the list of all
active/inactive bots.

If there were more than a few bots was more than four, then the user
had to scroll down the entire list of bots to "Add a new bot", which
was annoying.  This new model makes the UI look cleaner as well.
2017-07-06 09:24:28 -07:00
Vaida Plankyte 0452978e6a frontend: Increase contrast of sidebar captions. 2017-07-06 11:21:52 -04:00
Vaida Plankyte 31c134aff2 settings: Improve public/private stream descriptions. 2017-07-06 11:18:32 -04:00
Brock Whittaker c4c3124d34 settings: Indent organization permissions checkboxes. 2017-07-05 17:50:04 -07:00
Brock Whittaker bd23e0a62b settings: Change bot settings top text to a tip. 2017-07-05 17:45:59 -07:00
Brock Whittaker 62cc8b658e settings: Change stream list top text to a tip. 2017-07-05 17:45:52 -07:00
Brock Whittaker 1b616d761e settings: Fix email input whitespace issue.
This fixes the issue where the email has whitespace potentially in the
input due to the HTML formatting.
2017-07-05 17:45:30 -07:00
Harshit Bansal efc2df168c subs: Fix the autocomplete suggestions while adding subscribers.
Earlier, the autocomplete was also showing the emails of the users who
were already subscribed to the stream.

Fixes: #4028.
2017-07-05 13:22:07 -07:00
Harshit Bansal 598535717b emoji_picker: Extract `add_scrollbar()` function.
Calling this function with  an element will cause a `perfectScrollbar` to
be added to it.
2017-07-05 13:14:40 -07:00
Harshit Bansal a6cd460f72 emoji: Rename `emoji.realm_emojis` to `emoji.all_realm_emojis`. 2017-07-05 13:02:41 -07:00
Harshit Bansal 29ff36cd2a reactions: Don't send add/remove requests for deactivated realm emojis.
Eventually, we'll want to support unreacting to deactivated realm
emoji, but for now the issues around name conflicts mean we can't
really support that.
2017-07-05 13:02:20 -07:00
Harshit Bansal c4ec9523fc frontend: Make sure deactivated emojis don't appear for use anywhere.
Deactivated emojis should not appear at any of the following places for
use:
1: Emoji pickers.
2: Composebox autocomplete.
3: Custom emoji settings page.
2017-07-05 13:00:14 -07:00
Harshit Bansal 9e40f063d6 markdown: Use `active_realm_emojis` instead of `realm_emojis`.
We should use `active_realm_emojis` instead of manually checking for
deactivated emojis in `realm_emoji` dict.
2017-07-05 12:05:10 -07:00
Harshit Bansal 90f04062e7 emoji.js: Add `active_realm_emojis` dict.
This dict will hold all the realm emojis which have not been deactivated.
2017-07-05 12:05:10 -07:00
Vaida Plankyte 9b279072df notifications.js: Use the singular 'they' pronoun. 2017-07-05 09:27:44 -07:00
Vaida Plankyte 5a3d3ae291 narrow.js: Use the singular 'they' pronoun. 2017-07-05 09:27:43 -07:00
David Coleman 77dc5df56a uploads: Display year in attachments UI upload timestamp.
Modified timerender.js absolute_time() to include the
year in the returned time stamp string.

Fixes #5600.
2017-07-04 16:13:20 -07:00
Franziska von der Goltz 98847937f4 realm: add mandatory topic setting on org level.
Lets organizations require users to specify a topic the discussion.

Fixes: #5164.
2017-07-04 14:09:21 -07:00
Cory Lynch b13265d135 util: Remove execute_early.
This function was removed in favor of loading everything in
ui_init.js. The asynchronous nature of jQuery 3 document-ready
events may cause an undesirable order in which these are executed.
2017-07-04 13:54:33 -07:00
Cory Lynch effd7ef41f server_events: Move initialization to ui_init.js. 2017-07-04 13:54:33 -07:00
Cory Lynch e33b178054 message_store: Move initialization to ui_init.js. 2017-07-04 13:54:33 -07:00
Cory Lynch 25be3a402d message_fetch: Move initialization to ui_init.js.
This involves modifying a casper test, because now
upon registration, there is one unread message.
2017-07-04 13:54:33 -07:00
Brock Whittaker 7d005919ca portico: Improve detection of URL in product page JS.
The product page JS detects the page to run small bundle functions
but does not work correctly with language prefixes in the pathname,
such as /es/apps, so this properly detects that.

Fixes #5635.
2017-07-03 10:22:38 -07:00
Harshit Bansal d3d6712fa3 left-sidebar: Update the size of the scrollbar after narrowing to a stream. 2017-07-03 09:53:41 -07:00
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
Umair Khan 90ec20b4e4 Remove English translations.json from source control.
This commit deletes the file from git repo and adds the
file to gitignore.

Fixes #5640
2017-07-03 10:10:43 -04:00
Cory Lynch f848ffc03b Patch spectrum.js for jQuery 3 compatibility.
This includes removing deprecated functions
(namely bind/unbind/delegate) and fix an aspect
of event handling that breaks in the new jQuery.
2017-07-02 07:59:24 -04:00
Cory Lynch 10fa6b75f9 Patch filedrop for jQuery 3 compatibility.
This entails removing the use of jQuery.event.props,
which has been removed from jQuery 3.
2017-07-02 07:59:24 -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 12b124ba71 single_message.handlerbars: Use __starred_status__ in tooltip.
We do not allow handlerbars within tranlation tags. To use variables in
translatable strings, enclose variables with double lowdashes.
2017-06-29 07:39:20 -04:00
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
tejaskasetty 69e8e06104 stream-popover: Remove overlapping of chevron and the scrollbar.
- Move the chevron and the message count a bit towards
   left.
 - Make changes in the position of message count in
   global_filters to align it with of message count in
   stream_filters.
 This fixes the overlapping of stream popover with the
 scrollbar in the stream list.

 Fixes: #5552.
2017-06-28 06:55:31 -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 1324596cdd docs: Document /streams/{stream_id} API endpoint. 2017-06-27 08:33:56 -04:00
Yago González b18a4e7371 docs: Remove unnecessary type declaration. 2017-06-27 08:33:56 -04:00
Yago González 33e4855306 lint: Ban non-unique operationIds in Swagger.
The Swagger specification indicates that all operationId values should be
unique. However, SwaggerParser doesn't complain during validation if that
doesn't happen, so this commit adds our own method to identify these
cases.

Also, the violations of this rule have been fixed.
2017-06-26 22:02:26 -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 024362278e templates: Remove unnecessary newlines in typeahead_list_item. 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
Eeshan Garg b60c95d971 integrations/svn: Use Markdown macros. 2017-06-26 12:30:04 -04:00
Yago González 05f1992503 docs: Document /get_stream_id API endpoint. 2017-06-26 09:02:49 -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 d570447850 drafts: Remove extra margin in draft message content. 2017-06-25 12:28:14 -04:00
Sampriti Panda b2a1754f8a drafts: Re-narrow on restoring draft.
Fixes #4587
2017-06-25 12:26:42 -04:00
Yago González 550350c27f docs: Document /dev_fetch_api_key API endpoint. 2017-06-25 12:23:10 -04:00
Yago González 1c3b0a8b03 docs: Document /fetch_api_key API endpoint. 2017-06-25 12:23:10 -04:00
Yago González 30e8a04596 docs: Amend definitions of JSON responses. 2017-06-25 12:23:10 -04:00
Yago González 29fa89273e docs: Fix formatting in the Swagger YAML file. 2017-06-25 12:23:10 -04:00
Yago González 687acf89a6 docs: Sort REST API endpoints alphabetically. 2017-06-25 12:23:10 -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
Cory Lynch 95d86c8aeb zulip.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch bfd92235c5 typing_notifications.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch a5328be9a1 subscriptions.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 74fd7e0865 stats.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 25d0810f76 settings.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch c7697f8286 right-sidebar.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch c33dc4a5a5 reactions.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 6e9bf1b563 portico.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 67da0ef9dd portico-signin.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch d04fbc0a53 popovers.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch fa73872828 media.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 1b2d44b016 lightbox.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 7bfb902032 left-sidebar.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 5f6ebaba45 landing-page.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 94ccbb71b0 informational-overlays.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 1b4ca9dff8 drafts.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 7e869cf5b2 compose.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch d1d1906460 components.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -04:00
Cory Lynch 7dd0ae33ad activity.css: Replace RGB colors with HSL colors. 2017-06-21 07:02:57 -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
vaibhav 9a6e326305 Add support for generating and downloading flaskbotrc.
Flaskbotrc is a file containing config of all active
outgoing webhook bots. It is used to provide configuration
of all active outgoing webhook bots to zulip-bot-server.
2017-06-20 09:43:45 -04:00
Cory Lynch 387f37c15e popovers.js: Fix keyboard shortcuts with copying link.
Fixes #5374.
2017-06-20 06:28:25 -04:00
Cory Lynch d5bcfc415d emoji_picker.js: Fix popover icon that persists after exit.
Another manifestation of #4329, as this bug
also applied to the emoji popover.
2017-06-20 06:28:25 -04:00
Cory Lynch 801e4f6f6e popovers.js: Fix chevron that persists when exiting.
Fixes #4329.
2017-06-20 06:28:25 -04:00
Cory Lynch 55917b6761 message_store.js: Remove obsolete clear() function. 2017-06-20 06:24:27 -04:00
Vishnu Ks 9b16835c99 user_popover: Handle the case when user presence is unknown.
For bots and users who have not logged in for a long time the presence information is not known. For the these users make the presence indicator hidden.
2017-06-19 17:25:06 -04:00
vaibhav 33c0c00cd6 Outgoing webhook System: first Iteration of outgoing webhook UI. 2017-06-19 16:05:54 -04:00
Cory Lynch 6255636923 Support special characters for code block languages.
Fixes #5412
2017-06-19 06:53:25 -04:00
Cory Lynch 58a2ffbe1d Add search suggestion support for is:unread. 2017-06-19 06:51:13 -04:00
Cory Lynch 86d3e00bd0 Add search support for is:unread.
Fixes #1423.
2017-06-19 06:51:13 -04:00