|
|
|
@ -296,10 +296,6 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
@@ -296,10 +296,6 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
|
|
|
|
|
subscope.doCall = function() { |
|
|
|
|
mediaStream.webrtc.doCall(subscope.id); |
|
|
|
|
}; |
|
|
|
|
subscope.doUpload = function() { |
|
|
|
|
// TODO(longsleep): implement me
|
|
|
|
|
console.log("doUpload not yet implemented."); |
|
|
|
|
}; |
|
|
|
|
subscope.doClear = function() { |
|
|
|
|
subscope.$broadcast("clear"); |
|
|
|
|
}; |
|
|
|
@ -376,11 +372,8 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
@@ -376,11 +372,8 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Support drag and drop file uploads in Chat.
|
|
|
|
|
var namespace = "file_" + scope.id; |
|
|
|
|
var binder = fileUpload.bindDrop(namespace, clonedElement, _.bind(function(files) { |
|
|
|
|
console.log("File dragged", files); |
|
|
|
|
_.each(files, _.bind(function(f) { |
|
|
|
|
var sendFiles = function(files) { |
|
|
|
|
_.each(files, function(f) { |
|
|
|
|
var info = $.extend({ |
|
|
|
|
id: f.id |
|
|
|
|
}, f.info); |
|
|
|
@ -388,9 +381,20 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
@@ -388,9 +381,20 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
|
|
|
|
|
$scope.sendChat(subscope.id, "File", { |
|
|
|
|
FileInfo: info |
|
|
|
|
}); |
|
|
|
|
}, this)); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// Support drag and drop file uploads in Chat.
|
|
|
|
|
var namespace = "file_" + scope.id; |
|
|
|
|
var binderDrop = fileUpload.bindDrop(namespace, clonedElement, _.bind(function(files) { |
|
|
|
|
console.log("File dragged", files); |
|
|
|
|
sendFiles(files); |
|
|
|
|
}, this)); |
|
|
|
|
var binderClick = fileUpload.bindClick(namespace, $(".btn-fileupload", clonedElement), _.bind(function(files) { |
|
|
|
|
console.log("Click found files", files); |
|
|
|
|
sendFiles(files); |
|
|
|
|
}, this)); |
|
|
|
|
binder.namespace = function() { |
|
|
|
|
binderDrop.namespace = binderClick.namespace = function() { |
|
|
|
|
// Inject own id into namespace.
|
|
|
|
|
return namespace + "_" + scope.myid; |
|
|
|
|
}; |
|
|
|
|