From 687c9a6690535ac88c8a3446717f0956f22aba7b Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 12 Dec 2023 17:58:17 +0100 Subject: [PATCH] feature: color-styled tables in tinymce editor --- admin/template/style.css | 7 ++++++- system/templates/tinymce.html.twig | 6 ++++++ templates/kathrine/style.css | 5 +++++ templates/tibiacom/basic.css | 5 +++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/admin/template/style.css b/admin/template/style.css index defc34f7..0e425338 100644 --- a/admin/template/style.css +++ b/admin/template/style.css @@ -7,4 +7,9 @@ .sidebar-mini.sidebar-collapse .menu-text { display: none; -} \ No newline at end of file +} + +.myaac-table tbody tr:nth-child(even) {background: #FFF} /* light border */ +.myaac-table tbody tr:nth-child(odd) {background: #CCC} /* dark border */ +.myaac-table thead td {background: #000000; color: #ffffff !important;} /* vdark border */ +.myaac-table tfoot td {background: #000000; color: #ffffff !important;} /* vdark border */ diff --git a/system/templates/tinymce.html.twig b/system/templates/tinymce.html.twig index 02ad29bb..370bdeec 100644 --- a/system/templates/tinymce.html.twig +++ b/system/templates/tinymce.html.twig @@ -6,6 +6,7 @@ function tinymceInit() { tinymce.init({ selector: "#editor", + content_css: '{{ constant('ADMIN_URL') }}template/style.css', theme: "silver", plugins: 'preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help code emoticons', toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code', @@ -17,6 +18,11 @@ relative_urls: true, document_base_url: "{{ constant('BASE_URL') }}", + table_class_list: [ + {title: 'None', value: ''}, + {title: 'Colored Table', value: 'myaac-table'}, + ], + setup: function (ed) { ed.on('NodeChange', function (e) { if (ed.getContent() !== lastContent) { diff --git a/templates/kathrine/style.css b/templates/kathrine/style.css index a021b1d9..584f6d36 100644 --- a/templates/kathrine/style.css +++ b/templates/kathrine/style.css @@ -11,6 +11,11 @@ body color: #373737; } +.myaac-table tbody tr:nth-child(even) {background: #e5e3d7} /* light border */ +.myaac-table tbody tr:nth-child(odd) {background: #d0cdb4} /* dark border */ +.myaac-table thead td {background: #afab89; color: #ffffff !important;} /* vdark border */ +.myaac-table tfoot td {background: #afab89; color: #ffffff !important;} /* vdark border */ + #page { width: 780px; diff --git a/templates/tibiacom/basic.css b/templates/tibiacom/basic.css index 3d260a97..fc43b736 100644 --- a/templates/tibiacom/basic.css +++ b/templates/tibiacom/basic.css @@ -11,6 +11,11 @@ img { border: none; } +.myaac-table tbody tr:nth-child(even) {background: #F1E0C6} /* light border */ +.myaac-table tbody tr:nth-child(odd) {background: #D4C0A1} /* dark border */ +.myaac-table thead td {background: #505050; color: #ffffff !important;} /* vdark border */ +.myaac-table tfoot td {background: #505050; color: #ffffff !important;} /* vdark border */ + #ArtworkHelper { text-align: center; background-position: top center;