adjust customizations to current editor
This commit is contained in:
parent
823a36912c
commit
60846f6a84
|
@ -39,10 +39,12 @@ use O3\TinyMCE\Application\Core\TinyMCE\Options\Menubar;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\MinHeight;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\MinHeight;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\OptionInterface;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\OptionInterface;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\Plugins;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Plugins;
|
||||||
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Promotion;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\Protect;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Protect;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\QuickbarsInsertToolbar;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\QuickbarsInsertToolbar;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\RelativeUrls;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\RelativeUrls;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\Selector;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Selector;
|
||||||
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Setup;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\Toolbar;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\Toolbar;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\ToolbarMode;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\ToolbarMode;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Options\ToolbarSticky;
|
use O3\TinyMCE\Application\Core\TinyMCE\Options\ToolbarSticky;
|
||||||
|
@ -84,24 +86,6 @@ class Configuration
|
||||||
|
|
||||||
public function getConfig()
|
public function getConfig()
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
return implode(', ', array_map(
|
|
||||||
function ($v, $k) {
|
|
||||||
if (is_array($v)) {
|
|
||||||
return $k.'[]='.implode('&'.$k.'[]=', $v);
|
|
||||||
} else {
|
|
||||||
return $k.': '.$v;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
$this->options,
|
|
||||||
array_keys($this->options)
|
|
||||||
));
|
|
||||||
|
|
||||||
|
|
||||||
http_build_query($this->options,'',', ')
|
|
||||||
*/
|
|
||||||
// $config = json_encode($this->options);
|
|
||||||
|
|
||||||
foreach ($this->options as $param => $value) {
|
foreach ($this->options as $param => $value) {
|
||||||
$sConfig .= "$param: $value, ";
|
$sConfig .= "$param: $value, ";
|
||||||
}
|
}
|
||||||
|
@ -114,6 +98,7 @@ class Configuration
|
||||||
*/
|
*/
|
||||||
protected function addIntegrateOptions(): void
|
protected function addIntegrateOptions(): void
|
||||||
{
|
{
|
||||||
|
$this->addOption(oxNew( Setup::class, $this->loader));
|
||||||
$this->addOption(oxNew( BaseUrl::class, $this->loader));
|
$this->addOption(oxNew( BaseUrl::class, $this->loader));
|
||||||
$this->addOption(oxNew( CacheSuffix::class, $this->loader));
|
$this->addOption(oxNew( CacheSuffix::class, $this->loader));
|
||||||
$this->addOption(oxNew( Selector::class, $this->loader));
|
$this->addOption(oxNew( Selector::class, $this->loader));
|
||||||
|
@ -121,6 +106,7 @@ class Configuration
|
||||||
|
|
||||||
protected function addGuiOptions(): void
|
protected function addGuiOptions(): void
|
||||||
{
|
{
|
||||||
|
$this->addOption(oxNew(Promotion::class, $this->loader));
|
||||||
$this->addOption(oxNew(ContextMenu::class, $this->loader));
|
$this->addOption(oxNew(ContextMenu::class, $this->loader));
|
||||||
$this->addOption(oxNew(MinHeight::class, $this->loader));
|
$this->addOption(oxNew(MinHeight::class, $this->loader));
|
||||||
$this->addOption(oxNew(MaxHeight::class, $this->loader));
|
$this->addOption(oxNew(MaxHeight::class, $this->loader));
|
||||||
|
|
|
@ -29,7 +29,7 @@ class ContextMenu extends AbstractOption
|
||||||
|
|
||||||
public function get(): string
|
public function get(): string
|
||||||
{
|
{
|
||||||
return 'link linkchecker image imagetools table';
|
return 'link linkchecker image table';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mustQuote(): bool
|
public function mustQuote(): bool
|
||||||
|
|
|
@ -21,19 +21,16 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace O3\TinyMCE\Application\Core\TinyMCE\Plugins;
|
namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
|
||||||
|
|
||||||
class Hr extends AbstractPlugin
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
{
|
|
||||||
public function getPluginName(): string
|
|
||||||
{
|
|
||||||
return 'hr';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getToolbarElements(): array
|
class Promotion extends AbstractOption
|
||||||
{
|
{
|
||||||
return [
|
protected string $key = 'promotion';
|
||||||
'hr'
|
|
||||||
];
|
public function get(): string
|
||||||
|
{
|
||||||
|
return 'false';
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -21,19 +21,27 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace O3\TinyMCE\Application\Core\TinyMCE\Plugins;
|
namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
|
||||||
|
|
||||||
class Paste extends AbstractPlugin
|
class Setup extends AbstractOption
|
||||||
{
|
{
|
||||||
public function getPluginName(): string
|
protected string $key = 'setup';
|
||||||
|
|
||||||
|
public function get(): string
|
||||||
{
|
{
|
||||||
return 'paste';
|
$js = <<<JS
|
||||||
|
(editor) => {
|
||||||
|
editor.options.register("filemanager_url", { processor: "string" });
|
||||||
|
}
|
||||||
|
JS;
|
||||||
|
return trim(preg_replace('!\s+!', ' ', $js));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getToolbarElements(): array
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function requireRegistration(): bool
|
||||||
{
|
{
|
||||||
return [
|
return (bool) $this->loader->getShopConfig()->getConfigParam("blTinyMCE_filemanager");
|
||||||
'pastetext'
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -58,7 +58,6 @@ class PluginList
|
||||||
'charmap' => oxNew(Charmap::class),
|
'charmap' => oxNew(Charmap::class),
|
||||||
'code' => oxNew(Code::class),
|
'code' => oxNew(Code::class),
|
||||||
'fullpage' => oxNew(FullPage::class),
|
'fullpage' => oxNew(FullPage::class),
|
||||||
'hr' => oxNew(Hr::class),
|
|
||||||
'image' => oxNew(Image::class),
|
'image' => oxNew(Image::class),
|
||||||
'legacyoutput' => oxNew(Legacyoutput::class),
|
'legacyoutput' => oxNew(Legacyoutput::class),
|
||||||
'link' => oxNew(Link::class),
|
'link' => oxNew(Link::class),
|
||||||
|
@ -66,7 +65,6 @@ class PluginList
|
||||||
'media' => oxNew(Media::class),
|
'media' => oxNew(Media::class),
|
||||||
'nonbreaking' => oxNew(Nonbreaking::class),
|
'nonbreaking' => oxNew(Nonbreaking::class),
|
||||||
'pagebreak' => oxNew(Pagebreak::class),
|
'pagebreak' => oxNew(Pagebreak::class),
|
||||||
'paste' => oxNew(Paste::class),
|
|
||||||
'preview' => oxNew(Preview::class),
|
'preview' => oxNew(Preview::class),
|
||||||
'quickbars' => oxNew(Quickbars::class),
|
'quickbars' => oxNew(Quickbars::class),
|
||||||
'searchreplace' => oxNew(SearchReplace::class),
|
'searchreplace' => oxNew(SearchReplace::class),
|
||||||
|
|
|
@ -23,12 +23,12 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace O3\TinyMCE\Application\Core\TinyMCE\Toolbar;
|
namespace O3\TinyMCE\Application\Core\TinyMCE\Toolbar;
|
||||||
|
|
||||||
class Formatselect extends AbstractToolbar
|
class Blocks extends AbstractToolbar
|
||||||
{
|
{
|
||||||
public function getButtons(): array
|
public function getButtons(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'formatselect',
|
'blocks',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -28,8 +28,8 @@ class Font extends AbstractToolbar
|
||||||
public function getButtons(): array
|
public function getButtons(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
// 'fontselect',
|
// 'fontfamily',
|
||||||
//'fontsizeselect',
|
//'fontsize',
|
||||||
// '|',
|
// '|',
|
||||||
'bold',
|
'bold',
|
||||||
'italic',
|
'italic',
|
||||||
|
|
|
@ -28,7 +28,7 @@ use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Blockquote;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Color;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Color;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\CopyPaste;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\CopyPaste;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Font;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Font;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Formatselect;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Blocks;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Indent;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Indent;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Lists;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Lists;
|
||||||
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\RemoveFormat;
|
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\RemoveFormat;
|
||||||
|
@ -42,7 +42,7 @@ class ToolbarList
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'formatselect' => oxNew(Formatselect::class),
|
'blocks' => oxNew(Blocks::class),
|
||||||
'font' => oxNew(Font::class),
|
'font' => oxNew(Font::class),
|
||||||
'color' => oxNew(Color::class),
|
'color' => oxNew(Color::class),
|
||||||
'align' => oxNew(Align::class),
|
'align' => oxNew(Align::class),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<li style="margin-left: 50px;">
|
<li style="margin-left: 50px;">
|
||||||
<button style="border: 1px solid #0089EE; color: #0089EE;padding: 3px 10px; margin-top: -10px; background: white;"
|
<button style="border: 1px solid #0089EE; color: #0089EE;padding: 3px 10px; margin-top: -10px; background: white;"
|
||||||
onclick="tinymce.each(tinymce.editors, function(editor) { if(editor.isHidden()) { editor.show(); } else { editor.hide(); } });">
|
onclick="tinymce.get().forEach(function(editor) { if(editor.isHidden()) { editor.show(); } else { editor.hide(); }});">
|
||||||
<span>
|
<span>
|
||||||
[{oxmultilang ident="TINYMCE_TOGGLE"}]
|
[{oxmultilang ident="TINYMCE_TOGGLE"}]
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#/bin/bash
|
#/bin/bash
|
||||||
|
|
||||||
wget https://www.tiny.cloud/tinymce-services-azure/1/package/download?plugins=advlist,anchor,autolink,autoresize,charmap,code,colorpicker,contextmenu,directionality,fullpage,fullscreen,hr,image,imagetools,importcss,insertdatetime,legacyoutput,link,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,searchreplace,tabfocus,table,textcolor,textpattern,toc,visualblocks,wordcount&themes=modern,inlite,mobile&skins=lightgray&combine=true -o tinymce.zip
|
wget https://www.tiny.cloud/tinymce-services-azure/1/package/download?plugins=advlist,anchor,autolink,autoresize,charmap,code,colorpicker,contextmenu,directionality,fullpage,fullscreen,hr,image,importcss,insertdatetime,legacyoutput,link,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,searchreplace,tabfocus,table,textcolor,textpattern,toc,visualblocks,wordcount&themes=modern,inlite,mobile&skins=lightgray&combine=true -o tinymce.zip
|
|
@ -20,18 +20,19 @@
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
const PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
const PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||||
|
|
||||||
PluginManager.add('roxy', function (editor) {
|
PluginManager.add('roxy', function (editor) {
|
||||||
editor.settings.file_picker_callback = function ($callback, $value, $meta) {
|
editor.options.set('file_picker_callback', function ($callback, $value, $meta) {
|
||||||
var url = editor.settings.filemanager_url
|
var url = editor.options.get('filemanager_url')
|
||||||
+ "&type=" + $meta.filetype
|
+ "&type=" + $meta.filetype
|
||||||
+ '&value=' + $value
|
+ '&value=' + $value
|
||||||
+ '&selected=' + $value;
|
+ '&selected=' + $value;
|
||||||
|
|
||||||
if (editor.settings.language) {
|
if (editor.options.isSet('language')) {
|
||||||
url += '&langCode=' + editor.settings.language;
|
url += '&langCode=' + editor.options.get('language');
|
||||||
}
|
}
|
||||||
if (editor.settings.filemanager_access_key) {
|
if (editor.options.isSet('filemanager_access_key')) {
|
||||||
url += '&akey=' + editor.settings.filemanager_access_key;
|
url += '&akey=' + editor.options.get('filemanager_access_key');
|
||||||
}
|
}
|
||||||
|
|
||||||
const instanceApi = editor.windowManager.openUrl({
|
const instanceApi = editor.windowManager.openUrl({
|
||||||
|
@ -44,6 +45,6 @@
|
||||||
instanceApi.close();
|
instanceApi.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
});
|
});
|
||||||
}());
|
}());
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue