From 717b196594c725f260890725f29e0028c25850ab Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 07:14:38 +0100 Subject: [PATCH 01/10] codesample languges added --- .htaccess | 2 +- bl-plugins/tinymce/plugin.php | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.htaccess b/.htaccess index 35995c8a..687ddee1 100644 --- a/.htaccess +++ b/.htaccess @@ -6,7 +6,7 @@ AddDefaultCharset UTF-8 RewriteEngine on # Base directory -#RewriteBase / +RewriteBase /bludit/ # Deny direct access to the next directories RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L] diff --git a/bl-plugins/tinymce/plugin.php b/bl-plugins/tinymce/plugin.php index 45e7314a..6fb174c1 100644 --- a/bl-plugins/tinymce/plugin.php +++ b/bl-plugins/tinymce/plugin.php @@ -12,7 +12,8 @@ class pluginTinymce extends Plugin { $this->dbFields = array( 'toolbar1'=>'formatselect bold italic forecolor backcolor removeformat | bullist numlist table | blockquote alignleft aligncenter alignright | link unlink pagebreak image code', 'toolbar2'=>'', - 'plugins'=>'code autolink image link pagebreak advlist lists textpattern table' + 'plugins'=>'code autolink image link pagebreak advlist lists textpattern table', + 'codesampleLanguages'=>'HTML/XML markup|JavaScript javascript|CSS css|PHP php|Ruby ruby|Python python|Java java|C c|C# sharp|C++ cpp' ); } @@ -35,6 +36,13 @@ class pluginTinymce extends Plugin { $html .= ''; $html .= ''; + if (strpos($this->getValue('plugins'), 'codesample') !== false) { + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + } + return $html; } @@ -64,6 +72,14 @@ class pluginTinymce extends Plugin { $plugins = $this->getValue('plugins'); $version = $this->version(); + if (strpos($this->getValue('plugins'), 'codesample') !== false) { + $codesampleLanguages = explode("|", $this->getValue('codesampleLanguages')); + foreach($codesampleLanguages AS $codesampleLang) { + $values = explode(" ", $codesampleLang); + $codesampleConfig .= "{ text: '" . $values[0] . "', value: '" . $values[1] . "' },"; + } + } + $lang = 'en'; if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$L->currentLanguage().'.js')) { $lang = $L->currentLanguage(); @@ -121,7 +137,8 @@ $html = << From fec2df5a2329c3c630d7bab2050c938f7ff93760 Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 07:44:40 +0100 Subject: [PATCH 02/10] fix broken translation and plugin texts added --- bl-plugins/tinymce/languages/de_CH.json | 6 +++--- bl-plugins/tinymce/languages/de_DE.json | 6 +++--- bl-plugins/tinymce/languages/en.json | 5 ++++- bl-plugins/tinymce/plugin.php | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bl-plugins/tinymce/languages/de_CH.json b/bl-plugins/tinymce/languages/de_CH.json index fd3a0cfe..ee25c69d 100644 --- a/bl-plugins/tinymce/languages/de_CH.json +++ b/bl-plugins/tinymce/languages/de_CH.json @@ -4,7 +4,7 @@ "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, - "Toolbar top": "Obere Werkzeugleiste", - "Toolbar bottom": "Untere Werkzeugleiste", - "Mobile toolbar": "Werkzeugleiste auf Mobiles" + "toolbar-top": "Obere Werkzeugleiste", + "toolbar-bottom": "Untere Werkzeugleiste", + "codesample-languages": "Codesample Programmiersprachen" } diff --git a/bl-plugins/tinymce/languages/de_DE.json b/bl-plugins/tinymce/languages/de_DE.json index b8222abb..7c4b2c5c 100644 --- a/bl-plugins/tinymce/languages/de_DE.json +++ b/bl-plugins/tinymce/languages/de_DE.json @@ -4,7 +4,7 @@ "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, - "Toolbar top": "Obere Werkzeugleiste", - "Toolbar bottom": "Untere Werkzeugleiste", - "Mobile toolbar": "Werkzeugleiste auf Mobiles" + "toolbar-top": "Obere Werkzeugleiste", + "toolbar-bottom": "Untere Werkzeugleiste", + "codesample-languages": "Codesample Programmiersprachen" } diff --git a/bl-plugins/tinymce/languages/en.json b/bl-plugins/tinymce/languages/en.json index 53cac081..c5400865 100644 --- a/bl-plugins/tinymce/languages/en.json +++ b/bl-plugins/tinymce/languages/en.json @@ -3,5 +3,8 @@ { "name": "TinyMCE", "description": "HTML Editor for formatting content. Recommended for the users who don't want to work with Markdown code." - } + }, + "toolbar-top": "Toolbar top", + "toolbar-bottom": "Toolbar bottom", + "codesample-languages": "Codesample languages" } \ No newline at end of file diff --git a/bl-plugins/tinymce/plugin.php b/bl-plugins/tinymce/plugin.php index 6fb174c1..22b71100 100644 --- a/bl-plugins/tinymce/plugin.php +++ b/bl-plugins/tinymce/plugin.php @@ -38,7 +38,7 @@ class pluginTinymce extends Plugin { if (strpos($this->getValue('plugins'), 'codesample') !== false) { $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= '
'; } From 4a489ec1d14b700f5ed42552261ac3ab7d267730 Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:00:09 +0100 Subject: [PATCH 03/10] add description for codesample langs --- bl-plugins/prism | 1 + bl-plugins/tinymce/languages/de_CH.json | 3 ++- bl-plugins/tinymce/languages/de_DE.json | 3 ++- bl-plugins/tinymce/languages/en.json | 3 ++- bl-plugins/tinymce/plugin.php | 7 ++++--- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 160000 bl-plugins/prism diff --git a/bl-plugins/prism b/bl-plugins/prism new file mode 160000 index 00000000..1f279a78 --- /dev/null +++ b/bl-plugins/prism @@ -0,0 +1 @@ +Subproject commit 1f279a78b86fe70f6a318edcc552413952952608 diff --git a/bl-plugins/tinymce/languages/de_CH.json b/bl-plugins/tinymce/languages/de_CH.json index ee25c69d..65c4d504 100644 --- a/bl-plugins/tinymce/languages/de_CH.json +++ b/bl-plugins/tinymce/languages/de_CH.json @@ -6,5 +6,6 @@ }, "toolbar-top": "Obere Werkzeugleiste", "toolbar-bottom": "Untere Werkzeugleiste", - "codesample-languages": "Codesample Programmiersprachen" + "codesample-languages": "Codesample Programmiersprachen", + "codesample-supported-laguages": "Pragrammiersprachen die von Prism unterstützt werden." } diff --git a/bl-plugins/tinymce/languages/de_DE.json b/bl-plugins/tinymce/languages/de_DE.json index 7c4b2c5c..ae22b524 100644 --- a/bl-plugins/tinymce/languages/de_DE.json +++ b/bl-plugins/tinymce/languages/de_DE.json @@ -6,5 +6,6 @@ }, "toolbar-top": "Obere Werkzeugleiste", "toolbar-bottom": "Untere Werkzeugleiste", - "codesample-languages": "Codesample Programmiersprachen" + "codesample-languages": "Codesample Programmiersprachen", + "codesample-supported-laguages": "Pragrammiersprachen die von Prism unterstützt werden." } diff --git a/bl-plugins/tinymce/languages/en.json b/bl-plugins/tinymce/languages/en.json index c5400865..55b87e5a 100644 --- a/bl-plugins/tinymce/languages/en.json +++ b/bl-plugins/tinymce/languages/en.json @@ -6,5 +6,6 @@ }, "toolbar-top": "Toolbar top", "toolbar-bottom": "Toolbar bottom", - "codesample-languages": "Codesample languages" + "codesample-languages": "Codesample languages", + "codesample-supported-laguages": "Programming languages supported by Prism." } \ No newline at end of file diff --git a/bl-plugins/tinymce/plugin.php b/bl-plugins/tinymce/plugin.php index 22b71100..6a9ff9bb 100644 --- a/bl-plugins/tinymce/plugin.php +++ b/bl-plugins/tinymce/plugin.php @@ -22,12 +22,12 @@ class pluginTinymce extends Plugin { global $L; $html = '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= '
'; @@ -38,8 +38,9 @@ class pluginTinymce extends Plugin { if (strpos($this->getValue('plugins'), 'codesample') !== false) { $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; + $html .= ''.$L->get('codesample-supported-laguages').''; $html .= '
'; } From 4c44e48ffcfe0fcf23b64f1a9bbf833f8631fc76 Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:08:11 +0100 Subject: [PATCH 04/10] description on settings page added --- .gitignore | 1 + bl-plugins/tinymce/plugin.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 878fac3f..4520d156 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ bl-themes/tagg bl-themes/small bl-themes/future-imperfect bl-themes/social-network +bl-plugins/prism diff --git a/bl-plugins/tinymce/plugin.php b/bl-plugins/tinymce/plugin.php index 6a9ff9bb..f8701f2a 100644 --- a/bl-plugins/tinymce/plugin.php +++ b/bl-plugins/tinymce/plugin.php @@ -21,7 +21,11 @@ class pluginTinymce extends Plugin { { global $L; - $html = '
'; + $html = ''; + + $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; From 9ed96fc771bc7a53a3432a965ab915a03a517d5c Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:16:05 +0100 Subject: [PATCH 05/10] revert change in gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4520d156..878fac3f 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,3 @@ bl-themes/tagg bl-themes/small bl-themes/future-imperfect bl-themes/social-network -bl-plugins/prism From 381cfa5cb7a4690a8d1bc605f58e884000994f85 Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:18:59 +0100 Subject: [PATCH 06/10] revert changes in htaccess --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 687ddee1..35995c8a 100644 --- a/.htaccess +++ b/.htaccess @@ -6,7 +6,7 @@ AddDefaultCharset UTF-8 RewriteEngine on # Base directory -RewriteBase /bludit/ +#RewriteBase / # Deny direct access to the next directories RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L] From bd15f96d066835126efab1336c41e269a53ea7dd Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:19:39 +0100 Subject: [PATCH 07/10] remove prism plugin --- bl-plugins/prism | 1 - 1 file changed, 1 deletion(-) delete mode 160000 bl-plugins/prism diff --git a/bl-plugins/prism b/bl-plugins/prism deleted file mode 160000 index 1f279a78..00000000 --- a/bl-plugins/prism +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1f279a78b86fe70f6a318edcc552413952952608 From d68b6e9469110e259a3e5f54d34311ec0b2f6a7c Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:21:54 +0100 Subject: [PATCH 08/10] json formated --- bl-plugins/tinymce/languages/de_CH.json | 5 ++--- bl-plugins/tinymce/languages/de_DE.json | 7 +++---- bl-plugins/tinymce/languages/en.json | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bl-plugins/tinymce/languages/de_CH.json b/bl-plugins/tinymce/languages/de_CH.json index 65c4d504..92c12987 100644 --- a/bl-plugins/tinymce/languages/de_CH.json +++ b/bl-plugins/tinymce/languages/de_CH.json @@ -1,6 +1,5 @@ { - "plugin-data": - { + "plugin-data": { "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, @@ -8,4 +7,4 @@ "toolbar-bottom": "Untere Werkzeugleiste", "codesample-languages": "Codesample Programmiersprachen", "codesample-supported-laguages": "Pragrammiersprachen die von Prism unterstützt werden." -} +} \ No newline at end of file diff --git a/bl-plugins/tinymce/languages/de_DE.json b/bl-plugins/tinymce/languages/de_DE.json index ae22b524..92c12987 100644 --- a/bl-plugins/tinymce/languages/de_DE.json +++ b/bl-plugins/tinymce/languages/de_DE.json @@ -1,11 +1,10 @@ { - "plugin-data": - { + "plugin-data": { "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, "toolbar-top": "Obere Werkzeugleiste", - "toolbar-bottom": "Untere Werkzeugleiste", + "toolbar-bottom": "Untere Werkzeugleiste", "codesample-languages": "Codesample Programmiersprachen", "codesample-supported-laguages": "Pragrammiersprachen die von Prism unterstützt werden." -} +} \ No newline at end of file diff --git a/bl-plugins/tinymce/languages/en.json b/bl-plugins/tinymce/languages/en.json index 55b87e5a..6f374834 100644 --- a/bl-plugins/tinymce/languages/en.json +++ b/bl-plugins/tinymce/languages/en.json @@ -1,6 +1,5 @@ { - "plugin-data": - { + "plugin-data": { "name": "TinyMCE", "description": "HTML Editor for formatting content. Recommended for the users who don't want to work with Markdown code." }, From a1e6443cc8214b4b427c1b1bd281fda7e2384870 Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:23:14 +0100 Subject: [PATCH 09/10] json formated --- bl-plugins/tinymce/languages/de_CH.json | 3 ++- bl-plugins/tinymce/languages/de_DE.json | 3 ++- bl-plugins/tinymce/languages/en.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bl-plugins/tinymce/languages/de_CH.json b/bl-plugins/tinymce/languages/de_CH.json index 92c12987..c798574a 100644 --- a/bl-plugins/tinymce/languages/de_CH.json +++ b/bl-plugins/tinymce/languages/de_CH.json @@ -1,5 +1,6 @@ { - "plugin-data": { + "plugin-data": + { "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, diff --git a/bl-plugins/tinymce/languages/de_DE.json b/bl-plugins/tinymce/languages/de_DE.json index 92c12987..c798574a 100644 --- a/bl-plugins/tinymce/languages/de_DE.json +++ b/bl-plugins/tinymce/languages/de_DE.json @@ -1,5 +1,6 @@ { - "plugin-data": { + "plugin-data": + { "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, diff --git a/bl-plugins/tinymce/languages/en.json b/bl-plugins/tinymce/languages/en.json index 6f374834..113526bc 100644 --- a/bl-plugins/tinymce/languages/en.json +++ b/bl-plugins/tinymce/languages/en.json @@ -1,5 +1,6 @@ { - "plugin-data": { + "plugin-data": + { "name": "TinyMCE", "description": "HTML Editor for formatting content. Recommended for the users who don't want to work with Markdown code." }, From 17a3fcf7796a271b33322f7d3cee60917939d55d Mon Sep 17 00:00:00 2001 From: MrReSc Date: Sun, 20 Dec 2020 08:24:20 +0100 Subject: [PATCH 10/10] remove whitespace --- bl-plugins/tinymce/languages/de_CH.json | 2 +- bl-plugins/tinymce/languages/de_DE.json | 2 +- bl-plugins/tinymce/languages/en.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bl-plugins/tinymce/languages/de_CH.json b/bl-plugins/tinymce/languages/de_CH.json index c798574a..b451bc8f 100644 --- a/bl-plugins/tinymce/languages/de_CH.json +++ b/bl-plugins/tinymce/languages/de_CH.json @@ -1,5 +1,5 @@ { - "plugin-data": + "plugin-data": { "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." diff --git a/bl-plugins/tinymce/languages/de_DE.json b/bl-plugins/tinymce/languages/de_DE.json index c798574a..b451bc8f 100644 --- a/bl-plugins/tinymce/languages/de_DE.json +++ b/bl-plugins/tinymce/languages/de_DE.json @@ -1,5 +1,5 @@ { - "plugin-data": + "plugin-data": { "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." diff --git a/bl-plugins/tinymce/languages/en.json b/bl-plugins/tinymce/languages/en.json index 113526bc..55b87e5a 100644 --- a/bl-plugins/tinymce/languages/en.json +++ b/bl-plugins/tinymce/languages/en.json @@ -1,5 +1,5 @@ { - "plugin-data": + "plugin-data": { "name": "TinyMCE", "description": "HTML Editor for formatting content. Recommended for the users who don't want to work with Markdown code."