summary refs log tree commit diff
path: root/webclient/room/room-controller.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-10-27 16:28:33 +0000
committerKegan Dougal <kegan@matrix.org>2014-10-27 16:30:07 +0000
commitda87990bd6e23380cdd5b46809fb80fb619f988c (patch)
treeace633136a65156b8f24e3554fbaa1ef068fbeeb /webclient/room/room-controller.js
parentHandleRoomMember: handle correctly prev_content (diff)
downloadsynapse-da87990bd6e23380cdd5b46809fb80fb619f988c.tar.xz
Implement SYWEB-121 : Display JSON when clicking messages.
JSON is displayed as a modal dialog via AngularJS' bootstrap module,
"ui.bootstrap".
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r--webclient/room/room-controller.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index a1d2e87039..e6149989ea 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -15,8 +15,8 @@ limitations under the License.
 */
 
 angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
-.controller('RoomController', ['$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall',
-                               function($filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall) {
+.controller('RoomController', ['$modal', '$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall',
+                               function($modal, $filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall) {
    'use strict';
     var MESSAGES_PER_PAGINATION = 30;
     var THUMBNAIL_SIZE = 320;
@@ -982,4 +982,11 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
         }
     };
 
+    $scope.openJson = function(content) {
+        console.log("Displaying modal dialog for " + JSON.stringify(content));
+        var modalInstance = $modal.open({
+            template: "<pre>" + angular.toJson(content, true) + "</pre>"
+        });
+    };
+
 }]);