Reshuffle to put "HTML" (JSX) and CSS together as a theme with logic elsewhere.

This commit is contained in:
David Baker 2015-06-23 14:40:50 +01:00
parent cc4fa6140c
commit a022a4b9a6
37 changed files with 56 additions and 54 deletions

View file

@ -8,12 +8,12 @@
"url": "https://github.com/matrix-org/matrix-react-sdk" "url": "https://github.com/matrix-org/matrix-react-sdk"
}, },
"license": "Apache 2", "license": "Apache 2",
"main": "build/index.js", "main": "src/index.js",
"scripts": { "scripts": {
"build:js": "jsx src/ build", "build:js": "jsx themes/base/views/ build",
"start:js": "jsx -w src/ build --source-map-inline", "start:js": "jsx -w themes/base/views/ build --source-map-inline",
"build:css": "catw 'css/**/*.css' -o bundle.css -c uglifycss --no-watch", "build:css": "catw 'themes/base/css/**/*.css' -o bundle.css -c uglifycss --no-watch",
"start:css": "catw 'css/**/*.css' -o bundle.css -v", "start:css": "catw 'themes/base/css/**/*.css' -o bundle.css -v",
"build": "npm run build:js && npm run build:css", "build": "npm run build:js && npm run build:css",
"start": "parallelshell 'npm run start:js' 'npm run start:css'" "start": "parallelshell 'npm run start:js' 'npm run start:css'"
}, },

View file

