forked from MirrorHub/synapse
Replaced the image URL text input by a file selector button: "Send Image"
This commit is contained in:
parent
955662d64c
commit
d6a3639269
2 changed files with 5 additions and 18 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue