Migrate JS modules to CommonJS style.

Closes #1488.
This commit is contained in:
Rafid Aslam 2016-12-04 14:59:56 +07:00 committed by Tim Abbott
parent 4bb6735e77
commit 7856217a63
30 changed files with 122 additions and 0 deletions

View File

@ -884,3 +884,7 @@ exports.setup_page = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = admin;
}

View File

@ -79,3 +79,7 @@ exports.set_up_alert_words = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = alert_words_ui;
}

View File

@ -213,3 +213,7 @@ exports.build_direct_upload_widget = function (
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = avatar;
}

View File

@ -125,3 +125,7 @@ exports.xhr_error_message = function (message, xhr) {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = channel;
}

View File

@ -456,3 +456,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = click_handlers;
}

View File

@ -55,3 +55,7 @@ exports.getHexColor = function (rgb) {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = colorspace;
}

View File

@ -45,3 +45,9 @@ function password_quality(password, bar) {
return acceptable;
}
if (typeof module !== 'undefined') {
module.exports.status_classes = status_classes;
module.exports.autofocus = autofocus;
module.exports.password_quality = password_quality;
}

View File

@ -79,3 +79,7 @@ exports.toggle = (function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = components;
}

View File

@ -250,3 +250,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = compose_fade;
}

View File

@ -167,3 +167,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = condense;
}

View File

@ -147,3 +147,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = copy_and_paste;
}

View File

@ -30,3 +30,7 @@ exports.dropbox_integration = false;
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = feature_flags;
}

View File

@ -98,3 +98,7 @@ exports.update = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = floating_recipient_bar;
}

View File

@ -71,3 +71,7 @@ exports.initialize = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = gear_menu;
}

View File

@ -402,3 +402,7 @@ $(document).keypress(function (e) {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = hotkeys;
}

View File

@ -118,3 +118,7 @@ exports.initialize = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = invite;
}

View File

@ -19,3 +19,7 @@ exports.supported = function supports_localstorage() {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = localstorage;
}

View File

@ -108,3 +108,7 @@ exports.send_force_collapse = function send_force_collapse(messages, value) {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = message_flags;
}

View File

@ -121,3 +121,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = muting_ui;
}

View File

@ -123,3 +123,7 @@ exports.maybe_scroll_to_selected = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = navigate;
}

View File

@ -623,3 +623,7 @@ exports.handle_global_notification_updates = function (notification_name, settin
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = notifications;
}

View File

@ -116,3 +116,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = referral;
}

View File

@ -280,3 +280,7 @@ window.addEventListener('beforeunload', function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = reload;
}

View File

@ -259,3 +259,7 @@ exports.handler = function (e) {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = resize;
}

View File

@ -101,3 +101,7 @@ exports.id_for_recipient_row = function (recipient_row) {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = rows;
}

View File

@ -761,3 +761,7 @@ exports.setup_page = function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = settings;
}

View File

@ -409,3 +409,7 @@ Socket.prototype = {
return Socket;
}());
if (typeof module !== 'undefined') {
module.exports = Socket;
}

View File

@ -163,3 +163,7 @@ $(function () {
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = tab_bar;
}

View File

@ -158,3 +158,7 @@ exports.set_full_datetime = function timerender_set_full_datetime(message, time_
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = timerender;
}

View File

@ -6,3 +6,7 @@ var home_msg_list = new message_list.MessageList('zhome',
new Filter([{operator: "in", operand: "home"}]), {muting_enabled: true}
);
var current_msg_list = home_msg_list;
if (typeof module !== 'undefined') {
module.exports.current_msg_list = current_msg_list;
}