ForgeComponenti
it

Componenti

j-ContentEditable

jComponent 20 · jcomponent@20 component Esempio caricato con jComponent 20
  • 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.

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:

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.

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