W.I.P. implementing TinyMCE editor and deprecating CKEditor:

- Add configurable toolbar as preference
- Do not load CkEditor until it's used
This commit is contained in:
Hadi Nategh 2018-10-24 14:48:19 +02:00
parent 9a331446c8
commit 7e25284816
47 changed files with 119 additions and 19 deletions

View File

@ -13,9 +13,6 @@
/*egw:uses
jsapi.jsapi; // Needed for egw_seperateJavaScript
/vendor/bower-asset/jquery/dist/jquery.js;
/vendor/egroupware/ckeditor/ckeditor.js;
/vendor/egroupware/ckeditor/ckeditor.config;
/vendor/egroupware/ckeditor/ckeditor.adapters/jquery;
et2_core_baseWidget;
*/

View File

@ -21,10 +21,6 @@
*/
var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2_IResizeable],
{
font_size_formats: {
pt: "8pt 10pt 12pt 14pt 18pt 24pt 36pt 48pt 72pt",
px:"8px 10px 12px 14px 18px 24px 36px 48px 72px"
},
attributes: {
'mode': {
'name': 'Mode',
@ -219,14 +215,16 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2
},
/**
* Takes all relevant preferences into account and set settings accordingly
*
* @returns {et2_widget_htmlareaet2_htmlarea.et2_widget_htmlareaAnonym$1._extendedSettings.settings}
* @returns {object} returns a object including all settings
*/
_extendedSettings: function () {
var rte_menubar = egw.preference('rte_menubar', 'common');
var rte_toolbar = egw.preference('rte_toolbar', 'common');
var settings = {
fontsize_formats: this.font_size_formats[egw.preference('rte_font_unit', 'common')],
fontsize_formats: et2_htmlarea.FONT_SIZE_FORMATS[egw.preference('rte_font_unit', 'common')],
menubar: parseInt(rte_menubar) && this.menubar ? true : typeof rte_menubar != 'undefined' ? false : this.menubar
};
@ -234,21 +232,26 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2
switch (mode)
{
case 'simple':
settings.toolbar = "fontselect fontsizeselect | bold italic forecolor backcolor | "+
"alignleft aligncenter alignright alignjustify | numlist "+
"bullist outdent indent | link image"
settings.toolbar = et2_htmlarea.TOOLBAR_SIMPLE;
break;
case 'extended':
settings.toolbar = "fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | "+
"link | alignleft aligncenter alignright alignjustify | numlist "+
"bullist outdent indent | removeformat | image"
settings.toolbar = et2_htmlarera.TOOLBAR_EXTENDED;
break;
case 'advanced':
settings.toolbar = "undo redo| formatselect | fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | "+
"link | alignleft aligncenter alignright alignjustify | numlist "+
"bullist outdent indent ltr rtl | removeformat code| image | searchreplace"
settings.toolbar = et2_htmlarea.TOOLBAR_ADVANCED;
break;
}
// take rte_toolbar into account if no mode restrictly set from template
if (rte_toolbar && !this.mode)
{
var toolbar_diff = et2_htmlarea.TOOLBAR_LIST.filter((i) => {return !(rte_toolbar.indexOf(i) > -1);});
settings.toolbar = et2_htmlarea.TOOLBAR_ADVANCED;
toolbar_diff.forEach((a) => {
let r = new RegExp(a);
settings.toolbar = settings.toolbar.replace(r, '');
});
}
return settings;
},
@ -317,3 +320,45 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2
}
});}).call(this);
et2_register_widget(et2_htmlarea, ["htmlarea"]);
// Static class stuff
jQuery.extend(et2_htmlarea, {
/**
* Array of toolbars
* @constant
*/
TOOLBAR_LIST: ['undo', 'redo', 'formatselect', 'fontselect', 'fontsizeselect',
'bold', 'italic', 'strikethrough', 'forecolor', 'backcolor', 'link',
'alignleft', 'aligncenter', 'alignright', 'alignjustify', 'numlist',
'bullist', 'outdent', 'indent', 'ltr', 'rtl', 'removeformat', 'code', 'image', 'searchreplace'
],
/**
* arranged toolbars as simple mode
* @constant
*/
TOOLBAR_SIMPLE: "fontselect fontsizeselect | bold italic forecolor backcolor | "+
"alignleft aligncenter alignright alignjustify | numlist "+
"bullist outdent indent | link image",
/**
* arranged toolbars as extended mode
* @constant
*/
TOOLBAR_EXTENDED: "fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | "+
"link | alignleft aligncenter alignright alignjustify | numlist "+
"bullist outdent indent | removeformat | image",
/**
* arranged toolbars as advanced mode
* @constant
*/
TOOLBAR_ADVANCED: "undo redo| formatselect | fontselect fontsizeselect | bold italic strikethrough forecolor backcolor | "+
"link | alignleft aligncenter alignright alignjustify | numlist "+
"bullist outdent indent ltr rtl | removeformat code| image | searchreplace",
/**
* font size formats
* @constant
*/
FONT_SIZE_FORMATS: {
pt: "8pt 10pt 12pt 14pt 18pt 24pt 36pt 48pt 72pt",
px:"8px 10px 12px 14px 18px 24px 36px 48px 72px"
}
});

