From cbaf1346250bc6bfe107e46ce7b2548af81cd702 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 27 Oct 2015 23:28:34 +0000 Subject: [PATCH] merge develop --- src/controllers/atoms/ImageView.js | 20 ------------------- src/controllers/organisms/RoomView.js | 1 + src/skins/vector/css/molecules/EventTile.css | 4 ---- .../vector/css/molecules/MNoticeTile.css | 2 +- src/skins/vector/views/atoms/ImageView.js | 2 -- .../vector/views/atoms/MessageTimestamp.js | 3 --- .../vector/views/atoms/voip/VideoFeed.js | 3 --- .../vector/views/molecules/EventAsTextTile.js | 3 +-- .../vector/views/molecules/MImageTile.js | 3 --- .../vector/views/molecules/MRoomMemberTile.js | 3 --- .../vector/views/molecules/MatrixToolbar.js | 3 --- .../vector/views/molecules/SenderProfile.js | 3 --- .../views/molecules/UnknownMessageTile.js | 3 --- .../vector/views/molecules/voip/VideoView.js | 2 -- src/skins/vector/views/organisms/Notifier.js | 3 ++- .../vector/views/organisms/RightPanel.js | 7 +++++++ src/skins/vector/views/pages/MatrixChat.js | 19 +++++++++++++++++- 17 files changed, 30 insertions(+), 54 deletions(-) delete mode 100644 src/controllers/atoms/ImageView.js diff --git a/src/controllers/atoms/ImageView.js b/src/controllers/atoms/ImageView.js deleted file mode 100644 index d0977e004..000000000 --- a/src/controllers/atoms/ImageView.js +++ /dev/null @@ -1,20 +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. -*/ - -'use strict'; - -module.exports = { -}; diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index 77359c8f5..21027cbfa 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -63,6 +63,7 @@ module.exports = { MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline); MatrixClientPeg.get().removeListener("Room.name", this.onRoomName); MatrixClientPeg.get().removeListener("RoomMember.typing", this.onRoomMemberTyping); + MatrixClientPeg.get().removeListener("RoomState.members", this.onRoomStateMember); } }, diff --git a/src/skins/vector/css/molecules/EventTile.css b/src/skins/vector/css/molecules/EventTile.css index aa8d26f5a..dc85d407c 100644 --- a/src/skins/vector/css/molecules/EventTile.css +++ b/src/skins/vector/css/molecules/EventTile.css @@ -62,10 +62,6 @@ limitations under the License. display: block; } -.mx_EventTile_notice .mx_MessageTile_content { - opacity: 0.5; -} - .mx_MessageTile_content { display: block; margin-right: 100px; diff --git a/src/skins/vector/css/molecules/MNoticeTile.css b/src/skins/vector/css/molecules/MNoticeTile.css index 0e9c3ca14..0a0db62ea 100644 --- a/src/skins/vector/css/molecules/MNoticeTile.css +++ b/src/skins/vector/css/molecules/MNoticeTile.css @@ -15,5 +15,5 @@ limitations under the License. */ .mx_MNoticeTile { - opacity: 0.5; + opacity: 0.6; } diff --git a/src/skins/vector/views/atoms/ImageView.js b/src/skins/vector/views/atoms/ImageView.js index 7ef0f750f..82471aa35 100644 --- a/src/skins/vector/views/atoms/ImageView.js +++ b/src/skins/vector/views/atoms/ImageView.js @@ -18,13 +18,11 @@ limitations under the License. var React = require('react'); -var ImageViewController = require('../../../../controllers/atoms/ImageView') var DateUtils = require('../../../../DateUtils'); var filesize = require('filesize'); module.exports = React.createClass({ displayName: 'ImageView', - mixins: [ImageViewController], // XXX: keyboard shortcuts for managing dialogs should be done by the modal dialog base class omehow, surely... componentDidMount: function() { diff --git a/src/skins/vector/views/atoms/MessageTimestamp.js b/src/skins/vector/views/atoms/MessageTimestamp.js index 71951f3a2..5795e5565 100644 --- a/src/skins/vector/views/atoms/MessageTimestamp.js +++ b/src/skins/vector/views/atoms/MessageTimestamp.js @@ -19,11 +19,8 @@ limitations under the License. var React = require('react'); var DateUtils = require('../../../../DateUtils'); -var MessageTimestampController = require('matrix-react-sdk/lib/controllers/atoms/MessageTimestamp') - module.exports = React.createClass({ displayName: 'MessageTimestamp', - mixins: [MessageTimestampController], render: function() { var date = new Date(this.props.ts); diff --git a/src/skins/vector/views/atoms/voip/VideoFeed.js b/src/skins/vector/views/atoms/voip/VideoFeed.js index 748a431a1..9cf28d1ba 100644 --- a/src/skins/vector/views/atoms/voip/VideoFeed.js +++ b/src/skins/vector/views/atoms/voip/VideoFeed.js @@ -18,11 +18,8 @@ limitations under the License. var React = require('react'); -var VideoFeedController = require('matrix-react-sdk/lib/controllers/atoms/voip/VideoFeed') - module.exports = React.createClass({ displayName: 'VideoFeed', - mixins: [VideoFeedController], render: function() { return ( diff --git a/src/skins/vector/views/molecules/EventAsTextTile.js b/src/skins/vector/views/molecules/EventAsTextTile.js index fe79dd3aa..db9df9f49 100644 --- a/src/skins/vector/views/molecules/EventAsTextTile.js +++ b/src/skins/vector/views/molecules/EventAsTextTile.js @@ -18,12 +18,11 @@ limitations under the License. var React = require('react'); -var EventAsTextTileController = require('matrix-react-sdk/lib/controllers/molecules/EventAsTextTile') +var sdk = require('matrix-react-sdk') var TextForEvent = require('matrix-react-sdk/lib/TextForEvent'); module.exports = React.createClass({ displayName: 'EventAsTextTile', - mixins: [EventAsTextTileController], statics: { needsSenderProfile: function() { diff --git a/src/skins/vector/views/molecules/MImageTile.js b/src/skins/vector/views/molecules/MImageTile.js index f55338302..0667dabd1 100644 --- a/src/skins/vector/views/molecules/MImageTile.js +++ b/src/skins/vector/views/molecules/MImageTile.js @@ -19,15 +19,12 @@ limitations under the License. var React = require('react'); var filesize = require('filesize'); -var MImageTileController = require('matrix-react-sdk/lib/controllers/molecules/MImageTile') - var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var Modal = require('matrix-react-sdk/lib/Modal'); var sdk = require('matrix-react-sdk') module.exports = React.createClass({ displayName: 'MImageTile', - mixins: [MImageTileController], thumbHeight: function(fullWidth, fullHeight, thumbWidth, thumbHeight) { if (!fullWidth || !fullHeight) { diff --git a/src/skins/vector/views/molecules/MRoomMemberTile.js b/src/skins/vector/views/molecules/MRoomMemberTile.js index 4e163e1d7..0048306d3 100644 --- a/src/skins/vector/views/molecules/MRoomMemberTile.js +++ b/src/skins/vector/views/molecules/MRoomMemberTile.js @@ -18,14 +18,11 @@ limitations under the License. var React = require('react'); -var MRoomMemberTileController = require('matrix-react-sdk/lib/controllers/molecules/MRoomMemberTile') - var sdk = require('matrix-react-sdk') var TextForEvent = require('matrix-react-sdk/lib/TextForEvent'); module.exports = React.createClass({ displayName: 'MRoomMemberTile', - mixins: [MRoomMemberTileController], getMemberEventText: function() { return TextForEvent.textForEvent(this.props.mxEvent); diff --git a/src/skins/vector/views/molecules/MatrixToolbar.js b/src/skins/vector/views/molecules/MatrixToolbar.js index 0b6c58e0d..4a299f141 100644 --- a/src/skins/vector/views/molecules/MatrixToolbar.js +++ b/src/skins/vector/views/molecules/MatrixToolbar.js @@ -20,11 +20,8 @@ var React = require('react'); var sdk = require('matrix-react-sdk') -var MatrixToolbarController = require('matrix-react-sdk/lib/controllers/molecules/MatrixToolbar') - module.exports = React.createClass({ displayName: 'MatrixToolbar', - mixins: [MatrixToolbarController], hideToolbar: function() { var Notifier = sdk.getComponent('organisms.Notifier'); diff --git a/src/skins/vector/views/molecules/SenderProfile.js b/src/skins/vector/views/molecules/SenderProfile.js index 8be3adf27..c09685aad 100644 --- a/src/skins/vector/views/molecules/SenderProfile.js +++ b/src/skins/vector/views/molecules/SenderProfile.js @@ -19,15 +19,12 @@ limitations under the License. var React = require('react'); var classNames = require("classnames"); -var SenderProfileController = require('matrix-react-sdk/lib/controllers/molecules/SenderProfile') - // The Lato WOFF doesn't include sensible combining diacritics, so Chrome chokes on rendering them. // Revert to Arial when this happens, which on OSX works at least. var zalgo = /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/; module.exports = React.createClass({ displayName: 'SenderProfile', - mixins: [SenderProfileController], render: function() { var mxEvent = this.props.mxEvent; diff --git a/src/skins/vector/views/molecules/UnknownMessageTile.js b/src/skins/vector/views/molecules/UnknownMessageTile.js index d5a20c878..e8cd322aa 100644 --- a/src/skins/vector/views/molecules/UnknownMessageTile.js +++ b/src/skins/vector/views/molecules/UnknownMessageTile.js @@ -18,11 +18,8 @@ limitations under the License. var React = require('react'); -var UnknownMessageTileController = require('matrix-react-sdk/lib/controllers/molecules/UnknownMessageTile') - module.exports = React.createClass({ displayName: 'UnknownMessageTile', - mixins: [UnknownMessageTileController], render: function() { var content = this.props.mxEvent.getContent(); diff --git a/src/skins/vector/views/molecules/voip/VideoView.js b/src/skins/vector/views/molecules/voip/VideoView.js index 2bac88699..9dff7cdf3 100644 --- a/src/skins/vector/views/molecules/voip/VideoView.js +++ b/src/skins/vector/views/molecules/voip/VideoView.js @@ -20,11 +20,9 @@ var React = require('react'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher') -var VideoViewController = require('matrix-react-sdk/lib/controllers/molecules/voip/VideoView') module.exports = React.createClass({ displayName: 'VideoView', - mixins: [VideoViewController], componentWillMount: function() { dis.register(this.onAction); diff --git a/src/skins/vector/views/organisms/Notifier.js b/src/skins/vector/views/organisms/Notifier.js index 8a9b2ffdb..b214b4cd1 100644 --- a/src/skins/vector/views/organisms/Notifier.js +++ b/src/skins/vector/views/organisms/Notifier.js @@ -66,7 +66,8 @@ var NotifierView = { title, { "body": msg, - "icon": avatarUrl + "icon": avatarUrl, + "tag": "vector" } ); diff --git a/src/skins/vector/views/organisms/RightPanel.js b/src/skins/vector/views/organisms/RightPanel.js index 43e793271..feebcfeba 100644 --- a/src/skins/vector/views/organisms/RightPanel.js +++ b/src/skins/vector/views/organisms/RightPanel.js @@ -84,6 +84,13 @@ module.exports = React.createClass({ }); } } + if (payload.action === "view_room") { + if (this.state.phase === this.Phase.MemberInfo) { + this.setState({ + phase: this.Phase.MemberList + }); + } + } }, render: function() { diff --git a/src/skins/vector/views/pages/MatrixChat.js b/src/skins/vector/views/pages/MatrixChat.js index e15584599..0cf754c23 100644 --- a/src/skins/vector/views/pages/MatrixChat.js +++ b/src/skins/vector/views/pages/MatrixChat.js @@ -25,7 +25,8 @@ var MatrixChatController = require('matrix-react-sdk/lib/controllers/pages/Matri var Loader = require("react-loader"); var dis = require('matrix-react-sdk/lib/dispatcher'); - +var Matrix = require("matrix-js-sdk"); +var ContextualMenu = require("../../../../ContextualMenu"); module.exports = React.createClass({ displayName: 'MatrixChat', @@ -46,6 +47,22 @@ module.exports = React.createClass({ window.removeEventListener('resize', this.handleResize); }, + onAliasClick: function(event, alias) { + event.preventDefault(); + dis.dispatch({action: 'view_room_alias', room_alias: alias}); + }, + + onUserClick: function(event, userId) { + event.preventDefault(); + var MemberInfo = sdk.getComponent('molecules.MemberInfo'); + var member = new Matrix.RoomMember(null, userId); + ContextualMenu.createMenu(MemberInfo, { + member: member, + right: window.innerWidth - event.pageX, + top: event.pageY + }); + }, + handleResize: function(e) { var hideLhsThreshold = 1000; var showLhsThreshold = 1000;