j-ClipboardImage
This component automaticaly captures images in Clipboard.
Configuration:
quality {Number}JPEG quality, (default:90)maxwidth {Number}a maximum width (default:1024)maxheight {Number}a maximum height (default:768)exec {String}a link to execute method if the image is obtaineddisabled {Boolean}can disable this componenttype {String}output type, supportspngorjpg(default)- NEW
output {String}output typebase64(default) orfile
How to capture data?
// Attach event
ON('clipboardimage', function(base64) {
// We have to send data on the server in Base64 format
AJAX('POST /upload/', { file: base64 }, function(response) {
});
});Use it with <ui-component name="clipboardimage">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="clipboardimage" config="quality:90"></ui-component>
<div>Create a screenshot into the clipboard and press shortcuts CMD+V or CTRL+V into the iFrame (iFrame has to be focused).</div>
<br />
<div id="output"></div>
<script>
ON('clipboardimage', function(base64) {
var img = new Image();
img.src = base64;
$('#output').empty().append(img);
});
</script>