diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index f068c74e..ab427de0 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -55,7 +55,7 @@ module.exports = React.createClass({ ).done(function() { if (self.props.onFinished) self.props.onFinished(); }, function(e) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); // display error message stating you couldn't delete this. var code = e.errcode || e.statusCode; Modal.createDialog(ErrorDialog, { diff --git a/src/components/views/login/ServerConfig.js b/src/components/views/login/ServerConfig.js index 8f1eab38..2efed6b4 100644 --- a/src/components/views/login/ServerConfig.js +++ b/src/components/views/login/ServerConfig.js @@ -93,7 +93,7 @@ module.exports = React.createClass({ }, showHelpPopup: function() { - var ErrorDialog = sdk.getComponent('organisms.ErrorDialog'); + var ErrorDialog = sdk.getComponent('dialogs.ErrorDialog'); Modal.createDialog(ErrorDialog, { title: 'Custom Server Options', description: diff --git a/src/components/views/rooms/RoomDNDView.js b/src/components/views/rooms/RoomDNDView.js index 2729e15b..7b706b6d 100644 --- a/src/components/views/rooms/RoomDNDView.js +++ b/src/components/views/rooms/RoomDNDView.js @@ -77,7 +77,7 @@ var roomTileSource = { MatrixClientPeg.get().deleteRoomTag(item.room.roomId, item.originalList.props.tagName).finally(function() { //component.state.set({ spinner: component.state.spinner-- }); }).fail(function(err) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to remove tag " + item.originalList.props.tagName + " from room", description: err.toString() @@ -96,7 +96,7 @@ var roomTileSource = { MatrixClientPeg.get().setRoomTag(item.room.roomId, item.targetList.props.tagName, newOrder).finally(function() { //component.state.set({ spinner: component.state.spinner-- }); }).fail(function(err) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to add tag " + item.targetList.props.tagName + " to room", description: err.toString() diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index 40564e55..f3125bcb 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -413,7 +413,7 @@ module.exports = { upload: undefined }); }).done(undefined, function(error) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to upload file", description: error.toString() @@ -484,7 +484,7 @@ module.exports = { searchScope: scope, }); }, function(error) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Search failed", description: error.toString() @@ -664,7 +664,7 @@ module.exports = { if (deferreds.length) { var self = this; q.all(deferreds).fail(function(err) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to set state", description: err.toString() diff --git a/src/skins/vector/skindex.js b/src/skins/vector/skindex.js index 859641fb..95680a8b 100644 --- a/src/skins/vector/skindex.js +++ b/src/skins/vector/skindex.js @@ -70,6 +70,8 @@ skin['voip.IncomingCallBox'] = require('matrix-react-sdk/lib/components/views/vo skin['voip.VideoView'] = require('matrix-react-sdk/lib/components/views/voip/VideoView'); skin['voip.VideoFeed'] = require('matrix-react-sdk/lib/components/views/voip/VideoFeed'); +skin['dialogs.QuestionDialog'] = require('matrix-react-sdk/lib/components/views/dialogs/QuestionDialog'); +skin['dialogs.ErrorDialog'] = require('matrix-react-sdk/lib/components/views/dialogs/ErrorDialog'); // Old style stuff @@ -83,12 +85,10 @@ 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.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'); diff --git a/src/skins/vector/views/molecules/MessageContextMenu.js b/src/skins/vector/views/molecules/MessageContextMenu.js index b36d4ccb..337352d2 100644 --- a/src/skins/vector/views/molecules/MessageContextMenu.js +++ b/src/skins/vector/views/molecules/MessageContextMenu.js @@ -46,7 +46,7 @@ module.exports = React.createClass({ ).done(function() { // message should disappear by itself }, function(e) { - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); // display error message stating you couldn't delete this. var code = e.errcode || e.statusCode; Modal.createDialog(ErrorDialog, { diff --git a/src/skins/vector/views/organisms/ErrorDialog.js b/src/skins/vector/views/organisms/ErrorDialog.js deleted file mode 100644 index 992ea050..00000000 --- a/src/skins/vector/views/organisms/ErrorDialog.js +++ /dev/null @@ -1,54 +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'; - -/* - * Usage: - * Modal.createDialog(ErrorDialog, { - * title: "some text", (default: "Error") - * description: "some more text", - * button: "Button Text", - * onClose: someFunction, - * focus: true|false (default: true) - * }); - */ - -var React = require('react'); -var ErrorDialogController = require('matrix-react-sdk/lib/controllers/organisms/ErrorDialog') - -module.exports = React.createClass({ - displayName: 'ErrorDialog', - mixins: [ErrorDialogController], - - render: function() { - return ( -
-
- {this.props.title} -
-
- {this.props.description} -
-
- -
-
- ); - } -}); diff --git a/src/skins/vector/views/organisms/QuestionDialog.js b/src/skins/vector/views/organisms/QuestionDialog.js deleted file mode 100644 index 3941b1f9..00000000 --- a/src/skins/vector/views/organisms/QuestionDialog.js +++ /dev/null @@ -1,66 +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'; - -/* - * Usage: - * Modal.createDialog(ErrorDialog, { - * title: "some text", (default: "Error") - * description: "some more text", - * button: "Button Text", - * onClose: someFunction, - * focus: true|false (default: true) - * }); - */ - -var React = require('react'); -var QuestionDialogController = require('matrix-react-sdk/lib/controllers/organisms/QuestionDialog') - -module.exports = React.createClass({ - displayName: 'QuestionDialog', - mixins: [QuestionDialogController], - - onOk: function() { - this.props.onFinished(true); - }, - - onCancel: function() { - this.props.onFinished(false); - }, - - render: function() { - return ( -
-
- {this.props.title} -
-
- {this.props.description} -
-
- - - -
-
- ); - } -}); diff --git a/src/skins/vector/views/organisms/RoomDirectory.js b/src/skins/vector/views/organisms/RoomDirectory.js index 91cd69b5..c1a29779 100644 --- a/src/skins/vector/views/organisms/RoomDirectory.js +++ b/src/skins/vector/views/organisms/RoomDirectory.js @@ -40,7 +40,7 @@ module.exports = React.createClass({ if (err) { self.setState({ loading: false }); console.error("Failed to get publicRooms: %s", JSON.stringify(err)); - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to get public room list", description: err.message @@ -67,7 +67,7 @@ module.exports = React.createClass({ }); }, function(err) { console.error("Failed to join room: %s", JSON.stringify(err)); - var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to join room", description: err.message