|
|
|
@ -70,12 +70,7 @@ weechat.directive('inputBar', function() { |
|
|
|
|
}, 0); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$scope.uploadImage = function($event, files) { |
|
|
|
|
// Send image url after upload
|
|
|
|
|
var sendImageUrl = function(imageUrl) { |
|
|
|
|
|
|
|
|
|
// Send image
|
|
|
|
|
if(imageUrl !== undefined && imageUrl !== '') { |
|
|
|
|
$rootScope.insertAtCaret = function(toInsert) { |
|
|
|
|
// caret position in the input bar
|
|
|
|
|
var inputNode = $scope.getInputNode(), |
|
|
|
|
caretPos = inputNode.selectionStart; |
|
|
|
@ -89,7 +84,7 @@ weechat.directive('inputBar', function() { |
|
|
|
|
if (suffix.length > 0 && suffix[0] !== ' ') { |
|
|
|
|
suffix = ' '.concat(suffix); |
|
|
|
|
} |
|
|
|
|
$scope.command = prefix + String(imageUrl) + suffix; |
|
|
|
|
$scope.command = prefix + toInsert + suffix; |
|
|
|
|
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
inputNode.focus(); |
|
|
|
@ -98,8 +93,15 @@ weechat.directive('inputBar', function() { |
|
|
|
|
// force refresh?
|
|
|
|
|
$scope.$apply(); |
|
|
|
|
}, 0); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$scope.uploadImage = function($event, files) { |
|
|
|
|
// Send image url after upload
|
|
|
|
|
var sendImageUrl = function(imageUrl) { |
|
|
|
|
// Send image
|
|
|
|
|
if(imageUrl !== undefined && imageUrl !== '') { |
|
|
|
|
$rootScope.insertAtCaret(String(imageUrl)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if(typeof files !== "undefined" && files.length > 0) { |
|
|
|
|