mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
js: Convert jQuery.each to for…of.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
22f3ec44bc
commit
7b0dea0351
@@ -560,9 +560,9 @@ exports.set_up = function () {
|
||||
const form_data = new FormData();
|
||||
|
||||
form_data.append('csrfmiddlewaretoken', csrf_token);
|
||||
jQuery.each(file_input[0].files, function (i, file) {
|
||||
for (const [i, file] of Array.prototype.entries.call(file_input[0].files)) {
|
||||
form_data.append('file-' + i, file);
|
||||
});
|
||||
}
|
||||
|
||||
$("#user-avatar-source").hide();
|
||||
|
||||
|
||||
@@ -276,9 +276,9 @@ exports.set_up = function () {
|
||||
});
|
||||
formData.append('config_data', JSON.stringify(config_data));
|
||||
}
|
||||
jQuery.each($('#bot_avatar_file_input')[0].files, function (i, file) {
|
||||
for (const [i, file] of Array.prototype.entries.call($('#bot_avatar_file_input')[0].files)) {
|
||||
formData.append('file-' + i, file);
|
||||
});
|
||||
}
|
||||
loading.make_indicator(spinner, {text: i18n.t('Creating bot')});
|
||||
channel.post({
|
||||
url: '/json/bots',
|
||||
@@ -450,9 +450,9 @@ exports.set_up = function () {
|
||||
});
|
||||
formData.append('config_data', JSON.stringify(config_data));
|
||||
}
|
||||
jQuery.each(file_input[0].files, function (i, file) {
|
||||
for (const [i, file] of Array.prototype.entries.call(file_input[0].files)) {
|
||||
formData.append('file-' + i, file);
|
||||
});
|
||||
}
|
||||
loading.make_indicator(spinner, {text: 'Editing bot'});
|
||||
edit_button.hide();
|
||||
channel.patch({
|
||||
|
||||
@@ -139,9 +139,9 @@ exports.set_up = function () {
|
||||
emoji[obj.name] = obj.value;
|
||||
}
|
||||
|
||||
$.each($('#emoji_file_input')[0].files, function (i, file) {
|
||||
for (const [i, file] of Array.prototype.entries.call($('#emoji_file_input')[0].files)) {
|
||||
formData.append('file-' + i, file);
|
||||
});
|
||||
}
|
||||
channel.post({
|
||||
url: "/json/realm/emoji/" + encodeURIComponent(emoji.name),
|
||||
data: formData,
|
||||
|
||||
@@ -1084,9 +1084,9 @@ exports.build_page = function () {
|
||||
const form_data = new FormData();
|
||||
|
||||
form_data.append('csrfmiddlewaretoken', csrf_token);
|
||||
jQuery.each(file_input[0].files, function (i, file) {
|
||||
for (const [i, file] of Array.prototype.entries.call(file_input[0].files)) {
|
||||
form_data.append('file-' + i, file);
|
||||
});
|
||||
}
|
||||
|
||||
const error_field = $("#realm_icon_file_input_error");
|
||||
error_field.hide();
|
||||
@@ -1121,9 +1121,9 @@ exports.build_page = function () {
|
||||
let button_text;
|
||||
|
||||
form_data.append('csrfmiddlewaretoken', csrf_token);
|
||||
jQuery.each(file_input[0].files, function (i, file) {
|
||||
for (const [i, file] of Array.prototype.entries.call(file_input[0].files)) {
|
||||
form_data.append('file-' + i, file);
|
||||
});
|
||||
}
|
||||
if (night) {
|
||||
error_field = $("#night-logo-section .realm-logo-file-input-error");
|
||||
spinner = $("#night-logo-section .upload-logo-spinner");
|
||||
|
||||
Reference in New Issue
Block a user