j-ClipboardImage
Ten element automatycznie rejestruje obrazy w Clipboard.
Konfiguracja:
- Jakość
quality {Number}JPEG (default:90) maxwidth {Number}maksymalna szerokość (default:1024)- Maksymalna wysokość
maxheight {Number}(default:768) exec {String}link do wykonania metody, jeśli obraz jest uzyskanydisabled {Boolean}może wyłączyć ten składnik- Typ wyjścia
type {String}, obsługujepnglubjpg(default) - NEW
output {String}rodzaj wyjściabase64(default) lubfile
Jak złapać dane?
// Attach event
ON('clipboardimage', function(base64) {
// We have to send data on the server in Base64 format
AJAX('POST /upload/', { file: base64 }, function(response) {
});
});Użyj go z <ui-component name="clipboardimage">Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu DEF.fallback (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.
<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>