mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
js: Convert static/js/topic_zoom.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
07e6de1cd9
commit
a1dc8e37a2
@@ -282,7 +282,6 @@
|
|||||||
"todo_widget": false,
|
"todo_widget": false,
|
||||||
"top_left_corner": false,
|
"top_left_corner": false,
|
||||||
"topic_list": false,
|
"topic_list": false,
|
||||||
"topic_zoom": false,
|
|
||||||
"transmit": false,
|
"transmit": false,
|
||||||
"tutorial": false,
|
"tutorial": false,
|
||||||
"typeahead_helper": false,
|
"typeahead_helper": false,
|
||||||
|
|||||||
@@ -735,8 +735,6 @@ function make_sidebar_helper() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
zrequire("topic_zoom");
|
|
||||||
|
|
||||||
run_test("stream_list", () => {
|
run_test("stream_list", () => {
|
||||||
const jquery_helper = make_jquery_helper();
|
const jquery_helper = make_jquery_helper();
|
||||||
const sidebar_helper = make_sidebar_helper();
|
const sidebar_helper = make_sidebar_helper();
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ const stream_data = zrequire("stream_data");
|
|||||||
const scroll_util = zrequire("scroll_util");
|
const scroll_util = zrequire("scroll_util");
|
||||||
zrequire("list_cursor");
|
zrequire("list_cursor");
|
||||||
const stream_list = zrequire("stream_list");
|
const stream_list = zrequire("stream_list");
|
||||||
zrequire("topic_zoom");
|
|
||||||
zrequire("ui");
|
zrequire("ui");
|
||||||
set_global("page_params", {
|
set_global("page_params", {
|
||||||
is_admin: false,
|
is_admin: false,
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ zrequire("list_cursor");
|
|||||||
zrequire("keydown_util");
|
zrequire("keydown_util");
|
||||||
zrequire("stream_list");
|
zrequire("stream_list");
|
||||||
zrequire("topic_list");
|
zrequire("topic_list");
|
||||||
zrequire("topic_zoom");
|
|
||||||
zrequire("sent_messages");
|
zrequire("sent_messages");
|
||||||
zrequire("typing");
|
zrequire("typing");
|
||||||
zrequire("top_left_corner");
|
zrequire("top_left_corner");
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import "../pm_list";
|
|||||||
import "../recent_senders";
|
import "../recent_senders";
|
||||||
import "../top_left_corner";
|
import "../top_left_corner";
|
||||||
import "../stream_list";
|
import "../stream_list";
|
||||||
import "../topic_zoom";
|
|
||||||
import "../filter";
|
import "../filter";
|
||||||
import "../poll_widget";
|
import "../poll_widget";
|
||||||
import "../todo_widget";
|
import "../todo_widget";
|
||||||
|
|||||||
1
static/js/global.d.ts
vendored
1
static/js/global.d.ts
vendored
@@ -147,7 +147,6 @@ declare let timerender: any;
|
|||||||
declare let todo_widget: any;
|
declare let todo_widget: any;
|
||||||
declare let stream_topic_history: any;
|
declare let stream_topic_history: any;
|
||||||
declare let topic_list: any;
|
declare let topic_list: any;
|
||||||
declare let topic_zoom: any;
|
|
||||||
declare let top_left_corner: any;
|
declare let top_left_corner: any;
|
||||||
declare let transmit: any;
|
declare let transmit: any;
|
||||||
declare let tutorial: any;
|
declare let tutorial: any;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
const emoji = require("../shared/js/emoji");
|
const emoji = require("../shared/js/emoji");
|
||||||
|
|
||||||
const feedback_widget = require("./feedback_widget");
|
const feedback_widget = require("./feedback_widget");
|
||||||
|
const topic_zoom = require("./topic_zoom");
|
||||||
|
|
||||||
function do_narrow_action(action) {
|
function do_narrow_action(action) {
|
||||||
action(current_msg_list.selected_id(), {trigger: "hotkey"});
|
action(current_msg_list.selected_id(), {trigger: "hotkey"});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const render_stream_privacy = require("../templates/stream_privacy.hbs");
|
|||||||
const render_stream_sidebar_row = require("../templates/stream_sidebar_row.hbs");
|
const render_stream_sidebar_row = require("../templates/stream_sidebar_row.hbs");
|
||||||
|
|
||||||
const stream_sort = require("./stream_sort");
|
const stream_sort = require("./stream_sort");
|
||||||
|
const topic_zoom = require("./topic_zoom");
|
||||||
|
|
||||||
let has_scrolled = false;
|
let has_scrolled = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
let zoomed_in = false;
|
let zoomed_in = false;
|
||||||
|
|
||||||
exports.is_zoomed_in = function () {
|
export function is_zoomed_in() {
|
||||||
return zoomed_in;
|
return zoomed_in;
|
||||||
};
|
}
|
||||||
|
|
||||||
function zoom_in() {
|
function zoom_in() {
|
||||||
const stream_id = topic_list.active_stream_id();
|
const stream_id = topic_list.active_stream_id();
|
||||||
@@ -18,7 +16,7 @@ function zoom_in() {
|
|||||||
zoomed_in = true;
|
zoomed_in = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.zoom_out = function () {
|
export function zoom_out() {
|
||||||
const stream_li = topic_list.get_stream_li();
|
const stream_li = topic_list.get_stream_li();
|
||||||
|
|
||||||
popovers.hide_all_except_sidebars();
|
popovers.hide_all_except_sidebars();
|
||||||
@@ -30,9 +28,9 @@ exports.zoom_out = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
zoomed_in = false;
|
zoomed_in = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.clear_topics = function () {
|
export function clear_topics() {
|
||||||
const stream_li = topic_list.get_stream_li();
|
const stream_li = topic_list.get_stream_li();
|
||||||
|
|
||||||
topic_list.close();
|
topic_list.close();
|
||||||
@@ -46,9 +44,9 @@ exports.clear_topics = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
zoomed_in = false;
|
zoomed_in = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.initialize = function () {
|
export function initialize() {
|
||||||
$("#stream_filters").on("click", ".show-more-topics", (e) => {
|
$("#stream_filters").on("click", ".show-more-topics", (e) => {
|
||||||
zoom_in();
|
zoom_in();
|
||||||
|
|
||||||
@@ -57,11 +55,9 @@ exports.initialize = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".show-all-streams").on("click", (e) => {
|
$(".show-all-streams").on("click", (e) => {
|
||||||
exports.zoom_out();
|
zoom_out();
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
window.topic_zoom = exports;
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const emojisets = require("./emojisets");
|
|||||||
const markdown_config = require("./markdown_config");
|
const markdown_config = require("./markdown_config");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
const pm_conversations = require("./pm_conversations");
|
const pm_conversations = require("./pm_conversations");
|
||||||
|
const topic_zoom = require("./topic_zoom");
|
||||||
|
|
||||||
// This is where most of our initialization takes place.
|
// This is where most of our initialization takes place.
|
||||||
// TODO: Organize it a lot better. In particular, move bigger
|
// TODO: Organize it a lot better. In particular, move bigger
|
||||||
|
|||||||
Reference in New Issue
Block a user