Compare commits

...

2 Commits

Author SHA1 Message Date
Esenjin_Asakha fbc0b6f741 Merge pull request 'Merci Xefir ?!!' (#15) from color into master
Reviewed-on: #15
2024-02-04 13:58:20 +00:00
Esenjin 88e072dc8e Merci Xefir ?!! 2024-02-04 14:56:40 +01:00
2 changed files with 68 additions and 38 deletions

View File

@ -53,6 +53,7 @@ api.onToolbarCreate(toolbar => {
// EXTRAS
api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "bleu_color",
action: "bleucolor",
icon: "palette",
label: "bleu_color_button"
@ -60,6 +61,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
});
api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "rose_color",
action: "rosecolor",
icon: "palette",
label: "rose_color_button"
@ -67,6 +69,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
});
api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "jaune_color",
action: "jaunecolor",
icon: "palette",
label: "jaune_color_button"
@ -74,6 +77,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
});
api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "orange_color",
action: "orangecolor",
icon: "palette",
label: "orange_color_button"
@ -81,6 +85,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
});
api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "rouge_color",
action: "rougecolor",
icon: "palette",
label: "rouge_color_button"
@ -88,6 +93,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
});
api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "vert_color",
action: "vertcolor",
icon: "palette",
label: "vert_color_button"
@ -126,51 +132,52 @@ if (!translations.composer) {
translations.composer = {};
}
// Define default values for buttons
const defaultButtons = {
underline_button: "Souligner",
underline_text: "Texte",
translations.composer.underline_button_title = settings.underline_button;
translations.composer.underline_text =
settings.underline_text;
strikethrough_button: "Barrer",
strikethrough_text: "Texte",
translations.composer.align_center_button_title = settings.align_center_button;
translations.composer.align_center_text =
settings.align_center_text;
superscript_button: "Exposant",
superscript_text: "Texte",
translations.composer.align_justify_button_title = settings.align_justify_button;
translations.composer.align_justify_text =
settings.align_justify_text;
subscript_button: "Indice",
subscript_text: "Texte",
translations.composer.strikethrough_button_title = settings.strikethrough_button;
translations.composer.strikethrough_text =
settings.strikethrough_text;
translations.composer.superscript_button_title = settings.superscript_button;
translations.composer.superscript_text =
settings.superscript_text;
align_center_button: "Centrer",
align_center_text: "Texte",
translations.composer.subscript_button_title = settings.subscript_button;
translations.composer.subscript_text =
settings.subscript_text;
align_justify_button: "Justifier",
align_justify_text: "Texte",
translations.bleu_color_button = settings.bleu_color_button;
translations.composer.bleu_color_text =
settings.bleu_color_text;
// Définissez les boutons de couleur avec un traitement spécial
bleu_color_button: "Colorer en bleu",
bleu_color_text: "Texte",
translations.rose_color_button = settings.rose_color_button;
translations.composer.rose_color_text =
settings.rose_color_text;
rose_color_button: "Colorer en rose",
rose_color_text: "Texte",
translations.jaune_color_button = settings.jaune_color_button;
translations.composer.jaune_color_text =
settings.jaune_color_text;
jaune_color_button: "Colorer en jaune",
jaune_color_text: "Texte",
translations.orange_color_button = settings.orange_color_button;
translations.composer.orange_color_text =
settings.orange_color_text;
orangecolor_button: "Colorer en orange",
orangecolor_text: "Texte",
translations.rouge_color_button = settings.rouge_color_button;
translations.composer.rouge_color_text =
settings.rouge_color_text;
rouge_color_button: "Colorer en rouge",
rouge_color_text: "Texte",
translations.vert_color_button = settings.vert_color_button;
translations.composer.vert_color_text =
settings.vert_color_text;
vert_color_button: "Colorer en vert",
vert_color_text: "Texte"
};
// Assign default values if translations are not present
Object.keys(defaultButtons).forEach(key => {
const settingKey = key.replace("_button", "");
translations.composer[key + "_title"] = settings[settingKey] && settings[settingKey].default ? settings[settingKey].default : defaultButtons[key];
translations.composer[key + "_text"] = settings[key + "_text"] && settings[key + "_text"].default ? settings[key + "_text"].default : defaultButtons[key];
});
</script>
</script>

View File

@ -2,99 +2,122 @@ underline_button:
default: "Souligner"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
underline_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
align_center_button:
default: "Centrer"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
align_center_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
align_justify_button:
default: "Justifier"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
align_justify_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
strikethrough_button:
default: "Barrer"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
strikethrough_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
superscript_button:
default: "Exposant"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
superscript_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
subscript_button:
default: "Indice"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
subscript_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
bleu_color_button:
default: "Colorer en bleu"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
bleu_color_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
rose_color_button:
default: "Colorer en rose"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
rose_color_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
jaune_color_button:
default: "Colorer en jaune"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
jaune_color_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
orange_color_button:
default: "Colorer en orange"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
orange_color_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
rouge_color_button:
default: "Colorer en rouge"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
rouge_color_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
vert_color_button:
default: "Colorer en vert"
description:
en: Enter the text for the title of the button in the composer.
fr: Saisissez le texte du titre du bouton dans le compositeur.
vert_color_text:
default: "Texte"
description:
en: Enter the placeholder text that appears in the composer after the user clicks the button.
fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton.
Svg_icons:
type: 'list'
list_type: 'compact'