new send-tab

This commit is contained in:
Sebastiaan Pasma 2018-07-09 18:22:11 +02:00
commit 1ee95cf262
16 changed files with 907 additions and 17 deletions

View file

@ -17,7 +17,27 @@ angular.module('copayApp.services').factory('clipboardService', function ($http,
// No supported
return;
}
};
root.readFromClipboard = function (cb) {
$log.debug("Read from clipboard");
if (platformInfo.isCordova) {
cordova.plugins.clipboard.paste(function(text) {
cb(text);
})
} else if (platformInfo.isNW) {
cb(nodeWebkitService.readFromClipboard());
} else {
navigator.clipboard.readText()
.then(text => {
cb(text);
})
.catch(err => {
$log.debug("Clipboard reading is not supported in browser..");
});
return;
}
};
return root;