@ -1,7 +1,7 @@
var components = {}; var components = {};
function load(name) { function load(name) {
var module = require("./views/"+name); var module = require("../themes/base/views/"+name);
components[name] = module; components[name] = module;
return module; return module;
}; };
@ -23,22 +23,22 @@ module.exports = {
// otherwise browserify has no way of knowing what module to include // 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 in this file (because the require is file-specific) and
// must be at the end because the components include this file. // must be at the end because the components include this file.
require('./views/atoms/LogoutButton'); require('../themes/base/views/atoms/LogoutButton');
require('./views/atoms/MessageTimestamp'); require('../themes/base/views/atoms/MessageTimestamp');
require('./views/molecules/MatrixToolbar'); require('../themes/base/views/molecules/MatrixToolbar');
require('./views/molecules/RoomTile'); require('../themes/base/views/molecules/RoomTile');
require('./views/molecules/MessageTile'); require('../themes/base/views/molecules/MessageTile');
require('./views/molecules/SenderProfile'); require('../themes/base/views/molecules/SenderProfile');
require('./views/molecules/UnknownMessageTile'); require('../themes/base/views/molecules/UnknownMessageTile');
require('./views/molecules/MTextTile'); require('../themes/base/views/molecules/MTextTile');
require('./views/molecules/MNoticeTile'); require('../themes/base/views/molecules/MNoticeTile');
require('./views/molecules/MEmoteTile'); require('../themes/base/views/molecules/MEmoteTile');
require('./views/molecules/RoomHeader'); require('../themes/base/views/molecules/RoomHeader');
require('./views/molecules/MessageComposer'); require('../themes/base/views/molecules/MessageComposer');
require('./views/molecules/ProgressBar'); require('../themes/base/views/molecules/ProgressBar');
require('./views/molecules/ServerConfig'); require('../themes/base/views/molecules/ServerConfig');
require('./views/organisms/MemberList'); require('../themes/base/views/organisms/MemberList');
require('./views/molecules/MemberTile'); require('../themes/base/views/molecules/MemberTile');
require('./views/organisms/RoomList'); require('../themes/base/views/organisms/RoomList');
require('./views/organisms/RoomView'); require('../themes/base/views/organisms/RoomView');
require('./views/templates/Login'); require('../themes/base/views/templates/Login');

View file

@ -1,3 +1,5 @@
var React = require('react');
module.exports = { module.exports = {
propTypes: { propTypes: {
value: React.PropTypes.number, value: React.PropTypes.number,

View file

@ -1 +1 @@
module.exports.MatrixChat = require("./views/pages/MatrixChat"); module.exports.MatrixChat = require("../themes/base/views/pages/MatrixChat");

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var LogoutButtonController = require("../../controllers/atoms/LogoutButton"); var LogoutButtonController = require("../../../../src/controllers/atoms/LogoutButton");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'LogoutButton', displayName: 'LogoutButton',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var MessageTimestampController = require("../../controllers/atoms/MessageTimestamp"); var MessageTimestampController = require("../../../../src/controllers/atoms/MessageTimestamp");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MessageTimestamp', displayName: 'MessageTimestamp',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var MEmoteTileController = require("../../controllers/molecules/MEmoteTile"); var MEmoteTileController = require("../../../../src/controllers/molecules/MEmoteTile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MEmoteTile', displayName: 'MEmoteTile',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var MNoticeTileController = require("../../controllers/molecules/MNoticeTile"); var MNoticeTileController = require("../../../../src/controllers/molecules/MNoticeTile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MNoticeTile', displayName: 'MNoticeTile',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var MTextTileController = require("../../controllers/molecules/MTextTile"); var MTextTileController = require("../../../../src/controllers/molecules/MTextTile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MTextTile', displayName: 'MTextTile',

View file

@ -1,10 +1,10 @@
var React = require('react'); var React = require('react');
var ComponentBroker = require('../../ComponentBroker'); var ComponentBroker = require('../../../../src/ComponentBroker');
var LogoutButton = ComponentBroker.get("atoms/LogoutButton"); var LogoutButton = ComponentBroker.get("atoms/LogoutButton");
var MatrixToolbarController = require("../../controllers/molecules/MatrixToolbar"); var MatrixToolbarController = require("../../../../src/controllers/molecules/MatrixToolbar");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MatrixToolbar', displayName: 'MatrixToolbar',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var MemberTileController = require("../../controllers/molecules/MemberTile"); var MemberTileController = require("../../../../src/controllers/molecules/MemberTile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MemberTile', displayName: 'MemberTile',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var MessageComposerController = require("../../controllers/molecules/MessageComposer"); var MessageComposerController = require("../../../../src/controllers/molecules/MessageComposer");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MessageComposer', displayName: 'MessageComposer',

View file

@ -2,7 +2,7 @@ var React = require('react');
var classNames = require("classnames"); var classNames = require("classnames");
var ComponentBroker = require('../../ComponentBroker'); var ComponentBroker = require('../../../../src/ComponentBroker');
var MessageTimestamp = ComponentBroker.get('atoms/MessageTimestamp'); var MessageTimestamp = ComponentBroker.get('atoms/MessageTimestamp');
var SenderProfile = ComponentBroker.get('molecules/SenderProfile'); var SenderProfile = ComponentBroker.get('molecules/SenderProfile');
@ -15,7 +15,7 @@ var tileTypes = {
'm.emote': ComponentBroker.get('molecules/MEmoteTile') 'm.emote': ComponentBroker.get('molecules/MEmoteTile')
}; };
var MessageTileController = require("../../controllers/molecules/MessageTile"); var MessageTileController = require("../../../../src/controllers/molecules/MessageTile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'MessageTile', displayName: 'MessageTile',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var ProgressBarController = require("./../molecules/ProgressBar"); var ProgressBarController = require("../../../../src/controllers/molecules/ProgressBar");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'ProgressBar', displayName: 'ProgressBar',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var RoomHeaderController = require("../../controllers/molecules/RoomHeader"); var RoomHeaderController = require("../../../../src/controllers/molecules/RoomHeader");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'RoomHeader', displayName: 'RoomHeader',

View file

@ -1,9 +1,9 @@
var React = require('react'); var React = require('react');
var classNames = require('classnames'); 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({ module.exports = React.createClass({
displayName: 'RoomTile', displayName: 'RoomTile',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var SenderProfileController = require("../../controllers/molecules/SenderProfile"); var SenderProfileController = require("../../../../src/controllers/molecules/SenderProfile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'SenderProfile', displayName: 'SenderProfile',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var ServerConfigController = require("../../controllers/molecules/ServerConfig"); var ServerConfigController = require("../../../../src/controllers/molecules/ServerConfig");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'ServerConfig', displayName: 'ServerConfig',

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var UnknownMessageTileController = require("../../controllers/molecules/UnknownMessageTile"); var UnknownMessageTileController = require("../../../../src/controllers/molecules/UnknownMessageTile");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'UnknownMessageTile', displayName: 'UnknownMessageTile',

View file

@ -1,8 +1,8 @@
var React = require('react'); 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"); var MemberTile = ComponentBroker.get("molecules/MemberTile");

View file

@ -1,6 +1,6 @@
var React = require('react'); var React = require('react');
var RoomListController = require("../../controllers/organisms/RoomList"); var RoomListController = require("../../../../src/controllers/organisms/RoomList");
module.exports = React.createClass({ module.exports = React.createClass({

View file

@ -1,15 +1,15 @@
var React = require('react'); 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 MessageTile = ComponentBroker.get('molecules/MessageTile');
var RoomHeader = ComponentBroker.get('molecules/RoomHeader'); var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
var MemberList = ComponentBroker.get('organisms/MemberList'); var MemberList = ComponentBroker.get('organisms/MemberList');
var MessageComposer = ComponentBroker.get('molecules/MessageComposer'); var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
var RoomViewController = require("../../controllers/organisms/RoomView"); var RoomViewController = require("../../../../src/controllers/organisms/RoomView");
var Loader = require("react-loader"); var Loader = require("react-loader");

View file

@ -1,12 +1,12 @@
var React = require('react'); var React = require('react');
var ComponentBroker = require('../../ComponentBroker'); var ComponentBroker = require('../../../../src/ComponentBroker');
var RoomList = ComponentBroker.get('organisms/RoomList'); var RoomList = ComponentBroker.get('organisms/RoomList');
var RoomView = ComponentBroker.get('organisms/RoomView'); var RoomView = ComponentBroker.get('organisms/RoomView');
var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar'); var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar');
var Login = ComponentBroker.get('templates/Login'); var Login = ComponentBroker.get('templates/Login');
var MatrixChatController = require("../../controllers/pages/MatrixChat"); var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat");
// should be atomised // should be atomised
var Loader = require("react-loader"); var Loader = require("react-loader");

View file

@ -1,11 +1,11 @@
var React = require('react'); var React = require('react');
var ComponentBroker = require("../../ComponentBroker"); var ComponentBroker = require("../../../../src/ComponentBroker");
var ProgressBar = ComponentBroker.get("molecules/ProgressBar"); var ProgressBar = ComponentBroker.get("molecules/ProgressBar");
var Loader = require("react-loader"); var Loader = require("react-loader");
var LoginController = require("../../controllers/templates/Login"); var LoginController = require("../../../../src/controllers/templates/Login");
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'Login', displayName: 'Login',