+ );
+ }
+});
+
diff --git a/src/controllers/atoms/LogoutButton.js b/src/components/views/voip/VideoFeed.js
similarity index 74%
rename from src/controllers/atoms/LogoutButton.js
rename to src/components/views/voip/VideoFeed.js
index 87cf814801..9cf28d1ba4 100644
--- a/src/controllers/atoms/LogoutButton.js
+++ b/src/components/views/voip/VideoFeed.js
@@ -16,12 +16,16 @@ limitations under the License.
'use strict';
-var dis = require("../../dispatcher");
+var React = require('react');
-module.exports = {
- onClick: function() {
- dis.dispatch({
- action: 'logout'
- });
+module.exports = React.createClass({
+ displayName: 'VideoFeed',
+
+ render: function() {
+ return (
+
+ );
},
-};
+});
+
diff --git a/src/components/views/voip/VideoView.js b/src/components/views/voip/VideoView.js
new file mode 100644
index 0000000000..0a95e0d0c8
--- /dev/null
+++ b/src/components/views/voip/VideoView.js
@@ -0,0 +1,93 @@
+/*
+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');
+var ReactDOM = require('react-dom');
+
+var sdk = require('../../../index');
+var dis = require('../../../dispatcher');
+
+module.exports = React.createClass({
+ displayName: 'VideoView',
+
+ componentWillMount: function() {
+ dis.register(this.onAction);
+ },
+
+ getRemoteVideoElement: function() {
+ return ReactDOM.findDOMNode(this.refs.remote);
+ },
+
+ getRemoteAudioElement: function() {
+ return this.refs.remoteAudio;
+ },
+
+ getLocalVideoElement: function() {
+ return ReactDOM.findDOMNode(this.refs.local);
+ },
+
+ setContainer: function(c) {
+ this.container = c;
+ },
+
+ onAction: function(payload) {
+ switch (payload.action) {
+ case 'video_fullscreen':
+ if (!this.container) {
+ return;
+ }
+ var element = this.container;
+ if (payload.fullscreen) {
+ var requestMethod = (
+ element.requestFullScreen ||
+ element.webkitRequestFullScreen ||
+ element.mozRequestFullScreen ||
+ element.msRequestFullscreen
+ );
+ requestMethod.call(element);
+ }
+ else {
+ var exitMethod = (
+ document.exitFullscreen ||
+ document.mozCancelFullScreen ||
+ document.webkitExitFullscreen ||
+ document.msExitFullscreen
+ );
+ if (exitMethod) {
+ exitMethod.call(document);
+ }
+ }
+ break;
+ }
+ },
+
+ render: function() {
+ var VideoFeed = sdk.getComponent('voip.VideoFeed');
+ return (
+
+
+
+
+
+
+
+
+
+ );
+ }
+});
diff --git a/src/controllers/atoms/create_room/RoomAlias.js b/src/controllers/atoms/create_room/RoomAlias.js
deleted file mode 100644
index b1176a2ab5..0000000000
--- a/src/controllers/atoms/create_room/RoomAlias.js
+++ /dev/null
@@ -1,47 +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.
-*/
-
-var React = require('react');
-
-module.exports = {
- propTypes: {
- // Specifying a homeserver will make magical things happen when you,
- // e.g. start typing in the room alias box.
- homeserver: React.PropTypes.string,
- alias: React.PropTypes.string,
- onChange: React.PropTypes.func,
- },
-
- getDefaultProps: function() {
- return {
- onChange: function() {},
- alias: '',
- };
- },
-
- getAliasLocalpart: function() {
- var room_alias = this.props.alias;
-
- if (room_alias && this.props.homeserver) {
- var suffix = ":" + this.props.homeserver;
- if (room_alias.startsWith("#") && room_alias.endsWith(suffix)) {
- room_alias = room_alias.slice(1, -suffix.length);
- }
- }
-
- return room_alias;
- },
-};
diff --git a/src/controllers/atoms/create_room/RoomNameTextbox.js b/src/controllers/atoms/create_room/RoomNameTextbox.js
deleted file mode 100644
index e78692d992..0000000000
--- a/src/controllers/atoms/create_room/RoomNameTextbox.js
+++ /dev/null
@@ -1,41 +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';
-
-var React = require('react');
-
-module.exports = {
- propTypes: {
- default_name: React.PropTypes.string
- },
-
- getDefaultProps: function() {
- return {
- default_name: '',
- };
- },
-
- getInitialState: function() {
- return {
- room_name: this.props.default_name,
- }
- },
-
- getName: function() {
- return this.state.room_name;
- },
-};
diff --git a/src/controllers/molecules/MemberInfo.js b/src/controllers/molecules/MemberInfo.js
index d822a87f48..913e36a4ce 100644
--- a/src/controllers/molecules/MemberInfo.js
+++ b/src/controllers/molecules/MemberInfo.js
@@ -228,7 +228,7 @@ module.exports = {
var d = MatrixClientPeg.get().leave(roomId);
// FIXME: controller shouldn't be loading a view :(
- var Loader = sdk.getComponent("atoms.Spinner");
+ var Loader = sdk.getComponent("elements.Spinner");
var modal = Modal.createDialog(Loader);
d.then(function() {
diff --git a/src/controllers/molecules/MemberTile.js b/src/controllers/molecules/MemberTile.js
index 222ebca145..057bc82497 100644
--- a/src/controllers/molecules/MemberTile.js
+++ b/src/controllers/molecules/MemberTile.js
@@ -39,7 +39,7 @@ module.exports = {
var d = MatrixClientPeg.get().leave(roomId);
// FIXME: controller shouldn't be loading a view :(
- var Loader = sdk.getComponent("atoms.Spinner");
+ var Loader = sdk.getComponent("elements.Spinner");
var modal = Modal.createDialog(Loader);
d.then(function() {
diff --git a/src/controllers/molecules/voip/IncomingCallBox.js b/src/controllers/molecules/voip/IncomingCallBox.js
deleted file mode 100644
index 9ecced56c5..0000000000
--- a/src/controllers/molecules/voip/IncomingCallBox.js
+++ /dev/null
@@ -1,73 +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.
-*/
-
-var dis = require("../../../dispatcher");
-var CallHandler = require("../../../CallHandler");
-
-module.exports = {
- componentDidMount: function() {
- this.dispatcherRef = dis.register(this.onAction);
- },
-
- componentWillUnmount: function() {
- dis.unregister(this.dispatcherRef);
- },
-
- getInitialState: function() {
- return {
- incomingCall: null
- }
- },
-
- onAction: function(payload) {
- if (payload.action !== 'call_state') {
- return;
- }
- var call = CallHandler.getCall(payload.room_id);
- if (!call || call.call_state !== 'ringing') {
- this.setState({
- incomingCall: null,
- });
- this.getRingAudio().pause();
- return;
- }
- if (call.call_state === "ringing") {
- this.getRingAudio().load();
- this.getRingAudio().play();
- }
- else {
- this.getRingAudio().pause();
- }
-
- this.setState({
- incomingCall: call
- });
- },
-
- onAnswerClick: function() {
- dis.dispatch({
- action: 'answer',
- room_id: this.state.incomingCall.roomId
- });
- },
- onRejectClick: function() {
- dis.dispatch({
- action: 'hangup',
- room_id: this.state.incomingCall.roomId
- });
- }
-};
-
diff --git a/src/controllers/organisms/CreateRoom.js b/src/controllers/organisms/CreateRoom.js
index 3c48e43f74..b39b734480 100644
--- a/src/controllers/organisms/CreateRoom.js
+++ b/src/controllers/organisms/CreateRoom.js
@@ -18,7 +18,11 @@ limitations under the License.
var React = require("react");
var MatrixClientPeg = require("../../MatrixClientPeg");
-var PresetValues = require('../atoms/create_room/Presets').Presets;
+var PresetValues = {
+ PrivateChat: "private_chat",
+ PublicChat: "public_chat",
+ Custom: "custom",
+};
var q = require('q');
var encryption = require("../../encryption");