summary refs log tree commit diff
path: root/webclient/room
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-13 11:42:28 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-13 11:42:28 +0200
commitc87e1f641858fbc2e6ed6b99ef05591a977bd4c4 (patch)
tree4c49891e7d919bf99ba603a98c2d837f3c667810 /webclient/room
parentDisplay image messages from the stream (diff)
downloadsynapse-c87e1f641858fbc2e6ed6b99ef05591a977bd4c4.tar.xz
Room: Added a text input to type an image URL in order to send an image message
Diffstat (limited to '')
-rw-r--r--webclient/room/room-controller.js13
-rw-r--r--webclient/room/room.html12
2 files changed, 24 insertions, 1 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index 7cb6cba650..cbd5c1a175 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -27,7 +27,8 @@ angular.module('RoomController', [])
     $scope.messages = [];
     $scope.members = {};
     $scope.stopPoll = false;
-    
+
+    $scope.imageURLToSend = "";
     $scope.userIDToInvite = "";
 
     var shortPoll = function() {
@@ -224,6 +225,16 @@ angular.module('RoomController', [])
             });
     };
 
+    $scope.sendImage = function(url) {
+        matrixService.sendImageMessage($scope.room_id, url).then(
+            function() {
+                console.log("Image sent");
+            },
+            function(reason) {
+                $scope.feedback = "Failed to send image: " + reason;
+            });
+    };
+
     $scope.$on('$destroy', function(e) {
         console.log("onDestroyed: Stopping poll.");
         $scope.stopPoll = true;
diff --git a/webclient/room/room.html b/webclient/room/room.html
index 600bc14eb8..9cd1ec3645 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -63,6 +63,18 @@
                         {{ feedback }}
                     </td>
                 </tr>
+                <tr>
+                    <td>
+                    </td>
+                    <td>
+                        <input class="mainInput" ng-model="imageURLToSend" ng-enter="sendImage()" placeholder="Image URL"/>
+                    </td>
+                    <td  width="100px">
+                        <button ng-click="sendImage(imageURLToSend)">Send Image</button>
+                    </td>
+                    <td>
+                    </td>
+                </tr>
             </table>
 
             <span>