From 1e889da3fddd1ab7580704a453ed30d9d83fe696 Mon Sep 17 00:00:00 2001 From: "iunctis.fr" Date: Mon, 10 Aug 2020 15:21:38 +0200 Subject: [PATCH 1/6] Update settings.yml --- settings.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/settings.yml b/settings.yml index 2382838..39b4ef0 100644 --- a/settings.yml +++ b/settings.yml @@ -30,6 +30,14 @@ align_justify_text: default: "Text" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. +bbcode_color_button: + default: "Color" + description: + en: Enter the text for the title of the button in the composer. +bbcode_color_text: + default: "Text" + description: + en: Enter the placeholder text that appears in the composer after the user clicks the button. strikethrough_button: default: "Strike-through" description: From 01de9708d0311dcac7ed7d304d3eff6134ae7fe8 Mon Sep 17 00:00:00 2001 From: "iunctis.fr" Date: Mon, 10 Aug 2020 15:23:12 +0200 Subject: [PATCH 2/6] Update settings.yml --- settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.yml b/settings.yml index 39b4ef0..7110f3e 100644 --- a/settings.yml +++ b/settings.yml @@ -82,6 +82,6 @@ columns_text: Svg_icons: type: 'list' list_type: 'compact' - default: 'fa-align-center|fa-align-right|fa-align-justify|fa-strikethrough|fa-underline|fa-indent|fa-columns|fa-superscript|fa-subscript' + default: 'fa-align-center|fa-align-right|fa-align-justify|fa-strikethrough|fa-underline|fa-indent|fa-columns|fa-superscript|fa-subscript|fa-palette' description: en: "Include FontAwesome 5 icon classes for each icon used in the list." From c5b28c8651358562f0bbc53b69ab347d0fd0dd01 Mon Sep 17 00:00:00 2001 From: "iunctis.fr" Date: Mon, 10 Aug 2020 15:24:38 +0200 Subject: [PATCH 3/6] Update head_tag.html --- desktop/head_tag.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/desktop/head_tag.html b/desktop/head_tag.html index d06c12f..31ae554 100644 --- a/desktop/head_tag.html +++ b/desktop/head_tag.html @@ -57,6 +57,14 @@ api.onToolbarCreate(toolbar => { perform: e => e.applySurround('[wrap="justify"]\n', '\n[/wrap]', 'align_justify_text') }); }); +api.onToolbarCreate(toolbar => { + toolbar.addButton({ + id: "bbcode_color_button", + group: "extras", + icon: "palette", + perform: e => e.applySurround('[color=#222]', '[/color]', 'bbcode_color_text') + }); +}); // EXTRAS api.addToolbarPopupMenuOptionsCallback(() => { @@ -113,6 +121,10 @@ translations.composer.align_justify_text = translations.composer.strikethrough_button_title = settings.strikethrough_button; translations.composer.strikethrough_text = settings.strikethrough_text; + +translations.composer.bbcode_color_button_title = settings.bbcode_color_button; +translations.composer.bbcode_color_text = + settings.bbcode_color_text; translations.composer.superscript_button_title = settings.superscript_button; translations.composer.superscript_text = From c521c18da4481bf7abb2f2d91e17a4933180914a Mon Sep 17 00:00:00 2001 From: "iunctis.fr" Date: Mon, 10 Aug 2020 15:26:49 +0200 Subject: [PATCH 4/6] Update head_tag.html --- mobile/head_tag.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mobile/head_tag.html b/mobile/head_tag.html index 15d015b..6daca3f 100644 --- a/mobile/head_tag.html +++ b/mobile/head_tag.html @@ -61,18 +61,26 @@ api.addToolbarPopupMenuOptionsCallback(() => { }; }); +api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "bbcodecolor", + icon: "palette", + label: "bbcode_color_button" + }; +}); + api.modifyClass("controller:composer", { actions: { strikethrough() { this.get("toolbarEvent").applySurround("", "", "strikethrough_text"); }, - superscript() { + superscript() { this.get("toolbarEvent").applySurround("", "", "superscript_text"); }, subscript() { this.get("toolbarEvent").applySurround("", "", "subscript_text"); }, - aligncenter() { + aligncenter() { this.get("toolbarEvent").applySurround('[wrap="center"]\n', '\n[/wrap]', "align_center_text"); }, alignright() { @@ -84,6 +92,9 @@ api.modifyClass("controller:composer", { floatleft() { this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text"); } + bbcodecolor() { + this.get("toolbarEvent").applySurround('[color=#222]', '[/color]', bbcode_color_text"); + } } }); @@ -131,5 +142,9 @@ translations.composer.columns_text = translations.float_left_button = settings.float_left_button; translations.composer.float_left_text = settings.float_left_text; + +translations.bbcode_color_button = settings.bbcode_color_button; +translations.composer.bbcode_color_text = + settings.bbcode_color_text; From 43f2190a89175eb7649679e4c73c0ac994ed5574 Mon Sep 17 00:00:00 2001 From: "iunctis.fr" Date: Mon, 10 Aug 2020 20:03:21 +0200 Subject: [PATCH 5/6] FIX: error on mobile javascript --- mobile/head_tag.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/head_tag.html b/mobile/head_tag.html index 6daca3f..a4565b1 100644 --- a/mobile/head_tag.html +++ b/mobile/head_tag.html @@ -91,9 +91,9 @@ api.modifyClass("controller:composer", { }, floatleft() { this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text"); - } + }, bbcodecolor() { - this.get("toolbarEvent").applySurround('[color=#222]', '[/color]', bbcode_color_text"); + this.get("toolbarEvent").applySurround('[color=#222]', '[/color]', "bbcode_color_text"); } } }); From f5f36199e6cd9d521ad741eadc341a33e1c6244b Mon Sep 17 00:00:00 2001 From: Esenjin Date: Sat, 3 Feb 2024 11:11:35 +0100 Subject: [PATCH 6/6] =?UTF-8?q?(-)=20=C3=A9l=C3=A9ments=20inutiles,=20(+)?= =?UTF-8?q?=20couleurs=20pr=C3=A9d=C3=A9finies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++-- desktop/head_tag.html | 114 +++++++++++++++++++++++++-------------- settings.yml | 123 ++++++++++++++++++++++++++++-------------- 3 files changed, 163 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index bb500c8..40246df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MD Composer Extras +# MD Composer ~~Extras~~ Color Plus Ultra This Discourse theme component adds formatting options to your Discourse composer. @@ -7,11 +7,12 @@ This Discourse theme component adds formatting options to your Discourse compose * superscript * subscript * center -* align right +* ~~align right~~ * justify -* float left -* float right -* columns. +* ~~float left~~ +* ~~float right~~ +* ~~columns~~. +* Colorer le texte en bleu, rose, jaune, orange, rouge et vert. These additions are responsive for desktops and phones, but not for horizon orientation or tablets. These additions have taken into consideration [Slick](https://github.com/discourse/Discourse-Slick-image-gallery), [Tiles](https://github.com/discourse/Discourse-Tiles-image-gallery), and [Events](https://github.com/angusmcleod/discourse-events) when determining what should be placed on the composer bar or in the composer pop out menu. @@ -63,3 +64,5 @@ I took some parts of the Iconified Header Links and Slick Image Gallery theme co https://meta.discourse.org/t/iconified-header-links/86307 (adding fa5 icons in the theme component) https://meta.discourse.org/t/slick-image-gallery/81952 (manager the translations inside the theme component) + +Modification de la branche `color` pour l'ajout de couleurs prédéfinies par l'association Camélia Studio : https://camelia-studio.org \ No newline at end of file diff --git a/desktop/head_tag.html b/desktop/head_tag.html index 31ae554..4eb6448 100644 --- a/desktop/head_tag.html +++ b/desktop/head_tag.html @@ -41,14 +41,6 @@ api.onToolbarCreate(toolbar => { perform: e => e.applySurround('[wrap="center"]\n', '\n[/wrap]', 'align_center_text') }); }); -api.onToolbarCreate(toolbar => { - toolbar.addButton({ - id: "align_right_button", - group: "extras", - icon: "align-right", - perform: e => e.applySurround('[wrap="right"]\n', '\n[/wrap]', 'align_right_text') - }); -}); api.onToolbarCreate(toolbar => { toolbar.addButton({ id: "align_justify_button", @@ -57,39 +49,71 @@ api.onToolbarCreate(toolbar => { perform: e => e.applySurround('[wrap="justify"]\n', '\n[/wrap]', 'align_justify_text') }); }); -api.onToolbarCreate(toolbar => { - toolbar.addButton({ - id: "bbcode_color_button", - group: "extras", - icon: "palette", - perform: e => e.applySurround('[color=#222]', '[/color]', 'bbcode_color_text') - }); -}); // EXTRAS api.addToolbarPopupMenuOptionsCallback(() => { return { - action: "floatleft", - icon: "indent", - label: "float_left_button" + action: "bleucolor", + icon: "palette", + label: "bleu_color_button" }; }); api.addToolbarPopupMenuOptionsCallback(() => { return { - action: "columns", - icon: "columns", - label: "columns_button" + action: "rosecolor", + icon: "palette", + label: "rose_color_button" + }; +}); +api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "jaunecolor", + icon: "palette", + label: "jaune_color_button" + }; +}); +api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "orangecolor", + icon: "palette", + label: "orange_color_button" + }; +}); +api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "rougecolor", + icon: "palette", + label: "rouge_color_button" + }; +}); +api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "vertcolor", + icon: "palette", + label: "vert_color_button" }; }); api.modifyClass("controller:composer", { actions: { - floatleft() { - this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text"); + bleucolor() { + this.get("toolbarEvent").applySurround('[color=#068EEF]', '[/color]', "bleu_color_text"); + }, + rosecolor() { + this.get("toolbarEvent").applySurround('[color=#EF06A0]', '[/color]', "rose_color_text"); + }, + jaunecolor() { + this.get("toolbarEvent").applySurround('[color=#EFC906]', '[/color]', "jaune_color_text"); + }, + orangecolor() { + this.get("toolbarEvent").applySurround('[color=#EF8806]', '[/color]', "orange_color_text"); + }, + rougecolor() { + this.get("toolbarEvent").applySurround('[color=#EF0606]', '[/color]', "rouge_color_text"); + }, + vertcolor() { + this.get("toolbarEvent").applySurround('[color=#2A821C]', '[/color]', "vert_color_text"); }, - columns() { - this.get("toolbarEvent").applySurround('[wrap="columns"]\n', '\n[/wrap]', "columns_text"); - } } }); @@ -110,10 +134,6 @@ translations.composer.align_center_button_title = settings.align_center_button; translations.composer.align_center_text = settings.align_center_text; -translations.composer.align_right_button_title = settings.align_right_button; -translations.composer.align_right_text = - settings.align_right_text; - translations.composer.align_justify_button_title = settings.align_justify_button; translations.composer.align_justify_text = settings.align_justify_text; @@ -121,10 +141,6 @@ translations.composer.align_justify_text = translations.composer.strikethrough_button_title = settings.strikethrough_button; translations.composer.strikethrough_text = settings.strikethrough_text; - -translations.composer.bbcode_color_button_title = settings.bbcode_color_button; -translations.composer.bbcode_color_text = - settings.bbcode_color_text; translations.composer.superscript_button_title = settings.superscript_button; translations.composer.superscript_text = @@ -134,12 +150,28 @@ translations.composer.subscript_button_title = settings.subscript_button; translations.composer.subscript_text = settings.subscript_text; -translations.columns_button = settings.columns_button; -translations.composer.columns_text = - settings.columns_text; +translations.composer.bleu_color_button_title = settings.bleu_color_button; +translations.composer.bleu_color_text = + settings.bleu_color_text; -translations.float_left_button = settings.float_left_button; -translations.composer.float_left_text = - settings.float_left_text; +translations.composer.rose_color_button_title = settings.rose_color_button; +translations.composer.rose_color_text = + settings.rose_color_text; + +translations.composer.jaune_color_button_title = settings.jaune_color_button; +translations.composer.jaune_color_text = + settings.jaune_color_text; + +translations.composer.orange_color_button_title = settings.orange_color_button; +translations.composer.orange_color_text = + settings.orange_color_text; + +translations.composer.rouge_color_button_title = settings.rouge_color_button; +translations.composer.rouge_color_text = + settings.rouge_color_text; + +translations.composer.vert_color_button_title = settings.vert_color_button; +translations.composer.vert_color_text = + settings.vert_color_text; diff --git a/settings.yml b/settings.yml index 7110f3e..c85c9fd 100644 --- a/settings.yml +++ b/settings.yml @@ -1,87 +1,128 @@ underline_button: - default: "Underline" + default: "Souligner" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. underline_text: - default: "Text" + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. align_center_button: - default: "Center" + default: "Centrer" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. align_center_text: - default: "Text" - description: - en: Enter the placeholder text that appears in the composer after the user clicks the button. -align_right_button: - default: "Align right" - description: - en: Enter the text for the title of the button in the composer. -align_right_text: - default: "Text" + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. align_justify_button: - default: "Justify" + default: "Justifier" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. align_justify_text: - default: "Text" - description: - en: Enter the placeholder text that appears in the composer after the user clicks the button. -bbcode_color_button: - default: "Color" - description: - en: Enter the text for the title of the button in the composer. -bbcode_color_text: - default: "Text" + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. strikethrough_button: - default: "Strike-through" + default: "Barrer" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. strikethrough_text: - default: "Text" - description: - en: Enter the placeholder text that appears in the composer after the user clicks the button. -float_left_button: - default: "Float left" - description: - en: Enter the text for the title of the button in the composer. -float_left_text: - default: "Text" + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. superscript_button: - default: "Superscript" + default: "Exposant" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. superscript_text: - default: "Text" + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. subscript_button: - default: "Subscript" + default: "Indice" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. subscript_text: - default: "Text" + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. -columns_button: - default: "Columns" +bleu_color_button: + default: "Colorer en bleu" description: + fr: Saisissez le texte du titre du bouton dans le compositeur. en: Enter the text for the title of the button in the composer. -columns_text: - default: "Use the closing tag to mark where the first column ends. The second column will autobreak." +bleu_color_text: + default: "Texte" description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. + en: Enter the placeholder text that appears in the composer after the user clicks the button. +rose_color_button: + default: "Colorer en rose" + description: + fr: Saisissez le texte du titre du bouton dans le compositeur. + en: Enter the text for the title of the button in the composer. +rose_color_text: + default: "Texte" + description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. + en: Enter the placeholder text that appears in the composer after the user clicks the button. +jaune_color_button: + default: "Colorer en jaune" + description: + fr: Saisissez le texte du titre du bouton dans le compositeur. + en: Enter the text for the title of the button in the composer. +jaune_color_text: + default: "Texte" + description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. + en: Enter the placeholder text that appears in the composer after the user clicks the button. +orange_color_button: + default: "Colorer en orange" + description: + fr: Saisissez le texte du titre du bouton dans le compositeur. + en: Enter the text for the title of the button in the composer. +orange_color_text: + default: "Texte" + description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. + en: Enter the placeholder text that appears in the composer after the user clicks the button. +rouge_color_button: + default: "Colorer en rouge" + description: + fr: Saisissez le texte du titre du bouton dans le compositeur. + en: Enter the text for the title of the button in the composer. +rouge_color_text: + default: "Texte" + description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. + en: Enter the placeholder text that appears in the composer after the user clicks the button. +vert_color_button: + default: "Colorer en vert" + description: + fr: Saisissez le texte du titre du bouton dans le compositeur. + en: Enter the text for the title of the button in the composer. +vert_color_text: + default: "Texte" + description: + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur ait cliqué sur le bouton. en: Enter the placeholder text that appears in the composer after the user clicks the button. Svg_icons: type: 'list' list_type: 'compact' - default: 'fa-align-center|fa-align-right|fa-align-justify|fa-strikethrough|fa-underline|fa-indent|fa-columns|fa-superscript|fa-subscript|fa-palette' + default: 'fa-align-center|fa-align-justify|fa-strikethrough|fa-underline|fa-indent|fa-superscript|fa-subscript|fa-palette' description: + fr: "Inclure les classes d'icônes FontAwesome 5 pour chaque icône utilisée dans la liste." en: "Include FontAwesome 5 icon classes for each icon used in the list."