mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
js: Convert static/js/typing.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
86dfb35ff3
commit
63ce32b36e
@@ -1,8 +1,6 @@
|
||||
"use strict";
|
||||
import * as typing_status from "../shared/js/typing_status";
|
||||
|
||||
const typing_status = require("../shared/js/typing_status");
|
||||
|
||||
const people = require("./people");
|
||||
import * as people from "./people";
|
||||
|
||||
// This module handles the outbound side of typing indicators.
|
||||
// We detect changes in the compose box and notify the server
|
||||
@@ -54,8 +52,9 @@ function notify_server_stop(user_ids_array) {
|
||||
send_typing_notification_ajax(user_ids_array, "stop");
|
||||
}
|
||||
|
||||
exports.get_recipient = get_user_ids_array;
|
||||
exports.initialize = function () {
|
||||
export const get_recipient = get_user_ids_array;
|
||||
|
||||
export function initialize() {
|
||||
const worker = {
|
||||
get_current_time,
|
||||
notify_server_start,
|
||||
@@ -65,7 +64,7 @@ exports.initialize = function () {
|
||||
$(document).on("input", "#compose-textarea", () => {
|
||||
// If our previous state was no typing notification, send a
|
||||
// start-typing notice immediately.
|
||||
const new_recipient = is_valid_conversation() ? exports.get_recipient() : null;
|
||||
const new_recipient = is_valid_conversation() ? get_recipient() : null;
|
||||
typing_status.update(worker, new_recipient);
|
||||
});
|
||||
|
||||
@@ -74,6 +73,4 @@ exports.initialize = function () {
|
||||
$(document).on("compose_canceled.zulip compose_finished.zulip", () => {
|
||||
typing_status.update(worker, null);
|
||||
});
|
||||
};
|
||||
|
||||
window.typing = exports;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user