2015-06-23 17:41:25 +02:00
|
|
|
/*
|
|
|
|
Copyright 2015 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2015-06-16 19:18:55 +02:00
|
|
|
function load(name) {
|
2015-06-23 19:28:20 +02:00
|
|
|
var module = require("../skins/base/views/"+name);
|
2015-06-17 17:43:29 +02:00
|
|
|
return module;
|
2015-06-16 19:18:55 +02:00
|
|
|
};
|
|
|
|
|
2015-07-06 15:13:02 +02:00
|
|
|
var ComponentBroker = function() {
|
|
|
|
this.components = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
ComponentBroker.prototype = {
|
2015-06-16 19:18:55 +02:00
|
|
|
get: function(name) {
|
2015-07-06 15:13:02 +02:00
|
|
|
if (this.components[name]) {
|
|
|
|
return this.components[name];
|
|
|
|
}
|
2015-06-16 19:18:55 +02:00
|
|
|
|
2015-07-06 15:13:02 +02:00
|
|
|
this.components[name] = load(name);
|
|
|
|
return this.components[name];
|
2015-06-16 19:18:55 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
set: function(name, module) {
|
2015-07-06 15:13:02 +02:00
|
|
|
this.components[name] = module;
|
2015-06-16 19:18:55 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-07-06 15:13:02 +02:00
|
|
|
// We define one Component Broker globally, because the intention is
|
|
|
|
// very much that it is a singleton. Relying on there only being one
|
|
|
|
// copy of the module can be dicey and not work as browserify's
|
|
|
|
// behaviour with multiple copies of files etc. is erratic at best.
|
|
|
|
// XXX: We can still end up with the same file twice in the resulting
|
|
|
|
// JS bundle which is nonideal.
|
|
|
|
if (global.componentBroker === undefined) {
|
|
|
|
global.componentBroker = new ComponentBroker();
|
|
|
|
}
|
|
|
|
module.exports = global.componentBroker;
|
|
|
|
|
|
|
|
// We need to tell browserify to include all the components
|
|
|
|
// by direct require syntax in here, but we don't want them
|
|
|
|
// to be evaluated in this file because then we wouldn't be
|
|
|
|
// able to override them. if (0) does this.
|
2015-06-17 17:43:29 +02:00
|
|
|
// Must be in this file (because the require is file-specific) and
|
|
|
|
// must be at the end because the components include this file.
|
2015-07-06 15:13:02 +02:00
|
|
|
if (0) {
|
2015-06-23 19:28:20 +02:00
|
|
|
require('../skins/base/views/atoms/LogoutButton');
|
2015-07-03 12:12:54 +02:00
|
|
|
require('../skins/base/views/atoms/EnableNotificationsButton');
|
2015-06-23 19:28:20 +02:00
|
|
|
require('../skins/base/views/atoms/MessageTimestamp');
|
2015-07-14 16:14:26 +02:00
|
|
|
require('../skins/base/views/atoms/create_room/CreateRoomButton');
|
2015-07-16 14:49:34 +02:00
|
|
|
require('../skins/base/views/atoms/create_room/RoomAlias');
|
2015-07-14 16:14:26 +02:00
|
|
|
require('../skins/base/views/atoms/create_room/Presets');
|
2015-07-15 14:52:27 +02:00
|
|
|
require('../skins/base/views/atoms/EditableText');
|
2015-06-23 19:28:20 +02:00
|
|
|
require('../skins/base/views/molecules/MatrixToolbar');
|
|
|
|
require('../skins/base/views/molecules/RoomTile');
|
|
|
|
require('../skins/base/views/molecules/MessageTile');
|
|
|
|
require('../skins/base/views/molecules/SenderProfile');
|
|
|
|
require('../skins/base/views/molecules/UnknownMessageTile');
|
|
|
|
require('../skins/base/views/molecules/MTextTile');
|
|
|
|
require('../skins/base/views/molecules/MNoticeTile');
|
|
|
|
require('../skins/base/views/molecules/MEmoteTile');
|
2015-07-06 19:09:19 +02:00
|
|
|
require('../skins/base/views/molecules/MImageTile');
|
2015-07-08 17:25:27 +02:00
|
|
|
require('../skins/base/views/molecules/MFileTile');
|
2015-07-06 19:09:19 +02:00
|
|
|
require('../skins/base/views/molecules/MRoomMemberTile');
|
2015-06-23 19:28:20 +02:00
|
|
|
require('../skins/base/views/molecules/RoomHeader');
|
|
|
|
require('../skins/base/views/molecules/MessageComposer');
|
|
|
|
require('../skins/base/views/molecules/ProgressBar');
|
|
|
|
require('../skins/base/views/molecules/ServerConfig');
|
|
|
|
require('../skins/base/views/organisms/MemberList');
|
|
|
|
require('../skins/base/views/molecules/MemberTile');
|
|
|
|
require('../skins/base/views/organisms/RoomList');
|
|
|
|
require('../skins/base/views/organisms/RoomView');
|
|
|
|
require('../skins/base/views/templates/Login');
|
2015-07-13 20:14:02 +02:00
|
|
|
require('../skins/base/views/templates/Register');
|
2015-07-03 12:12:54 +02:00
|
|
|
require('../skins/base/views/organisms/Notifier');
|
2015-07-14 16:14:26 +02:00
|
|
|
require('../skins/base/views/organisms/CreateRoom');
|
2015-07-14 17:53:49 +02:00
|
|
|
require('../skins/base/views/molecules/UserSelector');
|
2015-07-15 16:04:24 +02:00
|
|
|
require('../skins/base/views/organisms/UserSettings');
|
2015-07-16 10:37:58 +02:00
|
|
|
require('../skins/base/views/molecules/ChangeAvatar');
|
|
|
|
require('../skins/base/views/molecules/ChangePassword');
|
2015-07-13 02:51:24 +02:00
|
|
|
// new for vector
|
|
|
|
require('../skins/base/views/organisms/LeftPanel');
|
|
|
|
require('../skins/base/views/organisms/RightPanel');
|
|
|
|
require('../skins/base/views/molecules/RoomCreate');
|
|
|
|
require('../skins/base/views/molecules/RoomDropTarget');
|
|
|
|
require('../skins/base/views/molecules/DirectoryMenu');
|
2015-07-17 01:12:36 +02:00
|
|
|
require('../skins/base/views/molecules/DateSeparator');
|
2015-07-15 15:35:04 +02:00
|
|
|
require('../skins/base/views/atoms/voip/VideoFeed');
|
|
|
|
require('../skins/base/views/molecules/voip/VideoView');
|
2015-07-15 17:52:23 +02:00
|
|
|
require('../skins/base/views/molecules/voip/CallView');
|
2015-07-16 17:32:11 +02:00
|
|
|
require('../skins/base/views/molecules/voip/IncomingCallBox');
|
2015-07-16 14:30:14 +02:00
|
|
|
require('../skins/base/views/molecules/voip/MCallInviteTile');
|
|
|
|
require('../skins/base/views/molecules/voip/MCallAnswerTile');
|
|
|
|
require('../skins/base/views/molecules/voip/MCallHangupTile');
|
2015-07-17 19:48:53 +02:00
|
|
|
require('../skins/base/views/molecules/EventAsTextTile');
|
2015-07-15 15:35:04 +02:00
|
|
|
|
2015-07-13 02:51:24 +02:00
|
|
|
|
2015-07-06 15:13:02 +02:00
|
|
|
}
|