|
@@ -48,13 +48,13 @@ export default class RichTextEditor extends Component {
|
48
|
48
|
);
|
49
|
49
|
}
|
50
|
50
|
|
51
|
|
- //-------------------------------------------------------------------------------
|
52
|
|
- //--------------- Public API
|
53
|
|
-
|
54
|
51
|
_sendAction(action, data) {
|
55
|
52
|
this.webviewBridge.sendToBridge(JSON.stringify({type: action, data}));
|
56
|
53
|
}
|
57
|
54
|
|
|
55
|
+ //-------------------------------------------------------------------------------
|
|
56
|
+ //--------------- Public API
|
|
57
|
+
|
58
|
58
|
setHTML(html) {
|
59
|
59
|
this._sendAction(actions.setHtml, html);
|
60
|
60
|
}
|
|
@@ -104,49 +104,54 @@ export default class RichTextEditor extends Component {
|
104
|
104
|
}
|
105
|
105
|
|
106
|
106
|
removeFormat() {
|
107
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.removeFormating();`);
|
|
107
|
+ this._sendAction(actions.removeFormat);
|
108
|
108
|
}
|
109
|
109
|
|
110
|
110
|
alignLeft() {
|
111
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyLeft();`);
|
|
111
|
+ this._sendAction(actions.alignLeft);
|
112
|
112
|
}
|
113
|
113
|
|
114
|
114
|
alignCenter() {
|
115
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyCenter();`);
|
|
115
|
+ this._sendAction(actions.alignCenter);
|
116
|
116
|
}
|
117
|
117
|
|
118
|
118
|
alignRight() {
|
119
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyRight();`);
|
|
119
|
+ this._sendAction(actions.alignRight);
|
120
|
120
|
}
|
121
|
121
|
|
122
|
122
|
alignFull() {
|
123
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setJustifyFull();`);
|
|
123
|
+ this._sendAction(actions.alignFull);
|
124
|
124
|
}
|
125
|
125
|
|
126
|
126
|
insertBulletsList() {
|
127
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setUnorderedList();`);
|
|
127
|
+ this._sendAction(actions.insertBulletsList);
|
128
|
128
|
}
|
129
|
129
|
|
130
|
130
|
insertOrderedList() {
|
131
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setOrderedList();`);
|
|
131
|
+ this._sendAction(actions.insertOrderedList);
|
132
|
132
|
}
|
133
|
133
|
|
134
|
134
|
setSubscript() {
|
135
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setSubscript();`);
|
|
135
|
+ this._sendAction(actions.setSubscript);
|
136
|
136
|
}
|
|
137
|
+
|
137
|
138
|
setSuperscript() {
|
138
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setSuperscript();`);
|
|
139
|
+ this._sendAction(actions.setSuperscript);
|
139
|
140
|
}
|
|
141
|
+
|
140
|
142
|
setStrikethrough() {
|
141
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setStrikeThrough();`);
|
|
143
|
+ this._sendAction(actions.setStrikethrough);
|
142
|
144
|
}
|
|
145
|
+
|
143
|
146
|
setHR() {
|
144
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setHorizontalRule();`);
|
|
147
|
+ this._sendAction(actions.setHR);
|
145
|
148
|
}
|
|
149
|
+
|
146
|
150
|
setIndent() {
|
147
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setIndent();`);
|
|
151
|
+ this._sendAction(actions.setIndent);
|
148
|
152
|
}
|
|
153
|
+
|
149
|
154
|
setOutdent() {
|
150
|
|
- this.refs.webviewbridge.sendToBridge(`zss_editor.setOutdent();`);
|
|
155
|
+ this._sendAction(actions.setOutdent);
|
151
|
156
|
}
|
152
|
157
|
}
|