forked from matrix/element-web
Make 'view source' work
This commit is contained in:
parent
4b904d90f2
commit
e3e49daddb
|
@ -0,0 +1,3 @@
|
||||||
|
.mx_ViewSource pre {
|
||||||
|
text-align: left;
|
||||||
|
}
|
|
@ -80,6 +80,7 @@ skin['organisms.RoomDirectory'] = require('./views/organisms/RoomDirectory');
|
||||||
skin['organisms.RoomList'] = require('./views/organisms/RoomList');
|
skin['organisms.RoomList'] = require('./views/organisms/RoomList');
|
||||||
skin['organisms.RoomView'] = require('./views/organisms/RoomView');
|
skin['organisms.RoomView'] = require('./views/organisms/RoomView');
|
||||||
skin['organisms.UserSettings'] = require('./views/organisms/UserSettings');
|
skin['organisms.UserSettings'] = require('./views/organisms/UserSettings');
|
||||||
|
skin['organisms.ViewSource'] = require('./views/organisms/ViewSource');
|
||||||
skin['pages.MatrixChat'] = require('./views/pages/MatrixChat');
|
skin['pages.MatrixChat'] = require('./views/pages/MatrixChat');
|
||||||
skin['templates.Login'] = require('./views/templates/Login');
|
skin['templates.Login'] = require('./views/templates/Login');
|
||||||
skin['templates.Register'] = require('./views/templates/Register');
|
skin['templates.Register'] = require('./views/templates/Register');
|
||||||
|
|
|
@ -20,6 +20,8 @@ var React = require('react');
|
||||||
|
|
||||||
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
||||||
var dis = require('matrix-react-sdk/lib/dispatcher');
|
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({
|
module.exports = React.createClass({
|
||||||
displayName: 'MessageContextMenu',
|
displayName: 'MessageContextMenu',
|
||||||
|
@ -43,6 +45,11 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onViewSourceClick: function() {
|
onViewSourceClick: function() {
|
||||||
|
var ViewSource = sdk.getComponent('organisms.ViewSource');
|
||||||
|
Modal.createDialog(ViewSource, {
|
||||||
|
mxEvent: this.props.mxEvent
|
||||||
|
});
|
||||||
|
if (this.props.onFinished) this.props.onFinished();
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
|
@ -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 (
|
||||||
|
<div className="mx_ViewSource">
|
||||||
|
<pre>
|
||||||
|
{JSON.stringify(this.props.mxEvent.event, null, 2)}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue