summary refs log tree commit diff
path: root/webclient/room
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-20 14:09:55 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-20 14:09:55 +0200
commitd6a3639269e4beb3f59ff04681801a1d6726965b (patch)
tree9824ec41eec10dbfe59f33d9c3d1a1aaed0371aa /webclient/room
parentDisabled sending buttons while a message is being sent. Useful on bad Interne... (diff)
downloadsynapse-d6a3639269e4beb3f59ff04681801a1d6726965b.tar.xz
Replaced the image URL text input by a file selector button: "Send Image"
Diffstat (limited to '')
-rw-r--r--webclient/room/room-controller.js5
-rw-r--r--webclient/room/room.html18
2 files changed, 5 insertions, 18 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index 2fa7fe34b1..ca6d3d4a3a 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'])
-.controller('RoomController', ['$scope', '$http', '$timeout', '$routeParams', '$location', 'matrixService', 'eventStreamService', 'eventHandlerService',
-                               function($scope, $http, $timeout, $routeParams, $location, matrixService, eventStreamService, eventHandlerService) {
+.controller('RoomController', ['$scope', '$http', '$timeout', '$routeParams', '$location', 'matrixService', 'eventStreamService', 'eventHandlerService', 'mFileUpload',
+                               function($scope, $http, $timeout, $routeParams, $location, matrixService, eventStreamService, eventHandlerService, mFileUpload) {
    'use strict';
     var MESSAGES_PER_PAGINATION = 30;
 
@@ -372,6 +372,7 @@ angular.module('RoomController', ['ngSanitize'])
         matrixService.sendImageMessage($scope.room_id, url).then(
             function() {
                 console.log("Image sent");
+                $scope.state.sending = false;
             },
             function(error) {
                 $scope.feedback = "Failed to send image: " + error.data.error;
diff --git a/webclient/room/room.html b/webclient/room/room.html
index 1ca28b20fe..99b0bf681b 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -65,28 +65,14 @@
                     <td width="*" style="min-width: 100px">
                         <input id="mainInput" ng-model="textInput" ng-enter="send()" ng-disabled="state.sending" ng-focus="true" auto-complete/>
                     </td>
-                    <td width="1">
+                    <td width="150px">
                         <button ng-click="send()" ng-disabled="state.sending">Send</button>
+                        <button m-file-input="imageFileToSend">Send Image</button>
                     </td>
                     <td width="1">
                         
                     </td>
                 </tr>
-                <tr>
-                    <td>
-                    </td>
-                    <td>
-                        <input id="mainInput" ng-model="imageURLToSend" ng-enter="sendImage(imageURLToSend)" placeholder="Image URL"/>
-                    </td>
-                    <td width="100px">
-                        <button ng-click="sendImage(imageURLToSend)" ng-disabled="state.sending">Send URL</button>
-                    </td>
-                    <!-- TODO: To enable once we have an upload server
-                    <td width="100px">
-                        <button m-file-input="imageFileToSend">Send Image</button>
-                    </td>
-                    -->
-                </tr>
             </table>
 
             <span>