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>
This commit is contained in:
Anders Kaseorg
2019-11-01 16:06:25 -07:00
committed by Tim Abbott
parent f7245e9ec6
commit 28f3dfa284
279 changed files with 6102 additions and 6102 deletions

View File

@@ -1,5 +1,5 @@
exports.display_checkmark = function ($elem) {
var check_mark = document.createElement("img");
const check_mark = document.createElement("img");
check_mark.src = "/static/images/checkbox-green.svg";
$elem.prepend(check_mark);
$(check_mark).css("width", "13px");
@@ -15,14 +15,14 @@ exports.strings = {
// UI. Intended to replace the old system that was built around
// direct calls to `ui_report`.
exports.do_settings_change = function (request_method, url, data, status_element, opts) {
var spinner = $(status_element).expectOne();
const spinner = $(status_element).expectOne();
spinner.fadeTo(0, 1);
loading.make_indicator(spinner, {text: exports.strings.saving});
var success_msg;
var success_continuation;
var error_continuation;
var remove_after = 1000;
var appear_after = 500;
let success_msg;
let success_continuation;
let error_continuation;
let remove_after = 1000;
const appear_after = 500;
if (opts !== undefined) {
success_msg = opts.success_msg;