From 6f646260aab9b498b3feb24a2b1b52c539a33b7c Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Nov 2015 17:31:32 +0000 Subject: [PATCH 1/4] WIP of component indexing update --- package.json | 1 + src/component-index.js | 62 ++++++++++++++++++++++ src/skins/vector/skindex.js | 100 ----------------------------------- src/skins/vector/skinfo.json | 3 -- src/vector/index.js | 2 +- 5 files changed, 64 insertions(+), 104 deletions(-) create mode 100644 src/component-index.js delete mode 100644 src/skins/vector/skindex.js delete mode 100644 src/skins/vector/skinfo.json diff --git a/package.json b/package.json index caed363d9..e41a67b73 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ }, "license": "Apache-2.0", "style": "bundle.css", + "matrix-react-parent": "matrix-react-sdk", "scripts": { "reskindex": "reskindex vector -h src/skins/vector/header", "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", diff --git a/src/component-index.js b/src/component-index.js new file mode 100644 index 000000000..0fc5b272d --- /dev/null +++ b/src/component-index.js @@ -0,0 +1,62 @@ +/* +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. +*/ + +/* + * THIS FILE IS AUTO-GENERATED + * You can edit it you like, but your changes will be overwritten, + * so you'd just be trying to swim upstream like a salmon. + * You are not a salmon. + */ + +module.exports.components = require('matrix-react-sdk/lib/component-index').components; + +module.exports.components['structures.login.Login'] = require('./components/structures/login/Login'); +module.exports.components['structures.login.PostRegistration'] = require('./components/structures/login/PostRegistration'); +module.exports.components['structures.login.Registration'] = require('./components/structures/login/Registration'); +module.exports.components['views.elements.ImageView'] = require('./components/views/elements/ImageView'); +module.exports.components['views.elements.Spinner'] = require('./components/views/elements/Spinner'); +module.exports.components['views.login.RegistrationForm'] = require('./components/views/login/RegistrationForm'); +module.exports.components['views.login.ServerConfig'] = require('./components/views/login/ServerConfig'); +module.exports.components['views.messages.MessageTimestamp'] = require('./components/views/messages/MessageTimestamp'); +module.exports.components['views.rooms.RoomDNDView'] = require('./components/views/rooms/RoomDNDView'); + +// Old, unported Vector views: +module.exports.components['molecules.BottomLeftMenu'] = require('./skins/vector/views/molecules/BottomLeftMenu'); +module.exports.components['molecules.BottomLeftMenuTile'] = require('./skins/vector/views/molecules/BottomLeftMenuTile'); +module.exports.components['molecules.DateSeparator'] = require('./skins/vector/views/molecules/DateSeparator'); +module.exports.components['molecules.MatrixToolbar'] = require('./skins/vector/views/molecules/MatrixToolbar'); +module.exports.components['molecules.MessageContextMenu'] = require('./skins/vector/views/molecules/MessageContextMenu'); +module.exports.components['molecules.RoomCreate'] = require('./skins/vector/views/molecules/RoomCreate'); +module.exports.components['molecules.RoomDropTarget'] = require('./skins/vector/views/molecules/RoomDropTarget'); +module.exports.components['molecules.RoomTooltip'] = require('./skins/vector/views/molecules/RoomTooltip'); +module.exports.components['molecules.SearchBar'] = require('./skins/vector/views/molecules/SearchBar'); +module.exports.components['molecules.SenderProfile'] = require('./skins/vector/views/molecules/SenderProfile'); +module.exports.components['organisms.CreateRoom'] = require('./skins/vector/views/organisms/CreateRoom'); +module.exports.components['organisms.ErrorDialog'] = require('./skins/vector/views/organisms/ErrorDialog'); +module.exports.components['organisms.LeftPanel'] = require('./skins/vector/views/organisms/LeftPanel'); +module.exports.components['organisms.LogoutPrompt'] = require('./skins/vector/views/organisms/LogoutPrompt'); +module.exports.components['organisms.MemberList'] = require('./skins/vector/views/organisms/MemberList'); +module.exports.components['organisms.Notifier'] = require('./skins/vector/views/organisms/Notifier'); +module.exports.components['organisms.QuestionDialog'] = require('./skins/vector/views/organisms/QuestionDialog'); +module.exports.components['organisms.RightPanel'] = require('./skins/vector/views/organisms/RightPanel'); +module.exports.components['organisms.RoomDirectory'] = require('./skins/vector/views/organisms/RoomDirectory'); +module.exports.components['organisms.RoomList'] = require('./skins/vector/views/organisms/RoomList'); +module.exports.components['organisms.RoomSubList'] = require('./skins/vector/views/organisms/RoomSubList'); +module.exports.components['organisms.RoomView'] = require('./skins/vector/views/organisms/RoomView'); +module.exports.components['organisms.UserSettings'] = require('./skins/vector/views/organisms/UserSettings'); +module.exports.components['organisms.ViewSource'] = require('./skins/vector/views/organisms/ViewSource'); +module.exports.components['pages.CompatibilityPage'] = require('./skins/vector/views/pages/CompatibilityPage'); +module.exports.components['pages.MatrixChat'] = require('./skins/vector/views/pages/MatrixChat'); diff --git a/src/skins/vector/skindex.js b/src/skins/vector/skindex.js deleted file mode 100644 index 1e747c62d..000000000 --- a/src/skins/vector/skindex.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -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. -*/ - -/* - * THIS FILE IS AUTO-GENERATED - * You can edit it you like, but your changes will be overwritten, - * so you'd just be trying to swim upstream like a salmon. - * You are not a salmon. - */ - -var skin = {}; - -// Vector-specific stuff -skin['elements.Spinner'] = require('../../components/views/elements/Spinner'); -skin['elements.ImageView'] = require('../../components/views/elements/ImageView'); -skin['messages.MessageTimestamp'] = require('../../components/views/messages/MessageTimestamp'); -skin['rooms.RoomTile'] = require('../../components/views/rooms/RoomDNDView'); - -// TODO: Fix this so matrix-react-sdk stuff is in react SDK skindex? -skin['avatars.RoomAvatar'] = require('matrix-react-sdk/lib/components/views/avatars/RoomAvatar'); -skin['avatars.MemberAvatar'] = require('matrix-react-sdk/lib/components/views/avatars/MemberAvatar'); - -skin['settings.EnableNotificationsButton'] = require('matrix-react-sdk/lib/components/views/settings/EnableNotificationsButton'); -skin['settings.ChangeAvatar'] = require('matrix-react-sdk/lib/components/views/settings/ChangeAvatar'); -skin['settings.ChangeDisplayName'] = require('matrix-react-sdk/lib/components/views/settings/ChangeDisplayName'); -skin['settings.ChangePassword'] = require('matrix-react-sdk/lib/components/views/settings/ChangePassword'); - -skin['elements.EditableText'] = require('matrix-react-sdk/lib/components/views/elements/EditableText'); -skin['elements.ProgressBar'] = require('matrix-react-sdk/lib/components/views/elements/ProgressBar'); -skin['elements.UserSelector'] = require('matrix-react-sdk/lib/components/views/elements/UserSelector'); - -skin['messages.MessageComposer'] = require('matrix-react-sdk/lib/components/views/messages/MessageComposer'); -skin['messages.TextualEvent'] = require('matrix-react-sdk/lib/components/views/messages/TextualEvent'); -skin['messages.MRoomMemberEvent'] = require('matrix-react-sdk/lib/components/views/messages/MRoomMemberEvent'); -skin['messages.Event'] = require('matrix-react-sdk/lib/components/views/messages/Event'); -skin['messages.Message'] = require('matrix-react-sdk/lib/components/views/messages/Message'); -skin['messages.MFileMessage'] = require('matrix-react-sdk/lib/components/views/messages/MFileMessage'); -skin['messages.MImageMessage'] = require('matrix-react-sdk/lib/components/views/messages/MImageMessage'); -skin['messages.MVideoMessage'] = require('matrix-react-sdk/lib/components/views/messages/MVideoMessage'); -skin['messages.TextualMessage'] = require('matrix-react-sdk/lib/components/views/messages/TextualMessage'); -skin['messages.UnknownMessage'] = require('matrix-react-sdk/lib/components/views/messages/UnknownMessage'); - -skin['rooms.MemberInfo'] = require('matrix-react-sdk/lib/components/views/rooms/MemberInfo'); -skin['rooms.RoomHeader'] = require('matrix-react-sdk/lib/components/views/rooms/RoomHeader'); -skin['rooms.RoomSettings'] = require('matrix-react-sdk/lib/components/views/rooms/RoomSettings'); -skin['rooms.MemberTile'] = require('matrix-react-sdk/lib/components/views/rooms/MemberTile'); - -skin['create_room.CreateRoomButton'] = require('matrix-react-sdk/lib/components/views/create_room/CreateRoomButton'); -skin['create_room.Presets'] = require('matrix-react-sdk/lib/components/views/create_room/Presets'); -skin['create_room.RoomAlias'] = require('matrix-react-sdk/lib/components/views/create_room/RoomAlias'); - -skin['voip.CallView'] = require('matrix-react-sdk/lib/components/views/voip/CallView'); -skin['voip.IncomingCallBox'] = require('matrix-react-sdk/lib/components/views/voip/IncomingCallBox'); -skin['voip.VideoView'] = require('matrix-react-sdk/lib/components/views/voip/VideoView'); -skin['voip.VideoFeed'] = require('matrix-react-sdk/lib/components/views/voip/VideoFeed'); - - - -// Old style stuff -skin['molecules.BottomLeftMenu'] = require('./views/molecules/BottomLeftMenu'); -skin['molecules.BottomLeftMenuTile'] = require('./views/molecules/BottomLeftMenuTile'); -skin['molecules.DateSeparator'] = require('./views/molecules/DateSeparator'); -skin['molecules.MatrixToolbar'] = require('./views/molecules/MatrixToolbar'); -skin['molecules.MessageContextMenu'] = require('./views/molecules/MessageContextMenu'); -skin['molecules.RoomCreate'] = require('./views/molecules/RoomCreate'); -skin['molecules.RoomDropTarget'] = require('./views/molecules/RoomDropTarget'); -skin['molecules.RoomTooltip'] = require('./views/molecules/RoomTooltip'); -skin['molecules.SearchBar'] = require('./views/molecules/SearchBar'); -skin['molecules.SenderProfile'] = require('./views/molecules/SenderProfile'); -skin['organisms.CreateRoom'] = require('./views/organisms/CreateRoom'); -skin['organisms.ErrorDialog'] = require('./views/organisms/ErrorDialog'); -skin['organisms.LeftPanel'] = require('./views/organisms/LeftPanel'); -skin['organisms.LogoutPrompt'] = require('./views/organisms/LogoutPrompt'); -skin['organisms.MemberList'] = require('./views/organisms/MemberList'); -skin['organisms.Notifier'] = require('./views/organisms/Notifier'); -skin['organisms.QuestionDialog'] = require('./views/organisms/QuestionDialog'); -skin['organisms.RightPanel'] = require('./views/organisms/RightPanel'); -skin['organisms.RoomDirectory'] = require('./views/organisms/RoomDirectory'); -skin['organisms.RoomList'] = require('./views/organisms/RoomList'); -skin['organisms.RoomSubList'] = require('./views/organisms/RoomSubList'); -skin['organisms.RoomView'] = require('./views/organisms/RoomView'); -skin['organisms.UserSettings'] = require('./views/organisms/UserSettings'); -skin['organisms.ViewSource'] = require('./views/organisms/ViewSource'); -skin['pages.CompatibilityPage'] = require('./views/pages/CompatibilityPage'); -skin['pages.MatrixChat'] = require('./views/pages/MatrixChat'); - -module.exports = skin; diff --git a/src/skins/vector/skinfo.json b/src/skins/vector/skinfo.json deleted file mode 100644 index 287ff9e23..000000000 --- a/src/skins/vector/skinfo.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "baseSkin": "" -} diff --git a/src/vector/index.js b/src/vector/index.js index 87cbd0b66..49ee3b5fa 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -20,7 +20,7 @@ var RunModernizrTests = require("./modernizr"); // this side-effects a global var React = require("react"); var ReactDOM = require("react-dom"); var sdk = require("matrix-react-sdk"); -sdk.loadSkin(require('../skins/vector/skindex')); +sdk.loadSkin(require('../component-index')); sdk.loadModule(require('../modules/VectorConferenceHandler')); var qs = require("querystring"); From 6a4038daeb562e58e8f62e1102fb8fa490d6c7a5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Nov 2015 17:56:55 +0000 Subject: [PATCH 2/4] Add 'replaces' tag to mark that the RoomDNDView is a RoomTile --- src/components/views/rooms/RoomDNDView.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomDNDView.js b/src/components/views/rooms/RoomDNDView.js index f096723f7..419aac746 100644 --- a/src/components/views/rooms/RoomDNDView.js +++ b/src/components/views/rooms/RoomDNDView.js @@ -201,4 +201,6 @@ DragSource('RoomTile', roomTileSource, function(connect, monitor) { // You can ask the monitor about the current drag state: isDragging: monitor.isDragging() }; -})(RoomTile)); \ No newline at end of file +})(RoomTile)); + +module.exports.replaces = 'RoomTile'; From 021056cfd18a5defa9f254266db066168fdd4efe Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 30 Nov 2015 18:00:54 +0000 Subject: [PATCH 3/4] Move copyright header --- package.json | 2 +- src/{skins/vector => }/header | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/{skins/vector => }/header (100%) diff --git a/package.json b/package.json index e41a67b73..0598201d5 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "style": "bundle.css", "matrix-react-parent": "matrix-react-sdk", "scripts": { - "reskindex": "reskindex vector -h src/skins/vector/header", + "reskindex": "reskindex -h src/header", "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", "build:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/bundle.css -c uglifycss --no-watch", "build:compile": "babel --source-maps -d lib src", diff --git a/src/skins/vector/header b/src/header similarity index 100% rename from src/skins/vector/header rename to src/header From 2c12b9128b5fe4c2dff8656f3e9c8bab09353971 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 1 Dec 2015 16:57:36 +0000 Subject: [PATCH 4/4] highlight binged rooms more clearly --- src/skins/vector/css/molecules/RoomTile.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/skins/vector/css/molecules/RoomTile.css b/src/skins/vector/css/molecules/RoomTile.css index 898670d6d..ac790fd8c 100644 --- a/src/skins/vector/css/molecules/RoomTile.css +++ b/src/skins/vector/css/molecules/RoomTile.css @@ -112,6 +112,10 @@ limitations under the License. color: #76cfa6 ! important; } +.mx_RoomTile_highlight .mx_RoomTile_name { + color: #ff0064 ! important; +} + .mx_RoomTile.mx_RoomTile_selected .mx_RoomTile_name { background: url('img/selected.png'); background-repeat: no-repeat;