View File

@ -37,6 +37,10 @@ class CkEditor extends Etemplate\Widget
{
$form_name = self::form_name($cname, $this->id);
Api\Framework::includeJS('/vendor/egroupware/ckeditor/ckeditor.js');
Api\Framework::includeJS('/vendor/egroupware/ckeditor/ckeditor.config.js');
Api\Framework::includeJS('/vendor/egroupware/ckeditor/ckeditor.adapters/jquery.js');
$config = Api\Html\CkEditorConfig::get_ckeditor_config_array($this->attrs['mode'], $this->attrs['height'],
$this->attrs['expand_toolbar'],$this->attrs['base_href']
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-align-center" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-align-justify" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-align-left" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-align-right" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-background-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="Rectangle" opacity=".1" d="M3 3h18v16H3z"></path><path id="color" d="M3 19h18v3H3z"></path><path d="M8.7 17h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-bold" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" id="B"></path></g></svg>

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-unordered-list" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-sourcecode" stroke="none" stroke-width="1" fill-rule="nonzero"><path d="M10.7 9.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2l-4.1 4.4c-.3.3-.8.3-1.2 0l-4.2-4.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L7 13l3.7-3.8z" id="Shape" transform="rotate(90 7 12)"></path><path d="M20.7 9.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2l-4.1 4.4c-.3.3-.8.3-1.2 0l-4.2-4.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L17 13l3.7-3.8z" id="Shape-Copy" transform="matrix(0 1 1 0 5 -5)"></path></g></svg>

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-text-color" stroke="none" stroke-width="1" fill-rule="evenodd"><path id="color" d="M3 18h18v3H3z"></path><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-image" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" id="Combined-Shape" fill-rule="nonzero"></path></g></svg>

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-indent" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" id="Combined-Shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-italic" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" id="I"></path></g></svg>

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-link" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="link" transform="translate(3 3)" fill-rule="nonzero"><path d="M3.2 9.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4A1 1 0 1 1 11.4 8a2.9 2.9 0 0 1 0 4L6.6 17a3.9 3.9 0 0 1-5.5-5.5l2-2zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L8 7.3a1 1 0 0 0 0 1.4A1 1 0 1 1 6.6 10a2.9 2.9 0 0 1 0-4L11.4 1a3.9 3.9 0 0 1 5.5 5.5l-2 2z" id="Shape"></path></g></g></svg>

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-ltr" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-ordered-list" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-outdent" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2z" id="Combined-Shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-remove-formatting" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8zM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-rtl" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2z" id="shape"></path></g></svg>

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-search" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12z" id="Combined-Shape" fill-rule="nonzero"></path></g></svg>

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-strike-through" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z" id="s"></path><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2z" id="Rectangle" fill-rule="nonzero"></path></g></svg>

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

View File

@ -0,0 +1 @@
<svg width="24" height="24"><g id="icon-undo" stroke="none" stroke-width="1" fill-rule="evenodd"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8z" id="Combined-Shape" fill-rule="nonzero"></path></g></svg>

After

Width:  |  Height:  |  Size: 358 B

View File

@ -115,6 +115,24 @@ class preferences_hooks
$GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size'],
$GLOBALS['egw_info']['user']['preferences']['common']['rte_font_unit']);
}
$rte_toolbar_list = array (
'undo', 'redo', 'formatselect', 'fontselect', 'fontsizeselect',
'bold', 'italic', 'strikethrough', 'forecolor', 'backcolor',
'link', 'alignleft', 'aligncenter', 'alignright', 'alignjustify',
'numlist', 'bullist', 'outdent', 'indent', 'ltr', 'rtl',
'removeformat', 'code', 'image', 'searchreplace'
);
$rte_toolbar_selOptions = array();
foreach ($rte_toolbar_list as $toolbar)
{
$rte_toolbar_selOptions[$toolbar] = array (
'id' => $toolbar,
'label' => lang($toolbar),
'title' => lang($toolbar),
'icon' => Framework::getUrl($GLOBALS['egw_info']['server']['webserver_url']).'/api/templates/default/images/htmlarea/'.$toolbar.'.png',
'app' => 'api'
);
}
// Settings array for this app
$settings = array(
array(
@ -408,6 +426,21 @@ class preferences_hooks
'admin' => false,
'default'=> 'extended'
),
'rte_toolbar' => array(
'type' => 'taglist',
'label' => 'Enabled features in toolbar',
'name' => 'rte_toolbar',
'values'=> '',
'help' => 'You may select features to be enabled in toolbar. Selecting any of the tools from here means seleted "Feature of the editor" preference would be ignored.',
'admin' => true,
'attributes' => array(
'allowFreeEntries' => false,
//'multiple' => 'toggle',
'editModeEnabled' => false,
'autocomplete_url' => ' ',
'select_options' => $rte_toolbar_selOptions
)
)
);
// disable thumbnails, if no size configured by admin
if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($settings['link_list_thumbnail']);