# j-ContentEditable

> j-ContentEditable: лесен за използване; поддържа отлични характеристики

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: bg
Content-SHA256: 3328df80aa510caeaa69003eb0c022d40a7eaa62e78ddec88fdacf8a0d12cf9d
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- Поддържа големи характеристики
- Работи с Bootstrap
- Лесно за персонализиране
- Поддържа основни кратки `CMD+B` Булдът е `CMD+U` под линия, `CMD+I` Италиански и `CMD+L` Създаване на линк

__Атрибути__:
- `data-required="true"` опционален, дефолт `false`
- `data-clipboard="text/plain"` опция, по подразбиране `text/plain` (за поддръжка на `html` използване `text/html`)

__Методи__:
- `component.getNode()` връща избрания `node` в текста на `{Object}`
- `component.getSelection()` връща текущия избор на `{String}`
- `component.insert(value, [encode])` въвежда персонализиран HTML или PLAIN текст в текущата позиция на курсора, `encode` (опционално) е по подразбиране `false`
- `component.exec('Bold', false, null)` има същата функционалност като `document.execCommand()`

__Търговецът__:
`component.event(type, value)` управлява всички събития от редактора.

```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)
```

__дефектна декларация__:

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

Използвайте го с `<ui-component name="contenteditable">`Когато компонентът все още не е зареден, jComponent Изтегляне на първия адрес в `DEF.fallback` (След това Componentator Източник: Питър Шерка Componentator Съставни съставки, лиценз на 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>
```
