diff --git a/src/skins/vector/css/organisms/ViewSource.css b/src/skins/vector/css/organisms/ViewSource.css new file mode 100644 index 00000000..ae61ae58 --- /dev/null +++ b/src/skins/vector/css/organisms/ViewSource.css @@ -0,0 +1,3 @@ +.mx_ViewSource pre { + text-align: left; +} diff --git a/src/skins/vector/skindex.js b/src/skins/vector/skindex.js index c2cd9611..7cd83618 100644 --- a/src/skins/vector/skindex.js +++ b/src/skins/vector/skindex.js @@ -80,6 +80,7 @@ skin['organisms.RoomDirectory'] = require('./views/organisms/RoomDirectory'); skin['organisms.RoomList'] = require('./views/organisms/RoomList'); skin['organisms.RoomView'] = require('./views/organisms/RoomView'); skin['organisms.UserSettings'] = require('./views/organisms/UserSettings'); +skin['organisms.ViewSource'] = require('./views/organisms/ViewSource'); skin['pages.MatrixChat'] = require('./views/pages/MatrixChat'); skin['templates.Login'] = require('./views/templates/Login'); skin['templates.Register'] = require('./views/templates/Register'); diff --git a/src/skins/vector/views/molecules/MessageContextMenu.js b/src/skins/vector/views/molecules/MessageContextMenu.js index adb8d10f..66f1d6d4 100644 --- a/src/skins/vector/views/molecules/MessageContextMenu.js +++ b/src/skins/vector/views/molecules/MessageContextMenu.js @@ -20,6 +20,8 @@ var React = require('react'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var dis = require('matrix-react-sdk/lib/dispatcher'); +var sdk = require('matrix-react-sdk') +var Modal = require('matrix-react-sdk/lib/Modal'); module.exports = React.createClass({ displayName: 'MessageContextMenu', @@ -43,6 +45,11 @@ module.exports = React.createClass({ }, onViewSourceClick: function() { + var ViewSource = sdk.getComponent('organisms.ViewSource'); + Modal.createDialog(ViewSource, { + mxEvent: this.props.mxEvent + }); + if (this.props.onFinished) this.props.onFinished(); }, render: function() { diff --git a/src/skins/vector/views/organisms/ViewSource.js b/src/skins/vector/views/organisms/ViewSource.js new file mode 100644 index 00000000..a00cfc85 --- /dev/null +++ b/src/skins/vector/views/organisms/ViewSource.js @@ -0,0 +1,34 @@ +/* +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: 'ViewSource', + + render: function() { + return ( +
+
+                    {JSON.stringify(this.props.mxEvent.event, null, 2)}
+                
+
+ ); + } +}); +