Commit Graph

19 Commits

Author SHA1 Message Date
Tim Abbott 862061fa53 lint: Fix JS style in last commit. 2021-11-01 11:07:01 -07:00
YashRE42 c696b78eec refactor: Extract "load_and_set_favicon" in favicon.js.
This is a prep commit to reduce duplication when implementing custom
favicons.
2021-11-01 10:54:56 -07:00
Anders Kaseorg 7f9e5e2aad favicon: Fix embedded number font for Webpack 5 asset modules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-16 17:20:30 -07:00
Anders Kaseorg 879ca4543b favicon: Catch exceptions in update_favicon.
We’re getting unexplained exceptions from URL.createObjectURL in
Firefox 88 (#18374); contain them to this function.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-12 15:06:59 -07:00
Anders Kaseorg ea9ca6b7d0 js: Use jQuery as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-12 10:08:25 -08:00
Anders Kaseorg ba0ee6ddfa dependencies: Upgrade Source Sans Pro font to Source Sans 3.
https://blog.adobe.com/en/2020/11/30/whats-new-in-source-sans-3.html

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 14:55:33 -08:00
Anders Kaseorg 954ad9f7ab favicon: Invalidate favicon_state.image without a network request.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-28 23:06:26 -07:00
Anders Kaseorg 55146aaa1a favicon: Close race condition in Chrome bug workaround.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-22 11:24:57 -07:00
Anders Kaseorg 5c6202ca97 notifications: Use a dynamic SVG favicon for unread counts.
Closes #2304.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-21 07:43:00 -07:00
Anders Kaseorg 6ec808b8df js: Add "use strict" directive to CommonJS files.
ES and TypeScript modules are strict by default and don’t need this
directive.  ESLint will remind us to add it to new CommonJS files and
remove it from ES and TypeScript modules.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-31 22:09:46 -07:00
Anders Kaseorg b65d2e063d js: Reformat with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg f3726db89a js: Normalize strings to double quotes.
Prettier would do this anyway, but it’s separated out for a more
reviewable diff.  Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:24 -07:00
Anders Kaseorg c080b4da06 favicon: Remove ancient browser workarounds.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-15 20:56:58 -07:00
Anders Kaseorg 28f3dfa284 js: Automatically convert var to let and const in most files.
This commit was originally automatically generated using `tools/lint
--only=eslint --fix`.  It was then modified by tabbott to contain only
changes to a set of files that are unlikely to result in significant
merge conflicts with any open pull request, excluding about 20 files.
His plan is to merge the remaining changes with more precise care,
potentially involving merging parts of conflicting pull requests
before running the `eslint --fix` operation.

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

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-25 13:51:21 -07:00
Armaan Ahluwalia 6d255efe4c app: Prepare JS files for consumption by webpack.
This commit prepares the frontend code to be consumed by webpack.

It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.

However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.

So we expose the modules by setting window.varName = varName; as
needed in the js files.
2018-07-05 10:53:36 +02:00
Tim Abbott 2bc14d256f lint: Ban two spaces after comma in JS code.
We exclude the frontend tests, mostly because the lint rule isn't that
precise, and the test code has some sample user input that's a bit
funny.
2017-10-18 10:22:18 -07:00
Brock Whittaker d02414ee88 Switch from deprecated $.browser to userAgent test.
$.browser is not supported in higher versions of jQuery. The solution
is to instead use vanilla JavaScript to test the navigator.userAgent
property for the browser.

Fixes: #1033.
2016-08-25 14:12:58 -07:00
Steve Howell 7fce920522 Move favicon-related functions to favicon.js
util.reset_favicon -> favicon.reset
util.set_favicon -> favicon.set

(imported from commit 250848ec5dc7ac58649197c8cc4b7b4e7b19f25c)
2014-03-14 20:48:55 -04:00