TF-1877 Use execSummernoteAPI to format text style

(cherry picked from commit 6c81bef9a0cbe391ebf42096dc33ae0d99cf79c8)
This commit is contained in:
dab246
2023-06-30 12:57:10 +07:00
committed by Dat Vu
parent 7f4b0c4b52
commit 32adfb3581
9 changed files with 253 additions and 23 deletions
@@ -58,6 +58,27 @@ enum HeaderStyleType {
}
}
String get summernoteNameAPI {
switch (this) {
case HeaderStyleType.normal:
return 'formatPara';
case HeaderStyleType.h1:
return 'formatH1';
case HeaderStyleType.h2:
return 'formatH2';
case HeaderStyleType.h3:
return 'formatH3';
case HeaderStyleType.h4:
return 'formatH4';
case HeaderStyleType.h5:
return 'formatH5';
case HeaderStyleType.h6:
return 'formatH6';
default:
return '';
}
}
double get textSize {
switch(this) {
case HeaderStyleType.normal:
@@ -17,6 +17,15 @@ enum OrderListType {
}
}
String get summernoteNameAPI {
switch(this) {
case OrderListType.bulletedList:
return 'insertUnorderedList';
case OrderListType.numberedList:
return 'insertOrderedList';
}
}
String getIcon(ImagePaths imagePaths) {
switch (this) {
case OrderListType.bulletedList:
@@ -29,6 +29,23 @@ enum ParagraphType {
}
}
String get summernoteNameAPI {
switch(this) {
case ParagraphType.alignLeft:
return 'justifyLeft';
case ParagraphType.alignRight:
return 'justifyRight';
case ParagraphType.alignCenter:
return 'justifyCenter';
case ParagraphType.justify:
return 'justifyFull';
case ParagraphType.indent:
return 'indent';
case ParagraphType.outdent:
return 'outdent';
}
}
String getIcon(ImagePaths imagePaths) {
switch (this) {
case ParagraphType.alignLeft:
@@ -38,6 +38,27 @@ enum RichTextStyleType {
}
}
String get summernoteNameAPI {
switch (this) {
case RichTextStyleType.textColor:
return 'foreColor';
case RichTextStyleType.textBackgroundColor:
return 'backColor';
case RichTextStyleType.fontName:
return 'fontName';
case bold:
return 'bold';
case italic:
return 'italic';
case underline:
return 'underline';
case strikeThrough:
return 'strikethrough';
default:
return '';
}
}
String getIcon(ImagePaths imagePaths) {
switch (this) {
case bold: