mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Added Copy functionality with CTRL-C. Still very rough.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user