|
@@ -3,7 +3,7 @@ import {actions, messages} from './const';
|
3
|
3
|
export const InjectedMessageHandler = `
|
4
|
4
|
if (WebViewBridge) {
|
5
|
5
|
WebViewBridge.onMessage = function (message) {
|
6
|
|
-
|
|
6
|
+console.log(message)
|
7
|
7
|
const action = JSON.parse(message);
|
8
|
8
|
|
9
|
9
|
switch(action.type) {
|
|
@@ -33,12 +33,15 @@ export const InjectedMessageHandler = `
|
33
|
33
|
break;
|
34
|
34
|
case '${actions.setBold}':
|
35
|
35
|
zss_editor.setBold();
|
|
36
|
+ window.wixRichTextInstance.execCommand('bold');
|
36
|
37
|
break;
|
37
|
38
|
case '${actions.setItalic}':
|
38
|
39
|
zss_editor.setItalic();
|
|
40
|
+ window.wixRichTextInstance.execCommand('italic');
|
39
|
41
|
break;
|
40
|
42
|
case '${actions.setUnderline}':
|
41
|
43
|
zss_editor.setUnderline();
|
|
44
|
+ window.wixRichTextInstance.execCommand('underline');
|
42
|
45
|
break;
|
43
|
46
|
case '${actions.heading1}':
|
44
|
47
|
zss_editor.setHeading('h1');
|
|
@@ -78,9 +81,11 @@ export const InjectedMessageHandler = `
|
78
|
81
|
break;
|
79
|
82
|
case '${actions.insertBulletsList}':
|
80
|
83
|
zss_editor.setUnorderedList();
|
|
84
|
+ window.wixRichTextInstance.execCommand('bulletedlist');
|
81
|
85
|
break;
|
82
|
86
|
case '${actions.insertOrderedList}':
|
83
|
87
|
zss_editor.setOrderedList();
|
|
88
|
+ window.wixRichTextInstance.execCommand('numberedlist');
|
84
|
89
|
break;
|
85
|
90
|
case '${actions.insertLink}':
|
86
|
91
|
zss_editor.insertLink(action.data.url, action.data.title);
|