app: Prepare JS files for consumption by webpack.

This commit prepares the frontend code to be consumed by webpack.

It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.

However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.

So we expose the modules by setting window.varName = varName; as
needed in the js files.
This commit is contained in:
Armaan Ahluwalia 2018-05-28 11:34:36 +05:30 committed by Tim Abbott
parent b10822efcf
commit 6d255efe4c
163 changed files with 180 additions and 1 deletions

View File

@ -496,3 +496,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = activity;
}
window.activity = activity;

View File

@ -130,3 +130,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = admin;
}
window.admin = admin;

View File

@ -99,3 +99,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = admin_sections;
}
window.admin_sections = admin_sections;

View File

@ -62,3 +62,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = alert_words;
}
window.alert_words = alert_words;

View File

@ -109,3 +109,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = alert_words_ui;
}
window.alert_words_ui = alert_words_ui;

View File

@ -138,3 +138,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = attachments_ui;
}
window.attachments_ui = attachments_ui;

View File

@ -88,3 +88,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = avatar;
}
window.avatar = avatar;

View File

@ -455,3 +455,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = blueslip;
}
window.blueslip = blueslip;

View File

@ -93,3 +93,4 @@ var bot_data = (function () {
if (typeof module !== 'undefined') {
module.exports = bot_data;
}
window.bot_data = bot_data;

View File

@ -185,3 +185,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = buddy_data;
}
window.buddy_data = buddy_data;

View File

@ -120,3 +120,4 @@ if (typeof module !== 'undefined') {
module.exports = buddy_list;
}
window.buddy_list = buddy_list;

View File

@ -119,3 +119,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = channel;
}
window.channel = channel;

View File

@ -741,3 +741,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = click_handlers;
}
window.click_handlers = click_handlers;

View File

@ -59,3 +59,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = colorspace;
}
window.colorspace = colorspace;

View File

@ -95,3 +95,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = common;
}
window.common = common;

View File

@ -131,3 +131,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = components;
}
window.components = components;

View File

@ -987,3 +987,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = compose;
}
window.compose = compose;

View File

@ -444,3 +444,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = compose_actions;
}
window.compose_actions = compose_actions;

View File

@ -261,3 +261,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = compose_fade;
}
window.compose_fade = compose_fade;

View File

@ -60,3 +60,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = compose_pm_pill;
}
window.compose_pm_pill = compose_pm_pill;

View File

@ -63,3 +63,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = compose_state;
}
window.compose_state = compose_state;

View File

@ -55,3 +55,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = compose_ui;
}
window.compose_ui = compose_ui;

View File

@ -673,3 +673,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = composebox_typeahead;
}
window.composebox_typeahead = composebox_typeahead;

View File

@ -216,3 +216,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = condense;
}
window.condense = condense;

View File

@ -238,3 +238,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = copy_and_paste;
}
window.copy_and_paste = copy_and_paste;

View File

@ -141,3 +141,4 @@ Dict.prototype = {
if (typeof module !== 'undefined') {
module.exports = Dict;
}
window.Dict = Dict;

View File

@ -452,3 +452,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = drafts;
}
window.drafts = drafts;

View File

@ -274,3 +274,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = echo;
}
window.echo = echo;

View File

@ -164,3 +164,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = emoji;
}
window.emoji = emoji;

View File

@ -736,3 +736,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = emoji_picker;
}
window.emoji_picker = emoji_picker;

View File

@ -33,3 +33,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = favicon;
}
window.favicon = favicon;

View File

@ -22,3 +22,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = feature_flags;
}
window.feature_flags = feature_flags;

View File

@ -195,3 +195,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = fenced_code;
}
window.fenced_code = fenced_code;

View File

@ -55,3 +55,4 @@ var FetchStatus = function () {
if (typeof module !== 'undefined') {
module.exports = FetchStatus;
}
window.FetchStatus = FetchStatus;

View File

@ -652,3 +652,5 @@ return Filter;
if (typeof module !== 'undefined') {
module.exports = Filter;
}
window.Filter = Filter;

View File

@ -111,3 +111,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = floating_recipient_bar;
}
window.floating_recipient_bar = floating_recipient_bar;

View File

@ -67,3 +67,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = gear_menu;
}
window.gear_menu = gear_menu;

View File

@ -61,3 +61,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = hash_util;
}
window.hash_util = hash_util;

View File

@ -324,3 +324,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = hashchange;
}
window.hashchange = hashchange;

View File

@ -789,3 +789,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = hotkeys;
}
window.hotkey = hotkeys;

View File

@ -244,3 +244,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = hotspots;
}
window.hotspots = hotspots;

View File

@ -108,3 +108,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = info_overlay;
}
window.info_overlay = info_overlay;

View File

@ -429,3 +429,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = input_pill;
}
window.input_pill = input_pill;

View File

@ -81,3 +81,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = integration_bot_widget;
}
window.integration_bot_widget = integration_bot_widget;

View File

@ -157,3 +157,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = invite;
}
window.invite = invite;

View File

@ -43,3 +43,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = keydown_util;
}
window.keydown_util = keydown_util;

View File

@ -300,3 +300,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = lightbox;
}
window.lightbox = lightbox;

View File

