diff --git a/src/ComponentBroker.js b/src/ComponentBroker.js index f3670bf6..1d524267 100644 --- a/src/ComponentBroker.js +++ b/src/ComponentBroker.js @@ -1,7 +1,7 @@ var components = {}; function load(name) { - var module = require("./"+name); + var module = require("./views/"+name); components[name] = module; return module; }; @@ -23,17 +23,19 @@ module.exports = { // otherwise browserify has no way of knowing what module to include // Must be in this file (because the require is file-specific) and // must be at the end because the components include this file. -require('./atoms/LogoutButton'); -require('./atoms/MessageTimestamp'); -require('./molecules/MatrixToolbar'); -require('./molecules/RoomTile'); -require('./molecules/MessageTile'); -require('./molecules/SenderProfile'); -require('./molecules/UnknownMessageTile'); -require('./molecules/MTextTile'); -require('./molecules/MEmoteTile'); -require('./molecules/RoomHeader'); -require('./molecules/MessageComposer'); -require('./organisms/RoomList'); -require('./organisms/RoomView'); -require('./templates/Login'); +require('./views/atoms/LogoutButton'); +require('./views/atoms/MessageTimestamp'); +require('./views/molecules/MatrixToolbar'); +require('./views/molecules/RoomTile'); +require('./views/molecules/MessageTile'); +require('./views/molecules/SenderProfile'); +require('./views/molecules/UnknownMessageTile'); +require('./views/molecules/MTextTile'); +require('./views/molecules/MEmoteTile'); +require('./views/molecules/RoomHeader'); +require('./views/molecules/MessageComposer'); +require('./views/molecules/ProgressBar'); +require('./views/molecules/ServerConfig'); +require('./views/organisms/RoomList'); +require('./views/organisms/RoomView'); +require('./views/templates/Login'); diff --git a/src/controllers/atoms/LogoutButton.js b/src/controllers/atoms/LogoutButton.js new file mode 100644 index 00000000..cac1776a --- /dev/null +++ b/src/controllers/atoms/LogoutButton.js @@ -0,0 +1,9 @@ +var dis = require("../../dispatcher"); + +module.exports = { + onClick: function() { + dis.dispatch({ + action: 'logout' + }); + }, +}; diff --git a/src/controllers/atoms/MessageTimestamp.js b/src/controllers/atoms/MessageTimestamp.js new file mode 100644 index 00000000..dd4f002d --- /dev/null +++ b/src/controllers/atoms/MessageTimestamp.js @@ -0,0 +1,3 @@ +module.exports = { +}; + diff --git a/src/controllers/molecules/MEmoteTile.js b/src/controllers/molecules/MEmoteTile.js new file mode 100644 index 00000000..dd4f002d --- /dev/null +++ b/src/controllers/molecules/MEmoteTile.js @@ -0,0 +1,3 @@ +module.exports = { +}; + diff --git a/src/controllers/molecules/MTextTile.js b/src/controllers/molecules/MTextTile.js new file mode 100644 index 00000000..dd4f002d --- /dev/null +++ b/src/controllers/molecules/MTextTile.js @@ -0,0 +1,3 @@ +module.exports = { +}; + diff --git a/src/controllers/molecules/MatrixToolbar.js b/src/controllers/molecules/MatrixToolbar.js new file mode 100644 index 00000000..dd4f002d --- /dev/null +++ b/src/controllers/molecules/MatrixToolbar.js @@ -0,0 +1,3 @@ +module.exports = { +}; + diff --git a/src/molecules/MessageComposer.js b/src/controllers/molecules/MessageComposer.js similarity index 75% rename from src/molecules/MessageComposer.js rename to src/controllers/molecules/MessageComposer.js index 56fcdb18..61c4f309 100644 --- a/src/molecules/MessageComposer.js +++ b/src/controllers/molecules/MessageComposer.js @@ -1,10 +1,8 @@ -var React = require('react'); +var MatrixClientPeg = require("../../MatrixClientPeg"); -var MatrixClientPeg = require("../MatrixClientPeg"); +var dis = require("../../dispatcher"); -var dis = require("../dispatcher"); - -module.exports = React.createClass({ +module.exports = { componentDidMount: function() { this.dispatcherRef = dis.register(this.onAction); }, @@ -43,13 +41,5 @@ module.exports = React.createClass({ ev.preventDefault(); } }, - - render: function() { - return ( -
-