File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ . mx_ViewSource pre {
2+ text-align : left;
3+ }
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ skin['organisms.RoomDirectory'] = require('./views/organisms/RoomDirectory');
8080skin [ 'organisms.RoomList' ] = require ( './views/organisms/RoomList' ) ;
8181skin [ 'organisms.RoomView' ] = require ( './views/organisms/RoomView' ) ;
8282skin [ 'organisms.UserSettings' ] = require ( './views/organisms/UserSettings' ) ;
83+ skin [ 'organisms.ViewSource' ] = require ( './views/organisms/ViewSource' ) ;
8384skin [ 'pages.MatrixChat' ] = require ( './views/pages/MatrixChat' ) ;
8485skin [ 'templates.Login' ] = require ( './views/templates/Login' ) ;
8586skin [ 'templates.Register' ] = require ( './views/templates/Register' ) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ var React = require('react');
2020
2121var MatrixClientPeg = require ( 'matrix-react-sdk/lib/MatrixClientPeg' ) ;
2222var dis = require ( 'matrix-react-sdk/lib/dispatcher' ) ;
23+ var sdk = require ( 'matrix-react-sdk' )
24+ var Modal = require ( 'matrix-react-sdk/lib/Modal' ) ;
2325
2426module . exports = React . createClass ( {
2527 displayName : 'MessageContextMenu' ,
@@ -43,6 +45,11 @@ module.exports = React.createClass({
4345 } ,
4446
4547 onViewSourceClick : function ( ) {
48+ var ViewSource = sdk . getComponent ( 'organisms.ViewSource' ) ;
49+ Modal . createDialog ( ViewSource , {
50+ mxEvent : this . props . mxEvent
51+ } ) ;
52+ if ( this . props . onFinished ) this . props . onFinished ( ) ;
4653 } ,
4754
4855 render : function ( ) {
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2015 OpenMarket Ltd
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
17+ 'use strict' ;
18+
19+ var React = require ( 'react' ) ;
20+
21+ module . exports = React . createClass ( {
22+ displayName : 'ViewSource' ,
23+
24+ render : function ( ) {
25+ return (
26+ < div className = "mx_ViewSource" >
27+ < pre >
28+ { JSON . stringify ( this . props . mxEvent . event , null , 2 ) }
29+ </ pre >
30+ </ div >
31+ ) ;
32+ }
33+ } ) ;
34+
You can’t perform that action at this time.
0 commit comments