From 52f3d7f18bdeaa2486f89a1a607ed41ac45f755b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 1 Dec 2015 16:12:13 +0000 Subject: [PATCH 1/6] Add generic LoginFooter. Remove vector reference --- src/components/structures/login/Login.js | 8 ++---- src/components/views/login/LoginFooter.js | 31 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 src/components/views/login/LoginFooter.js diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js index e3ec87f8f2..dd47d5b907 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/login/Login.js @@ -159,6 +159,7 @@ module.exports = React.createClass({displayName: 'Login', render: function() { var Loader = sdk.getComponent("elements.Spinner"); + var LoginFooter = sdk.getComponent("login.LoginFooter"); var loader = this.state.busy ?
: null; return ( @@ -185,12 +186,7 @@ module.exports = React.createClass({displayName: 'Login', Create a new account
-
- blog  ·   - twitter  ·   - github  ·   - powered by Matrix -
+ diff --git a/src/components/views/login/LoginFooter.js b/src/components/views/login/LoginFooter.js new file mode 100644 index 0000000000..d486b3597e --- /dev/null +++ b/src/components/views/login/LoginFooter.js @@ -0,0 +1,31 @@ +/* +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'; + +var React = require('react'); + +module.exports = React.createClass({ + displayName: 'LoginFooter', + + render: function() { + return ( +
+ powered by Matrix +
+ ); + } +}); From 05a6121934f9169e4f9e2e21cbbfc450d6ffe9fb Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 1 Dec 2015 16:27:48 +0000 Subject: [PATCH 2/6] Add default LoginHeader --- src/components/structures/login/Login.js | 7 +++-- src/components/views/login/LoginHeader.js | 31 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/components/views/login/LoginHeader.js diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js index dd47d5b907..54cd9e3efb 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/login/Login.js @@ -151,7 +151,7 @@ module.exports = React.createClass({displayName: 'Login', return (
Sorry, this homeserver is using a login which is not - recognised by Vector ({step}) + recognised ({step})
); } @@ -159,15 +159,14 @@ module.exports = React.createClass({displayName: 'Login', render: function() { var Loader = sdk.getComponent("elements.Spinner"); + var LoginHeader = sdk.getComponent("login.LoginHeader"); var LoginFooter = sdk.getComponent("login.LoginFooter"); var loader = this.state.busy ?
: null; return (
-
- vector -
+

Sign in

{ this.componentForStep(this._getCurrentFlowStep()) } diff --git a/src/components/views/login/LoginHeader.js b/src/components/views/login/LoginHeader.js new file mode 100644 index 0000000000..c64016413b --- /dev/null +++ b/src/components/views/login/LoginHeader.js @@ -0,0 +1,31 @@ +/* +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'; + +var React = require('react'); + +module.exports = React.createClass({ + displayName: 'LoginHeader', + + render: function() { + return ( +
+ Matrix +
+ ); + } +}); From 673b01267a44ba7a3d4c10d8374af7060ef53729 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 1 Dec 2015 16:29:58 +0000 Subject: [PATCH 3/6] Use LoginHeader everywhere --- src/components/structures/RoomView.js | 2 +- src/components/structures/login/PostRegistration.js | 5 ++--- src/components/structures/login/Registration.js | 5 ++--- src/components/views/rooms/RoomList.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 3c56d41f9a..5b7496e8b2 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -44,7 +44,7 @@ var INITIAL_SIZE = 20; module.exports = React.createClass({ displayName: 'RoomView', propTypes: { - ConferenceHandler: React.PropTypes.any // VectorConferenceHandler + ConferenceHandler: React.PropTypes.any }, getInitialState: function() { diff --git a/src/components/structures/login/PostRegistration.js b/src/components/structures/login/PostRegistration.js index 5af8d37dd8..51625a5971 100644 --- a/src/components/structures/login/PostRegistration.js +++ b/src/components/structures/login/PostRegistration.js @@ -58,12 +58,11 @@ module.exports = React.createClass({ render: function() { var ChangeDisplayName = sdk.getComponent('settings.ChangeDisplayName'); var ChangeAvatar = sdk.getComponent('settings.ChangeAvatar'); + var LoginHeader = sdk.getComponent('login.LoginHeader'); return (
-
- vector -
+
Set a display name: diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index 0cb1a87752..1570641556 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -234,12 +234,11 @@ module.exports = React.createClass({ }, render: function() { + var LoginHeader = sdk.getComponent('login.LoginHeader'); return (
-
- vector -
+ {this._getRegisterContentJsx()}
diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 11984da7f3..db5195d3c0 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -29,7 +29,7 @@ module.exports = React.createClass({ displayName: 'RoomList', propTypes: { - ConferenceHandler: React.PropTypes.any, // e.g. VectorConferenceHandler + ConferenceHandler: React.PropTypes.any, collapsed: React.PropTypes.bool, currentRoom: React.PropTypes.string }, From bb289a4145b91187945952f72c2b254283aa1180 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 1 Dec 2015 16:49:15 +0000 Subject: [PATCH 4/6] Add CustomServerDialog class --- .../views/login/CustomServerDialog.js | 50 +++++++++++++++++++ src/components/views/login/ServerConfig.js | 20 +------- 2 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 src/components/views/login/CustomServerDialog.js diff --git a/src/components/views/login/CustomServerDialog.js b/src/components/views/login/CustomServerDialog.js new file mode 100644 index 0000000000..3f86bc199c --- /dev/null +++ b/src/components/views/login/CustomServerDialog.js @@ -0,0 +1,50 @@ +/* +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. +*/ + +var React = require("react"); + +module.exports = React.createClass({ + displayName: 'CustomServerDialog', + + render: function() { + return ( +
+
+ Custom Server Options +
+
+ + You can use the custom server options to log into other Matrix + servers by specifying a different Home server URL. +
+ This allows you to use this app with an existing Matrix account on + a different Home server. +
+
+ You can also set a custom Identity server but this will affect + people's ability to find you if you use a server in a group other + than the main Matrix.org group. +
+
+
+ +
+
+ ); + } +}); diff --git a/src/components/views/login/ServerConfig.js b/src/components/views/login/ServerConfig.js index 39f9dc4594..54430c7520 100644 --- a/src/components/views/login/ServerConfig.js +++ b/src/components/views/login/ServerConfig.js @@ -93,24 +93,8 @@ module.exports = React.createClass({ }, showHelpPopup: function() { - var ErrorDialog = sdk.getComponent('dialogs.ErrorDialog'); - Modal.createDialog(ErrorDialog, { - title: 'Custom Server Options', - description: - You can use the custom server options to log into other Matrix - servers by specifying a different Home server URL. -
- This allows you to use Vector with an existing Matrix account on - a different Home server. -
-
- You can also set a custom Identity server but this will affect - people's ability to find you if you use a server in a group other - than the main Matrix.org group. -
, - button: "Dismiss", - focus: true - }); + var CustomServerDialog = sdk.getComponent('login.CustomServerDialog'); + Modal.createDialog(CustomServerDialog); }, render: function() { From 6978436b078dc9708cc55316c75ffa9495ed0f55 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 1 Dec 2015 18:33:46 +0000 Subject: [PATCH 5/6] Update component index --- src/component-index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/component-index.js b/src/component-index.js index a78ea55c17..b9821b6c56 100644 --- a/src/component-index.js +++ b/src/component-index.js @@ -42,6 +42,9 @@ module.exports.components['views.elements.ProgressBar'] = require('./components/ module.exports.components['views.elements.UserSelector'] = require('./components/views/elements/UserSelector'); module.exports.components['views.login.CaptchaForm'] = require('./components/views/login/CaptchaForm'); module.exports.components['views.login.CasLogin'] = require('./components/views/login/CasLogin'); +module.exports.components['views.login.CustomServerDialog'] = require('./components/views/login/CustomServerDialog'); +module.exports.components['views.login.LoginFooter'] = require('./components/views/login/LoginFooter'); +module.exports.components['views.login.LoginHeader'] = require('./components/views/login/LoginHeader'); module.exports.components['views.login.PasswordLogin'] = require('./components/views/login/PasswordLogin'); module.exports.components['views.login.RegistrationForm'] = require('./components/views/login/RegistrationForm'); module.exports.components['views.login.ServerConfig'] = require('./components/views/login/ServerConfig'); From 40e4ae9759a3e390dae2fc3b189b9d9c63184bfe Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 1 Dec 2015 18:34:01 +0000 Subject: [PATCH 6/6] Remove temporary vector stuff as the sister PR makes it obsolete. --- reskindex.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/reskindex.js b/reskindex.js index 4b854de8ec..66dfc39f73 100755 --- a/reskindex.js +++ b/reskindex.js @@ -45,22 +45,4 @@ for (var i = 0; i < files.length; ++i) { strm.uncork(); } -// Temporary Vector transition -var vectorViewsPath = path.join('src', 'skins', 'vector', 'views'); -if (fs.existsSync(vectorViewsPath)) { - strm.write('\n'); - strm.write('// Old, unported Vector views:\n'); - var files = glob.sync('**/*.js', {cwd: vectorViewsPath}); - for (var i = 0; i < files.length; ++i) { - var file = files[i].replace('.js', ''); - - var moduleName = (file.replace(/\//g, '.')); - - strm.write("module.exports.components['"+moduleName+"'] = require('./skins/vector/views/"+file+"');"); - strm.write('\n'); - strm.uncork(); - } -} - strm.end(); -