Commit ced13908 authored by Thimo Kraemer's avatar Thimo Kraemer

Added action copyToClipboard

parent 9bc3a0db
Pipeline #4 failed with stages
/*
* KSS-RPC v0.26-beta
* KSS-RPC v0.27-beta
*
* Copyright (c) 2017, joonis new media
* Author: Thimo Kraemer <thimo.kraemer@joonis.de>
......@@ -61,7 +61,7 @@
******************************************************************************************/
var kss = {
version: '0.26-beta',
version: '0.27-beta',
_initialized: false,
_ruleSheets: {},
_nodeRegister: {},
......@@ -2435,6 +2435,18 @@ kss.getCookie = function(name) {
return null;
}
kss.copyToClipboard = function(node) {
var el = document.createElement('textarea');
el.value = node.innerText;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}
/*******************************************************************************************
* KSS Action Providers
......@@ -2552,6 +2564,9 @@ kss.registerActionProvider({
blur: function(node, params) {
kss.blur(node);
},
copyToClipboard: function(node, params) {
kss.copyToClipboard(node);
},
// Debugging helpers
alert: function(node, params) {
alert(params.message);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment