mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 20:24:56 -04:00
Added another button to upload and send an image.
The text input and its send button for sending an image URL will be removed once we have a true upload image service
This commit is contained in:
parent
39ff6c840f
commit
d5bebc9eaa
2 changed files with 20 additions and 2 deletions
|
@ -402,6 +402,23 @@ angular.module('RoomController', ['ngSanitize'])
|
|||
});
|
||||
};
|
||||
|
||||
$scope.imageFileToSend;
|
||||
$scope.$watch("imageFileToSend", function(newValue, oldValue) {
|
||||
if ($scope.imageFileToSend) {
|
||||
// First download the image to the Internet
|
||||
console.log("Uploading image...");
|
||||
mFileUpload.uploadFile($scope.imageFileToSend).then(
|
||||
function(url) {
|
||||
// Then share the URL
|
||||
$scope.sendImage(url);
|
||||
},
|
||||
function(error) {
|
||||
$scope.feedback = "Can't upload image";
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.loadMoreHistory = function() {
|
||||
paginate(MESSAGES_PER_PAGINATION);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue