mirror of https://github.com/zulip/zulip.git
js: Convert static/js/fetch_status.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
0663b23d54
commit
8add2ffc4e
|
@ -126,7 +126,6 @@
|
|||
"files": ["static/js/**"],
|
||||
"globals": {
|
||||
"$": false,
|
||||
"FetchStatus": false,
|
||||
"Filter": false,
|
||||
"ListCursor": false,
|
||||
"MessageListData": false,
|
||||
|
|
|
@ -5,7 +5,7 @@ const {strict: assert} = require("assert");
|
|||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const FetchStatus = zrequire("fetch_status");
|
||||
const {FetchStatus} = zrequire("fetch_status");
|
||||
set_global("message_scroll", {
|
||||
hide_loading_older: () => {},
|
||||
show_loading_older: () => {},
|
||||
|
|
|
@ -19,7 +19,6 @@ function MessageListView() {
|
|||
}
|
||||
set_global("MessageListView", MessageListView);
|
||||
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
const Filter = zrequire("Filter", "js/filter");
|
||||
zrequire("MessageListData", "js/message_list_data");
|
||||
const message_list = zrequire("message_list");
|
||||
|
|
|
@ -25,7 +25,6 @@ set_global("document", {
|
|||
const narrow_state = set_global("narrow_state", {});
|
||||
const stream_data = set_global("stream_data", {});
|
||||
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
const muting = zrequire("muting");
|
||||
zrequire("MessageListData", "js/message_list_data");
|
||||
zrequire("MessageListView", "js/message_list_view");
|
||||
|
|
|
@ -9,7 +9,6 @@ const muting = zrequire("muting");
|
|||
zrequire("unread");
|
||||
|
||||
zrequire("Filter", "js/filter");
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
const MessageListData = zrequire("MessageListData", "js/message_list_data");
|
||||
|
||||
set_global("page_params", {});
|
||||
|
|
|
@ -10,7 +10,6 @@ const {run_test} = require("../zjsunit/test");
|
|||
set_global("document", "document-stub");
|
||||
|
||||
const Filter = zrequire("Filter", "js/filter");
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
zrequire("MessageListData", "js/message_list_data");
|
||||
const MessageListView = zrequire("MessageListView", "js/message_list_view");
|
||||
const message_list = zrequire("message_list");
|
||||
|
|
|
@ -13,7 +13,6 @@ set_global("resize", {
|
|||
});
|
||||
const stream_data = zrequire("stream_data");
|
||||
zrequire("Filter", "js/filter");
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
zrequire("MessageListData", "js/message_list_data");
|
||||
zrequire("unread");
|
||||
const narrow = zrequire("narrow");
|
||||
|
|
|
@ -6,7 +6,6 @@ const {set_global, zrequire} = require("../zjsunit/namespace");
|
|||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const Filter = zrequire("Filter", "js/filter");
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
const MessageListData = zrequire("MessageListData", "js/message_list_data");
|
||||
const narrow_state = zrequire("narrow_state");
|
||||
const narrow = zrequire("narrow");
|
||||
|
|
|
@ -19,7 +19,6 @@ const stream_topic_history = zrequire("stream_topic_history");
|
|||
const people = zrequire("people");
|
||||
const stream_color = zrequire("stream_color");
|
||||
const stream_data = zrequire("stream_data");
|
||||
zrequire("FetchStatus", "js/fetch_status");
|
||||
zrequire("Filter", "js/filter");
|
||||
zrequire("MessageListData", "js/message_list_data");
|
||||
zrequire("MessageListView", "js/message_list_view");
|
||||
|
|
|
@ -45,7 +45,6 @@ import "../filter";
|
|||
import "../poll_widget";
|
||||
import "../widgetize";
|
||||
import "../submessage";
|
||||
import "../fetch_status";
|
||||
import "../message_list_data";
|
||||
import "../message_list_view";
|
||||
import "../message_list";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
function max_id_for_messages(messages) {
|
||||
let max_id = 0;
|
||||
for (const msg of messages) {
|
||||
|
@ -8,7 +6,7 @@ function max_id_for_messages(messages) {
|
|||
return max_id;
|
||||
}
|
||||
|
||||
class FetchStatus {
|
||||
export class FetchStatus {
|
||||
// The FetchStatus object tracks tracks the state of a
|
||||
// message_list_data object, whether rendered in the DOM or not,
|
||||
// and is the source of truth for whether the message_list_data
|
||||
|
@ -134,5 +132,3 @@ class FetchStatus {
|
|||
);
|
||||
}
|
||||
}
|
||||
module.exports = FetchStatus;
|
||||
window.FetchStatus = FetchStatus;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// remove each declaration when the corresponding module is migrated
|
||||
// to TS.
|
||||
|
||||
declare let FetchStatus: any;
|
||||
declare let Filter: any;
|
||||
declare let ListCursor: any;
|
||||
declare let MessageListData: any;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {FetchStatus} = require("./fetch_status");
|
||||
const util = require("./util");
|
||||
|
||||
class MessageListData {
|
||||
|
|
Loading…
Reference in New Issue