js: Convert static/js/message_edit_history.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-10 07:56:33 -08:00 committed by Tim Abbott
parent 03f61c1eb2
commit fc57f087b7
7 changed files with 11 additions and 15 deletions

View File

@ -193,7 +193,6 @@
"location": false,
"markdown": false,
"message_edit": false,
"message_edit_history": false,
"message_events": false,
"message_fetch": false,
"message_flags": false,

View File

@ -72,7 +72,6 @@ import "../stream_events";
import "../stream_edit";
import "../subs";
import "../message_edit";
import "../message_edit_history";
import "../condense";
import "../resize";
import "../list_widget";

View File

@ -8,6 +8,7 @@ const WinChan = require("winchan");
const render_buddy_list_tooltip = require("../templates/buddy_list_tooltip.hbs");
const render_buddy_list_tooltip_content = require("../templates/buddy_list_tooltip_content.hbs");
const message_edit_history = require("./message_edit_history");
const settings_panel_menu = require("./settings_panel_menu");
const util = require("./util");

View File

@ -62,7 +62,6 @@ declare let local_message: any;
declare let localstorage: any;
declare let markdown: any;
declare let message_edit: any;
declare let message_edit_history: any;
declare let message_events: any;
declare let message_fetch: any;
declare let message_flags: any;

View File

@ -1,12 +1,10 @@
"use strict";
import render_message_edit_history from "../templates/message_edit_history.hbs";
import * as people from "./people";
const {format, isSameDay} = require("date-fns");
const render_message_edit_history = require("../templates/message_edit_history.hbs");
const people = require("./people");
exports.fetch_and_render_message_history = function (message) {
export function fetch_and_render_message_history(message) {
channel.get({
url: "/json/messages/" + message.id + "/history",
data: {message_id: JSON.stringify(message.id)},
@ -67,12 +65,10 @@ exports.fetch_and_render_message_history = function (message) {
);
},
});
};
}
exports.show_history = function (message) {
export function show_history(message) {
$("#message-history").html("");
$("#message-edit-history").modal("show");
exports.fetch_and_render_message_history(message);
};
window.message_edit_history = exports;
fetch_and_render_message_history(message);
}

View File

@ -1,6 +1,7 @@
"use strict";
const huddle_data = require("./huddle_data");
const message_edit_history = require("./message_edit_history");
const util = require("./util");
function maybe_add_narrowed_messages(messages, msg_list) {

View File

@ -17,6 +17,7 @@ const render_user_info_popover_title = require("../templates/user_info_popover_t
const render_user_profile_modal = require("../templates/user_profile_modal.hbs");
const feature_flags = require("./feature_flags");
const message_edit_history = require("./message_edit_history");
const people = require("./people");
const settings_config = require("./settings_config");
const settings_data = require("./settings_data");