# j-ContentEditable

> j-ContentEditable: facile da usare; supporta grandi caratteristiche

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: it
Content-SHA256: 0911a38747e4b84dcf5ba4ae241019d62b5caff91a665ce4e42873acda578539
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- Supporta grandi caratteristiche
- Funziona con il sistema Bootstrap Grid
- Facile per la personalizzazione
- Supporta i brevetti di base `CMD+B` Il balletto, `CMD+U` di sottolineare, `CMD+I` Italiano e `CMD+L` Crea un link

__Attributi__:
- `data-required="true"` opzionale, standard `false`
- `data-clipboard="text/plain"` opzionale, predefinito `text/plain` (per il supporto di `html` utilizzo `text/html`)

__Metodi__:
- `component.getNode()` ritorna un `node` selezionato nel testo `{Object}`
- `component.getSelection()` ritorna una selezione corrente di `{String}`
- `component.insert(value, [encode])` inserisce un testo HTML o PLAIN personalizzato nella posizione corrente del cursore, `encode` (opzionale) è per default `false`
- `component.exec('Bold', false, null)` ha la stessa funzionalità di `document.execCommand()`

__operatori__:
`component.event(type, value)` gestisce tutti gli eventi dall'editore.

```html
type = bold          - when a text is bolded (value is boolean)
type = italic        - when a text is italic (value is boolean)
type = underline     - when a text is underlined (value is boolean)
type = link          - when a link is created (value is a temporary URL)
type = current       - when a current element is changed in the text (value is NODE)
type = paste         - when the clipboard is used (value is a clipboard value)
type = select        - when a text is selected (value is selected text)
type = focus         - editor is focused (value is undefined)
type = blur          - editor is not focused (value is undefined)
type = click         - click on the specific element in the text (value is NODE)
```

__Dichiarazione default__:

```javascript
self.event = function(type, value) {
    if (type === 'paste')
        self.insert(value, true);
};
```

Utilizzare con `<ui-component name="contenteditable">`Quando il componente non è ancora caricato, jComponent Scarica il codice in prima utilizzazione dall'indirizzo `DEF.fallback` (Il Componentator La storia di Peter Širka.Fonte: il Componentator Ristorante dei componenti, licenza MIT.

```html example.html
<div class="container">
	<div class="row">
		<div class="col-md-6">
			<ui-component name="contenteditable" path="myhtml"></ui-component>
		</div>
	</div>
</div>
```
