Added Copy functionality with CTRL-C. Still very rough.

This commit is contained in:
Gunther Brunner
2014-05-27 17:42:27 +09:00
parent bde6d9f311
commit daa7677218
4 changed files with 56 additions and 25 deletions

View File

@@ -3,6 +3,8 @@ module.exports = function ControlServiceFactory(
, $http
, socket
, TransactionService
, $rootScope
, gettext
) {
var controlService = {
}
@@ -100,6 +102,24 @@ module.exports = function ControlServiceFactory(
return sendTwoWay('clipboard.copy')
}
//@TODO: Refactor this please
var that = this
this.getClipboardContent = function () {
that.copy().then(function (result) {
$rootScope.$apply(function () {
if (result.success) {
if (result.lastData) {
that.clipboardContent = result.lastData
} else {
that.clipboardContent = gettext('No clipboard data')
}
} else {
that.clipboardContent = gettext('Error while getting data')
}
})
})
}
this.shell = function(command) {
return sendTwoWay('shell.command', {
command: command