mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +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
@@ -271,7 +271,6 @@
|
|||||||
"topic_list": false,
|
"topic_list": false,
|
||||||
"transmit": false,
|
"transmit": false,
|
||||||
"typeahead_helper": false,
|
"typeahead_helper": false,
|
||||||
"typing": false,
|
|
||||||
"typing_data": false,
|
"typing_data": false,
|
||||||
"typing_events": false,
|
"typing_events": false,
|
||||||
"ui": false,
|
"ui": false,
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ zrequire("keydown_util");
|
|||||||
zrequire("stream_list");
|
zrequire("stream_list");
|
||||||
zrequire("topic_list");
|
zrequire("topic_list");
|
||||||
zrequire("sent_messages");
|
zrequire("sent_messages");
|
||||||
zrequire("typing");
|
|
||||||
zrequire("top_left_corner");
|
zrequire("top_left_corner");
|
||||||
zrequire("starred_messages");
|
zrequire("starred_messages");
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ import "../admin";
|
|||||||
import "../message_view_header";
|
import "../message_view_header";
|
||||||
import "../bot_data";
|
import "../bot_data";
|
||||||
import "../reactions";
|
import "../reactions";
|
||||||
import "../typing";
|
|
||||||
import "../typing_data";
|
import "../typing_data";
|
||||||
import "../typing_events";
|
import "../typing_events";
|
||||||
import "../ui_init";
|
import "../ui_init";
|
||||||
|
|||||||
1
static/js/global.d.ts
vendored
1
static/js/global.d.ts
vendored
@@ -137,7 +137,6 @@ declare let topic_list: any;
|
|||||||
declare let top_left_corner: any;
|
declare let top_left_corner: any;
|
||||||
declare let transmit: any;
|
declare let transmit: any;
|
||||||
declare let typeahead_helper: any;
|
declare let typeahead_helper: any;
|
||||||
declare let typing: any;
|
|
||||||
declare let typing_data: any;
|
declare let typing_data: any;
|
||||||
declare let typing_events: any;
|
declare let typing_events: any;
|
||||||
declare let ui: any;
|
declare let ui: any;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
"use strict";
|
import * as typing_status from "../shared/js/typing_status";
|
||||||
|
|
||||||
const typing_status = require("../shared/js/typing_status");
|
import * as people from "./people";
|
||||||
|
|
||||||
const people = require("./people");
|
|
||||||
|
|
||||||
// This module handles the outbound side of typing indicators.
|
// This module handles the outbound side of typing indicators.
|
||||||
// We detect changes in the compose box and notify the server
|
// 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");
|
send_typing_notification_ajax(user_ids_array, "stop");
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.get_recipient = get_user_ids_array;
|
export const get_recipient = get_user_ids_array;
|
||||||
exports.initialize = function () {
|
|
||||||
|
export function initialize() {
|
||||||
const worker = {
|
const worker = {
|
||||||
get_current_time,
|
get_current_time,
|
||||||
notify_server_start,
|
notify_server_start,
|
||||||
@@ -65,7 +64,7 @@ exports.initialize = function () {
|
|||||||
$(document).on("input", "#compose-textarea", () => {
|
$(document).on("input", "#compose-textarea", () => {
|
||||||
// If our previous state was no typing notification, send a
|
// If our previous state was no typing notification, send a
|
||||||
// start-typing notice immediately.
|
// 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);
|
typing_status.update(worker, new_recipient);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -74,6 +73,4 @@ exports.initialize = function () {
|
|||||||
$(document).on("compose_canceled.zulip compose_finished.zulip", () => {
|
$(document).on("compose_canceled.zulip compose_finished.zulip", () => {
|
||||||
typing_status.update(worker, null);
|
typing_status.update(worker, null);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
window.typing = exports;
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const people = require("./people");
|
|||||||
const pm_conversations = require("./pm_conversations");
|
const pm_conversations = require("./pm_conversations");
|
||||||
const topic_zoom = require("./topic_zoom");
|
const topic_zoom = require("./topic_zoom");
|
||||||
const tutorial = require("./tutorial");
|
const tutorial = require("./tutorial");
|
||||||
|
const typing = require("./typing");
|
||||||
const user_status = require("./user_status");
|
const user_status = require("./user_status");
|
||||||
const user_status_ui = require("./user_status_ui");
|
const user_status_ui = require("./user_status_ui");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user