diff --git a/package.json b/package.json index b8ab62fc..83e4cc91 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,12 @@ "url": "https://github.com/matrix-org/matrix-react-sdk" }, "license": "Apache 2", - "main": "build/index.js", + "main": "src/index.js", "scripts": { - "build:js": "jsx src/ build", - "start:js": "jsx -w src/ build --source-map-inline", - "build:css": "catw 'css/**/*.css' -o bundle.css -c uglifycss --no-watch", - "start:css": "catw 'css/**/*.css' -o bundle.css -v", + "build:js": "jsx themes/base/views/ build", + "start:js": "jsx -w themes/base/views/ build --source-map-inline", + "build:css": "catw 'themes/base/css/**/*.css' -o bundle.css -c uglifycss --no-watch", + "start:css": "catw 'themes/base/css/**/*.css' -o bundle.css -v", "build": "npm run build:js && npm run build:css", "start": "parallelshell 'npm run start:js' 'npm run start:css'" }, diff --git a/src/ComponentBroker.js b/src/ComponentBroker.js index 260461a0..ffb9db12 100644 --- a/src/ComponentBroker.js +++ b/src/ComponentBroker.js @@ -1,7 +1,7 @@ var components = {}; function load(name) { - var module = require("./views/"+name); + var module = require("../themes/base/views/"+name); components[name] = module; return module; }; @@ -23,22 +23,22 @@ 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('./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/MNoticeTile'); -require('./views/molecules/MEmoteTile'); -require('./views/molecules/RoomHeader'); -require('./views/molecules/MessageComposer'); -require('./views/molecules/ProgressBar'); -require('./views/molecules/ServerConfig'); -require('./views/organisms/MemberList'); -require('./views/molecules/MemberTile'); -require('./views/organisms/RoomList'); -require('./views/organisms/RoomView'); -require('./views/templates/Login'); +require('../themes/base/views/atoms/LogoutButton'); +require('../themes/base/views/atoms/MessageTimestamp'); +require('../themes/base/views/molecules/MatrixToolbar'); +require('../themes/base/views/molecules/RoomTile'); +require('../themes/base/views/molecules/MessageTile'); +require('../themes/base/views/molecules/SenderProfile'); +require('../themes/base/views/molecules/UnknownMessageTile'); +require('../themes/base/views/molecules/MTextTile'); +require('../themes/base/views/molecules/MNoticeTile'); +require('../themes/base/views/molecules/MEmoteTile'); +require('../themes/base/views/molecules/RoomHeader'); +require('../themes/base/views/molecules/MessageComposer'); +require('../themes/base/views/molecules/ProgressBar'); +require('../themes/base/views/molecules/ServerConfig'); +require('../themes/base/views/organisms/MemberList'); +require('../themes/base/views/molecules/MemberTile'); +require('../themes/base/views/organisms/RoomList'); +require('../themes/base/views/organisms/RoomView'); +require('../themes/base/views/templates/Login'); diff --git a/src/controllers/molecules/ProgressBar.js b/src/controllers/molecules/ProgressBar.js index 847e970d..b35aae89 100644 --- a/src/controllers/molecules/ProgressBar.js +++ b/src/controllers/molecules/ProgressBar.js @@ -1,3 +1,5 @@ +var React = require('react'); + module.exports = { propTypes: { value: React.PropTypes.number, diff --git a/src/index.js b/src/index.js index b6d30275..56068dee 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1 @@ -module.exports.MatrixChat = require("./views/pages/MatrixChat"); +module.exports.MatrixChat = require("../themes/base/views/pages/MatrixChat"); diff --git a/css/atoms/MessageTimestamp.css b/themes/base/css/atoms/MessageTimestamp.css similarity index 100% rename from css/atoms/MessageTimestamp.css rename to themes/base/css/atoms/MessageTimestamp.css diff --git a/css/common.css b/themes/base/css/common.css similarity index 100% rename from css/common.css rename to themes/base/css/common.css diff --git a/css/molecules/MNoticeTile.css b/themes/base/css/molecules/MNoticeTile.css similarity index 100% rename from css/molecules/MNoticeTile.css rename to themes/base/css/molecules/MNoticeTile.css diff --git a/css/molecules/MessageComposer.css b/themes/base/css/molecules/MessageComposer.css similarity index 100% rename from css/molecules/MessageComposer.css rename to themes/base/css/molecules/MessageComposer.css diff --git a/css/molecules/MessageTile.css b/themes/base/css/molecules/MessageTile.css similarity index 100% rename from css/molecules/MessageTile.css rename to themes/base/css/molecules/MessageTile.css diff --git a/css/molecules/ProgressBar.css b/themes/base/css/molecules/ProgressBar.css similarity index 100% rename from css/molecules/ProgressBar.css rename to themes/base/css/molecules/ProgressBar.css diff --git a/css/molecules/RoomHeader.css b/themes/base/css/molecules/RoomHeader.css similarity index 100% rename from css/molecules/RoomHeader.css rename to themes/base/css/molecules/RoomHeader.css diff --git a/css/molecules/RoomTile.css b/themes/base/css/molecules/RoomTile.css similarity index 100% rename from css/molecules/RoomTile.css rename to themes/base/css/molecules/RoomTile.css diff --git a/css/molecules/SenderProfile.css b/themes/base/css/molecules/SenderProfile.css similarity index 100% rename from css/molecules/SenderProfile.css rename to themes/base/css/molecules/SenderProfile.css diff --git a/css/organisms/RoomList.css b/themes/base/css/organisms/RoomList.css similarity index 100% rename from css/organisms/RoomList.css rename to themes/base/css/organisms/RoomList.css diff --git a/css/organisms/RoomView.css b/themes/base/css/organisms/RoomView.css similarity index 100% rename from css/organisms/RoomView.css rename to themes/base/css/organisms/RoomView.css diff --git a/css/pages/MatrixChat.css b/themes/base/css/pages/MatrixChat.css similarity index 100% rename from css/pages/MatrixChat.css rename to themes/base/css/pages/MatrixChat.css diff --git a/css/templates/Login.css b/themes/base/css/templates/Login.css similarity index 100% rename from css/templates/Login.css rename to themes/base/css/templates/Login.css diff --git a/src/views/atoms/LogoutButton.js b/themes/base/views/atoms/LogoutButton.js similarity index 76% rename from src/views/atoms/LogoutButton.js rename to themes/base/views/atoms/LogoutButton.js index 2bb7b3cb..43910ad5 100644 --- a/src/views/atoms/LogoutButton.js +++ b/themes/base/views/atoms/LogoutButton.js @@ -1,6 +1,6 @@ var React = require('react'); -var LogoutButtonController = require("../../controllers/atoms/LogoutButton"); +var LogoutButtonController = require("../../../../src/controllers/atoms/LogoutButton"); module.exports = React.createClass({ displayName: 'LogoutButton', diff --git a/src/views/atoms/MessageTimestamp.js b/themes/base/views/atoms/MessageTimestamp.js similarity index 79% rename from src/views/atoms/MessageTimestamp.js rename to themes/base/views/atoms/MessageTimestamp.js index 8e3318f2..2e8e88a0 100644 --- a/src/views/atoms/MessageTimestamp.js +++ b/themes/base/views/atoms/MessageTimestamp.js @@ -1,6 +1,6 @@ var React = require('react'); -var MessageTimestampController = require("../../controllers/atoms/MessageTimestamp"); +var MessageTimestampController = require("../../../../src/controllers/atoms/MessageTimestamp"); module.exports = React.createClass({ displayName: 'MessageTimestamp', diff --git a/src/views/molecules/MEmoteTile.js b/themes/base/views/molecules/MEmoteTile.js similarity index 84% rename from src/views/molecules/MEmoteTile.js rename to themes/base/views/molecules/MEmoteTile.js index dc12ce55..8090e4dc 100644 --- a/src/views/molecules/MEmoteTile.js +++ b/themes/base/views/molecules/MEmoteTile.js @@ -1,6 +1,6 @@ var React = require('react'); -var MEmoteTileController = require("../../controllers/molecules/MEmoteTile"); +var MEmoteTileController = require("../../../../src/controllers/molecules/MEmoteTile"); module.exports = React.createClass({ displayName: 'MEmoteTile', diff --git a/src/views/molecules/MNoticeTile.js b/themes/base/views/molecules/MNoticeTile.js similarity index 79% rename from src/views/molecules/MNoticeTile.js rename to themes/base/views/molecules/MNoticeTile.js index 21c7404a..ead7c15b 100644 --- a/src/views/molecules/MNoticeTile.js +++ b/themes/base/views/molecules/MNoticeTile.js @@ -1,6 +1,6 @@ var React = require('react'); -var MNoticeTileController = require("../../controllers/molecules/MNoticeTile"); +var MNoticeTileController = require("../../../../src/controllers/molecules/MNoticeTile"); module.exports = React.createClass({ displayName: 'MNoticeTile', diff --git a/src/views/molecules/MTextTile.js b/themes/base/views/molecules/MTextTile.js similarity index 80% rename from src/views/molecules/MTextTile.js rename to themes/base/views/molecules/MTextTile.js index a1642650..9fcd17c7 100644 --- a/src/views/molecules/MTextTile.js +++ b/themes/base/views/molecules/MTextTile.js @@ -1,6 +1,6 @@ var React = require('react'); -var MTextTileController = require("../../controllers/molecules/MTextTile"); +var MTextTileController = require("../../../../src/controllers/molecules/MTextTile"); module.exports = React.createClass({ displayName: 'MTextTile', diff --git a/src/views/molecules/MatrixToolbar.js b/themes/base/views/molecules/MatrixToolbar.js similarity index 69% rename from src/views/molecules/MatrixToolbar.js rename to themes/base/views/molecules/MatrixToolbar.js index 1f4b4c4a..5a24d75a 100644 --- a/src/views/molecules/MatrixToolbar.js +++ b/themes/base/views/molecules/MatrixToolbar.js @@ -1,10 +1,10 @@ var React = require('react'); -var ComponentBroker = require('../../ComponentBroker'); +var ComponentBroker = require('../../../../src/ComponentBroker'); var LogoutButton = ComponentBroker.get("atoms/LogoutButton"); -var MatrixToolbarController = require("../../controllers/molecules/MatrixToolbar"); +var MatrixToolbarController = require("../../../../src/controllers/molecules/MatrixToolbar"); module.exports = React.createClass({ displayName: 'MatrixToolbar', diff --git a/src/views/molecules/MemberTile.js b/themes/base/views/molecules/MemberTile.js similarity index 79% rename from src/views/molecules/MemberTile.js rename to themes/base/views/molecules/MemberTile.js index 444970b8..adee6820 100644 --- a/src/views/molecules/MemberTile.js +++ b/themes/base/views/molecules/MemberTile.js @@ -1,6 +1,6 @@ var React = require('react'); -var MemberTileController = require("../../controllers/molecules/MemberTile"); +var MemberTileController = require("../../../../src/controllers/molecules/MemberTile"); module.exports = React.createClass({ displayName: 'MemberTile', diff --git a/src/views/molecules/MessageComposer.js b/themes/base/views/molecules/MessageComposer.js similarity index 78% rename from src/views/molecules/MessageComposer.js rename to themes/base/views/molecules/MessageComposer.js index b1b4e7ab..07ffeced 100644 --- a/src/views/molecules/MessageComposer.js +++ b/themes/base/views/molecules/MessageComposer.js @@ -1,6 +1,6 @@ var React = require('react'); -var MessageComposerController = require("../../controllers/molecules/MessageComposer"); +var MessageComposerController = require("../../../../src/controllers/molecules/MessageComposer"); module.exports = React.createClass({ displayName: 'MessageComposer', diff --git a/src/views/molecules/MessageTile.js b/themes/base/views/molecules/MessageTile.js similarity index 89% rename from src/views/molecules/MessageTile.js rename to themes/base/views/molecules/MessageTile.js index a06ea696..c1eba7c2 100644 --- a/src/views/molecules/MessageTile.js +++ b/themes/base/views/molecules/MessageTile.js @@ -2,7 +2,7 @@ var React = require('react'); var classNames = require("classnames"); -var ComponentBroker = require('../../ComponentBroker'); +var ComponentBroker = require('../../../../src/ComponentBroker'); var MessageTimestamp = ComponentBroker.get('atoms/MessageTimestamp'); var SenderProfile = ComponentBroker.get('molecules/SenderProfile'); @@ -15,7 +15,7 @@ var tileTypes = { 'm.emote': ComponentBroker.get('molecules/MEmoteTile') }; -var MessageTileController = require("../../controllers/molecules/MessageTile"); +var MessageTileController = require("../../../../src/controllers/molecules/MessageTile"); module.exports = React.createClass({ displayName: 'MessageTile', diff --git a/src/views/molecules/ProgressBar.js b/themes/base/views/molecules/ProgressBar.js similarity index 86% rename from src/views/molecules/ProgressBar.js rename to themes/base/views/molecules/ProgressBar.js index b4e012d3..5b136059 100644 --- a/src/views/molecules/ProgressBar.js +++ b/themes/base/views/molecules/ProgressBar.js @@ -1,6 +1,6 @@ var React = require('react'); -var ProgressBarController = require("./../molecules/ProgressBar"); +var ProgressBarController = require("../../../../src/controllers/molecules/ProgressBar"); module.exports = React.createClass({ displayName: 'ProgressBar', diff --git a/src/views/molecules/RoomHeader.js b/themes/base/views/molecules/RoomHeader.js similarity index 77% rename from src/views/molecules/RoomHeader.js rename to themes/base/views/molecules/RoomHeader.js index 84743bcd..345b3ff1 100644 --- a/src/views/molecules/RoomHeader.js +++ b/themes/base/views/molecules/RoomHeader.js @@ -1,6 +1,6 @@ var React = require('react'); -var RoomHeaderController = require("../../controllers/molecules/RoomHeader"); +var RoomHeaderController = require("../../../../src/controllers/molecules/RoomHeader"); module.exports = React.createClass({ displayName: 'RoomHeader', diff --git a/src/views/molecules/RoomTile.js b/themes/base/views/molecules/RoomTile.js similarity index 82% rename from src/views/molecules/RoomTile.js rename to themes/base/views/molecules/RoomTile.js index c772b06f..f7cc000a 100644 --- a/src/views/molecules/RoomTile.js +++ b/themes/base/views/molecules/RoomTile.js @@ -1,9 +1,9 @@ var React = require('react'); var classNames = require('classnames'); -var RoomTileController = require("../../controllers/molecules/RoomTile"); +var RoomTileController = require("../../../../src/controllers/molecules/RoomTile"); -var MatrixClientPeg = require("../../MatrixClientPeg"); +var MatrixClientPeg = require("../../../../src/MatrixClientPeg"); module.exports = React.createClass({ displayName: 'RoomTile', diff --git a/src/views/molecules/SenderProfile.js b/themes/base/views/molecules/SenderProfile.js similarity index 86% rename from src/views/molecules/SenderProfile.js rename to themes/base/views/molecules/SenderProfile.js index f295e20c..31b6b6f9 100644 --- a/src/views/molecules/SenderProfile.js +++ b/themes/base/views/molecules/SenderProfile.js @@ -1,6 +1,6 @@ var React = require('react'); -var SenderProfileController = require("../../controllers/molecules/SenderProfile"); +var SenderProfileController = require("../../../../src/controllers/molecules/SenderProfile"); module.exports = React.createClass({ displayName: 'SenderProfile', diff --git a/src/views/molecules/ServerConfig.js b/themes/base/views/molecules/ServerConfig.js similarity index 88% rename from src/views/molecules/ServerConfig.js rename to themes/base/views/molecules/ServerConfig.js index b8beb53b..3c6974db 100644 --- a/src/views/molecules/ServerConfig.js +++ b/themes/base/views/molecules/ServerConfig.js @@ -1,6 +1,6 @@ var React = require('react'); -var ServerConfigController = require("../../controllers/molecules/ServerConfig"); +var ServerConfigController = require("../../../../src/controllers/molecules/ServerConfig"); module.exports = React.createClass({ displayName: 'ServerConfig', diff --git a/src/views/molecules/UnknownMessageTile.js b/themes/base/views/molecules/UnknownMessageTile.js similarity index 74% rename from src/views/molecules/UnknownMessageTile.js rename to themes/base/views/molecules/UnknownMessageTile.js index 24485d9b..1ba571b2 100644 --- a/src/views/molecules/UnknownMessageTile.js +++ b/themes/base/views/molecules/UnknownMessageTile.js @@ -1,6 +1,6 @@ var React = require('react'); -var UnknownMessageTileController = require("../../controllers/molecules/UnknownMessageTile"); +var UnknownMessageTileController = require("../../../../src/controllers/molecules/UnknownMessageTile"); module.exports = React.createClass({ displayName: 'UnknownMessageTile', diff --git a/src/views/organisms/MemberList.js b/themes/base/views/organisms/MemberList.js similarity index 83% rename from src/views/organisms/MemberList.js rename to themes/base/views/organisms/MemberList.js index e76f9cb6..9d743c45 100644 --- a/src/views/organisms/MemberList.js +++ b/themes/base/views/organisms/MemberList.js @@ -1,8 +1,8 @@ var React = require('react'); -var MemberListController = require("../../controllers/organisms/MemberList"); +var MemberListController = require("../../../../src/controllers/organisms/MemberList"); -var ComponentBroker = require('../../ComponentBroker'); +var ComponentBroker = require('../../../../src/ComponentBroker'); var MemberTile = ComponentBroker.get("molecules/MemberTile"); diff --git a/src/views/organisms/RoomList.js b/themes/base/views/organisms/RoomList.js similarity index 80% rename from src/views/organisms/RoomList.js rename to themes/base/views/organisms/RoomList.js index 22168b44..cd056b07 100644 --- a/src/views/organisms/RoomList.js +++ b/themes/base/views/organisms/RoomList.js @@ -1,6 +1,6 @@ var React = require('react'); -var RoomListController = require("../../controllers/organisms/RoomList"); +var RoomListController = require("../../../../src/controllers/organisms/RoomList"); module.exports = React.createClass({ diff --git a/src/views/organisms/RoomView.js b/themes/base/views/organisms/RoomView.js similarity index 91% rename from src/views/organisms/RoomView.js rename to themes/base/views/organisms/RoomView.js index 24cda7cb..c095dc4d 100644 --- a/src/views/organisms/RoomView.js +++ b/themes/base/views/organisms/RoomView.js @@ -1,15 +1,15 @@ var React = require('react'); -var MatrixClientPeg = require("../../MatrixClientPeg"); +var MatrixClientPeg = require("../../../../src/MatrixClientPeg"); -var ComponentBroker = require('../../ComponentBroker'); +var ComponentBroker = require('../../../../src/ComponentBroker'); var MessageTile = ComponentBroker.get('molecules/MessageTile'); var RoomHeader = ComponentBroker.get('molecules/RoomHeader'); var MemberList = ComponentBroker.get('organisms/MemberList'); var MessageComposer = ComponentBroker.get('molecules/MessageComposer'); -var RoomViewController = require("../../controllers/organisms/RoomView"); +var RoomViewController = require("../../../../src/controllers/organisms/RoomView"); var Loader = require("react-loader"); diff --git a/src/views/pages/MatrixChat.js b/themes/base/views/pages/MatrixChat.js similarity index 88% rename from src/views/pages/MatrixChat.js rename to themes/base/views/pages/MatrixChat.js index c013d8c3..9fb80c33 100644 --- a/src/views/pages/MatrixChat.js +++ b/themes/base/views/pages/MatrixChat.js @@ -1,12 +1,12 @@ var React = require('react'); -var ComponentBroker = require('../../ComponentBroker'); +var ComponentBroker = require('../../../../src/ComponentBroker'); var RoomList = ComponentBroker.get('organisms/RoomList'); var RoomView = ComponentBroker.get('organisms/RoomView'); var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar'); var Login = ComponentBroker.get('templates/Login'); -var MatrixChatController = require("../../controllers/pages/MatrixChat"); +var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat"); // should be atomised var Loader = require("react-loader"); diff --git a/src/views/templates/Login.js b/themes/base/views/templates/Login.js similarity index 86% rename from src/views/templates/Login.js rename to themes/base/views/templates/Login.js index 2c87f193..285a49b8 100644 --- a/src/views/templates/Login.js +++ b/themes/base/views/templates/Login.js @@ -1,11 +1,11 @@ var React = require('react'); -var ComponentBroker = require("../../ComponentBroker"); +var ComponentBroker = require("../../../../src/ComponentBroker"); var ProgressBar = ComponentBroker.get("molecules/ProgressBar"); var Loader = require("react-loader"); -var LoginController = require("../../controllers/templates/Login"); +var LoginController = require("../../../../src/controllers/templates/Login"); module.exports = React.createClass({ displayName: 'Login',