forked from syncfusion/ej2-javascript-ui-controls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-formatter.ts
51 lines (49 loc) · 1.65 KB
/
html-formatter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Formatter } from './formatter';
import { IEditorModel, IHtmlFormatterModel } from './../base/interface';
import { EditorManager } from './../../editor-manager/base/editor-manager';
import { extend } from '@syncfusion/ej2-base';
import { htmlKeyConfig } from './../../common/config';
import { HtmlToolbarStatus } from '../actions/html-toolbar-status';
/**
* HTML adapter
*
* @hidden
* @deprecated
*/
export class HTMLFormatter extends Formatter {
public keyConfig: { [key: string]: string };
public currentDocument: Document;
public element: Element;
public editorManager: IEditorModel;
private toolbarUpdate: HtmlToolbarStatus;
public constructor(options?: IHtmlFormatterModel) {
super();
this.initialize();
extend(this, this, options, true);
if (this.currentDocument && this.element) {
this.updateFormatter(this.element, this.currentDocument, options.options);
}
}
private initialize(): void {
this.keyConfig = htmlKeyConfig;
}
/**
* Update the formatter of RichTextEditor
*
* @param {Element} editElement - specifies the edit element.
* @param {Document} doc - specifies the doucment
* @param {number} options - specifies the options
* @returns {void}
* @hidden
* @deprecated
*/
public updateFormatter(editElement: Element, doc?: Document, options?: { [key: string]: number }): void {
if (editElement && doc) {
this.editorManager = new EditorManager({
document: doc,
editableElement: editElement,
options: options
});
}
}
}