@ -333,3 +333,4 @@ var LightboxCanvas = (function () {
if (typeof module !== 'undefined') {
module.exports = LightboxCanvas;
}
window.lightbox_canvas = LightboxCanvas;

View File

@ -138,3 +138,4 @@ var list_cursor = function (opts) {
if (typeof module !== 'undefined') {
module.exports = list_cursor;
}
window.list_cursor = list_cursor;

View File

@ -392,3 +392,5 @@ var list_render = (function () {
if (typeof module !== 'undefined') {
module.exports = list_render;
}
window.list_render = list_render;

View File

@ -27,3 +27,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = list_util;
}
window.list_util = list_util;

View File

@ -72,3 +72,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = loading;
}
window.loading = loading;

View File

@ -63,3 +63,5 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = local_message;
}
window.local_message = local_message;

View File

@ -182,3 +182,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = localstorage;
}
window.localstorage = localstorage;

View File

@ -432,3 +432,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = markdown;
}
window.markdown = markdown;

View File

@ -594,3 +594,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_edit;
}
window.message_edit = message_edit;

View File

@ -291,3 +291,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_events;
}
window.message_events = message_events;

View File

@ -348,3 +348,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_fetch;
}
window.message_fetch = message_fetch;

View File

@ -104,3 +104,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_flags;
}
window.message_flags = message_flags;

View File

@ -438,3 +438,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_list;
}
window.message_list = message_list;

View File

@ -571,3 +571,5 @@ MessageListData.prototype = {
if (typeof module !== 'undefined') {
module.exports = MessageListData;
}
window.MessageListData = MessageListData;

View File

@ -1035,3 +1035,4 @@ MessageListView.prototype = {
if (typeof module !== 'undefined') {
module.exports = MessageListView;
}
window.MessageListView = MessageListView;

View File

@ -39,3 +39,4 @@ if (typeof module !== 'undefined') {
module.exports = message_live_update;
}
window.message_live_update = message_live_update;

View File

@ -86,3 +86,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_scroll;
}
window.message_scroll = message_scroll;

View File

@ -192,3 +192,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_store;
}
window.message_store = message_store;

View File

@ -28,3 +28,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_util;
}
window.message_util = message_util;

View File

@ -413,3 +413,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = message_viewport;
}
window.message_viewport = message_viewport;

View File

@ -54,3 +54,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = muting;
}
window.muting = muting;

View File

@ -194,3 +194,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = muting_ui;
}
window.muting_ui = muting_ui;

View File

@ -820,3 +820,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = narrow;
}
window.narrow = narrow;

View File

@ -361,3 +361,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = narrow_state;
}
window.narrow_state = narrow_state;

View File

@ -146,3 +146,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = navigate;
}
window.navigate = navigate;

View File

@ -98,3 +98,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = night_mode;
}
window.night_mode = night_mode;

View File

@ -642,3 +642,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = notifications;
}
window.notifications = notifications;

View File

@ -218,3 +218,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = overlays;
}
window.overlays = overlays;

View File

@ -95,3 +95,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = panels;
}
window.panels = panels;

View File

@ -931,3 +931,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = people;
}
window.people = people;

View File

@ -66,3 +66,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = pm_conversations;
}
window.pm_conversations = pm_conversations;

View File

@ -218,3 +218,4 @@ if (typeof module !== 'undefined') {
module.exports = pm_list;
}
window.pm_list = pm_list;

View File

@ -122,3 +122,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = pointer;
}
window.pointer = pointer;

View File

@ -1003,3 +1003,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = popovers;
}
window.popovers = popovers;

View File

@ -179,3 +179,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = presence;
}
window.presence = presence;

View File

@ -434,3 +434,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = reactions;
}
window.reactions = reactions;

View File

@ -49,3 +49,4 @@ var realm_icon = (function () {
if (typeof module !== 'undefined') {
module.exports = realm_icon;
}
window.realm_icon = realm_icon;

View File

@ -70,3 +70,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = recent_senders;
}
window.recent_senders = recent_senders;

View File

@ -325,3 +325,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = reload;
}
window.reload = reload;

View File

@ -162,3 +162,5 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = reminder;
}
window.reminder = reminder;

View File

@ -297,3 +297,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = resize;
}
window.resize = resize;

View File

@ -114,3 +114,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = rows;
}
window.rows = rows;

View File

@ -117,3 +117,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = rtl;
}
window.rtl = rtl;

View File

@ -63,3 +63,5 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = schema;
}
window.schema = schema;

View File

@ -66,3 +66,5 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = scroll_bar;
}
window.scroll_bar = scroll_bar;

View File

@ -57,3 +57,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = scroll_util;
}
window.scroll_util = scroll_util;

View File

@ -169,3 +169,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = search;
}
window.search = search;

View File

@ -42,3 +42,5 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = search_pill;
}
window.search_pill = search_pill;

View File

@ -658,3 +658,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = search_suggestion;
}
window.search_suggestion = search_suggestion;

View File

@ -182,3 +182,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = sent_messages;
}
window.sent_messages = sent_messages;

View File

@ -296,3 +296,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = server_events;
}
window.server_events = server_events;

View File

@ -444,3 +444,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = server_events_dispatch;
}
window.server_events_dispatch = server_events_dispatch;

View File

@ -175,3 +175,4 @@ return exports;
if (typeof module !== 'undefined') {
module.exports = settings;
}
window.settings = settings;

Some files were not shown because too many files have changed in this diff Show More