ForgeKomponenty
pl

Komponenty

j-ClipboardImage

jComponent 20 · jcomponent@20 component Przykład załadowany z jComponent 20

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 uzyskany
  • disabled {Boolean} może wyłączyć ten składnik
  • Typ wyjścia type {String}, obsługuje png lub jpg (default)
  • NEW output {String} rodzaj wyjścia base64 (default) lub file

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.

example.html
<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>