From 43600426c7f3503916fefc0dcb0f7707e7325c9a Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 14 Oct 2020 11:05:51 +0200 Subject: [PATCH] * Api: Add table button into html editor's toolbar --- api/js/etemplate/et2_widget_htmlarea.js | 6 +++--- api/js/etemplate/et2_widget_htmlarea.ts | 6 +++--- api/src/Etemplate/Widget/HtmlArea.php | 4 ++-- api/templates/default/images/htmlarea/pastetext.svg | 10 ++++++++++ api/templates/default/images/htmlarea/table.svg | 1 + 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 api/templates/default/images/htmlarea/pastetext.svg create mode 100644 api/templates/default/images/htmlarea/table.svg diff --git a/api/js/etemplate/et2_widget_htmlarea.js b/api/js/etemplate/et2_widget_htmlarea.js index 5c7c12ada3..0064ca3b40 100644 --- a/api/js/etemplate/et2_widget_htmlarea.js +++ b/api/js/etemplate/et2_widget_htmlarea.js @@ -450,21 +450,21 @@ var et2_htmlarea = /** @class */ (function (_super) { */ et2_htmlarea.TOOLBAR_SIMPLE = "undo redo|formatselect fontselect fontsizeselect | bold italic removeformat forecolor backcolor | " + "alignleft aligncenter alignright alignjustify | numlist " + - "bullist outdent indent| link image pastetext"; + "bullist outdent indent| link image pastetext | table"; /** * arranged toolbars as extended mode * @constant */ et2_htmlarea.TOOLBAR_EXTENDED = "fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | " + "link | alignleft aligncenter alignright alignjustify | numlist " + - "bullist outdent indent | removeformat | image | fullscreen"; + "bullist outdent indent | removeformat | image | fullscreen | table"; /** * arranged toolbars as advanced mode * @constant */ et2_htmlarea.TOOLBAR_ADVANCED = "undo redo| formatselect | fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | " + "alignleft aligncenter alignright alignjustify | numlist " + - "bullist outdent indent ltr rtl | removeformat code| link image pastetext | searchreplace | fullscreen"; + "bullist outdent indent ltr rtl | removeformat code| link image pastetext | searchreplace | fullscreen | table"; /** * font size formats * @constant diff --git a/api/js/etemplate/et2_widget_htmlarea.ts b/api/js/etemplate/et2_widget_htmlarea.ts index ed5c92b563..a17f1deda3 100644 --- a/api/js/etemplate/et2_widget_htmlarea.ts +++ b/api/js/etemplate/et2_widget_htmlarea.ts @@ -114,7 +114,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable */ public static readonly TOOLBAR_SIMPLE : string = "undo redo|formatselect fontselect fontsizeselect | bold italic removeformat forecolor backcolor | "+ "alignleft aligncenter alignright alignjustify | numlist "+ - "bullist outdent indent| link image pastetext"; + "bullist outdent indent| link image pastetext | table"; /** * arranged toolbars as extended mode @@ -122,7 +122,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable */ public static readonly TOOLBAR_EXTENDED : string = "fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | "+ "link | alignleft aligncenter alignright alignjustify | numlist "+ - "bullist outdent indent | removeformat | image | fullscreen"; + "bullist outdent indent | removeformat | image | fullscreen | table"; /** * arranged toolbars as advanced mode @@ -130,7 +130,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable */ public static readonly TOOLBAR_ADVANCED : string = "undo redo| formatselect | fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | "+ "alignleft aligncenter alignright alignjustify | numlist "+ - "bullist outdent indent ltr rtl | removeformat code| link image pastetext | searchreplace | fullscreen"; + "bullist outdent indent ltr rtl | removeformat code| link image pastetext | searchreplace | fullscreen | table"; /** * font size formats diff --git a/api/src/Etemplate/Widget/HtmlArea.php b/api/src/Etemplate/Widget/HtmlArea.php index 0cb260caa4..6435698aea 100644 --- a/api/src/Etemplate/Widget/HtmlArea.php +++ b/api/src/Etemplate/Widget/HtmlArea.php @@ -86,7 +86,7 @@ class HtmlArea extends Etemplate\Widget 'undo', 'redo', 'bold', 'italic', 'strikethrough', 'forecolor', 'backcolor', 'link', 'alignleft', 'aligncenter', 'alignright', 'alignjustify', 'numlist', 'bullist', 'outdent', 'indent', 'ltr', 'rtl','pastetext', - 'removeformat', 'code', 'image', 'searchreplace','formatselect', 'fontselect', 'fontsizeselect', 'fullscreen' + 'removeformat', 'code', 'image', 'searchreplace','formatselect', 'fontselect', 'fontsizeselect', 'fullscreen', 'table' ]; /** @@ -97,7 +97,7 @@ class HtmlArea extends Etemplate\Widget 'undo', 'redo','formatselect', 'fontselect', 'fontsizeselect', 'bold' ,'italic', 'removeformat', 'forecolor', 'backcolor', 'alignleft', 'aligncenter', 'alignright', 'alignjustify', 'numlist', 'bullist', 'outdent', - 'indent', 'link', 'image', 'pastetext' + 'indent', 'link', 'image', 'pastetext', 'table' ]; /** diff --git a/api/templates/default/images/htmlarea/pastetext.svg b/api/templates/default/images/htmlarea/pastetext.svg new file mode 100644 index 0000000000..2b98bd86f6 --- /dev/null +++ b/api/templates/default/images/htmlarea/pastetext.svg @@ -0,0 +1,10 @@ + + + + icon-paste-text + Created with Sketch. + + + + + \ No newline at end of file diff --git a/api/templates/default/images/htmlarea/table.svg b/api/templates/default/images/htmlarea/table.svg new file mode 100644 index 0000000000..2b32a19baa --- /dev/null +++ b/api/templates/default/images/htmlarea/table.svg @@ -0,0 +1 @@ + \ No newline at end of file