Compare commits

..

2 Commits

Author SHA1 Message Date
fbc0b6f741 Merge pull request 'Merci Xefir ?!!' (#15) from color into master
Reviewed-on: #15
2024-02-04 13:58:20 +00:00
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 // EXTRAS
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
id: "bleu_color",
action: "bleucolor", action: "bleucolor",
icon: "palette", icon: "palette",
label: "bleu_color_button" label: "bleu_color_button"
@ -60,6 +61,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
}); });
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
id: "rose_color",
action: "rosecolor", action: "rosecolor",
icon: "palette", icon: "palette",
label: "rose_color_button" label: "rose_color_button"
@ -67,6 +69,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
}); });
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
id: "jaune_color",
action: "jaunecolor", action: "jaunecolor",
icon: "palette", icon: "palette",
label: "jaune_color_button" label: "jaune_color_button"
@ -74,6 +77,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
}); });
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
id: "orange_color",
action: "orangecolor", action: "orangecolor",
icon: "palette", icon: "palette",
label: "orange_color_button" label: "orange_color_button"
@ -81,6 +85,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
}); });
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
id: "rouge_color",
action: "rougecolor", action: "rougecolor",
icon: "palette", icon: "palette",
label: "rouge_color_button" label: "rouge_color_button"
@ -88,6 +93,7 @@ api.addToolbarPopupMenuOptionsCallback(() => {
}); });
api.addToolbarPopupMenuOptionsCallback(() => { api.addToolbarPopupMenuOptionsCallback(() => {
return { return {
id: "vert_color",
action: "vertcolor", action: "vertcolor",
icon: "palette", icon: "palette",
label: "vert_color_button" label: "vert_color_button"
@ -126,51 +132,52 @@ if (!translations.composer) {
translations.composer = {}; translations.composer = {};
} }
// Define default values for buttons translations.composer.underline_button_title = settings.underline_button;
const defaultButtons = { translations.composer.underline_text =
underline_button: "Souligner", settings.underline_text;
underline_text: "Texte",
strikethrough_button: "Barrer", translations.composer.align_center_button_title = settings.align_center_button;
strikethrough_text: "Texte", translations.composer.align_center_text =
settings.align_center_text;
superscript_button: "Exposant", translations.composer.align_justify_button_title = settings.align_justify_button;
superscript_text: "Texte", translations.composer.align_justify_text =
settings.align_justify_text;
subscript_button: "Indice", translations.composer.strikethrough_button_title = settings.strikethrough_button;
subscript_text: "Texte", translations.composer.strikethrough_text =
settings.strikethrough_text;
align_center_button: "Centrer", translations.composer.superscript_button_title = settings.superscript_button;
align_center_text: "Texte", translations.composer.superscript_text =
settings.superscript_text;
align_justify_button: "Justifier", translations.composer.subscript_button_title = settings.subscript_button;
align_justify_text: "Texte", translations.composer.subscript_text =
settings.subscript_text;
// Définissez les boutons de couleur avec un traitement spécial translations.bleu_color_button = settings.bleu_color_button;
bleu_color_button: "Colorer en bleu", translations.composer.bleu_color_text =
bleu_color_text: "Texte", settings.bleu_color_text;
rose_color_button: "Colorer en rose", translations.rose_color_button = settings.rose_color_button;
rose_color_text: "Texte", translations.composer.rose_color_text =
settings.rose_color_text;
jaune_color_button: "Colorer en jaune", translations.jaune_color_button = settings.jaune_color_button;
jaune_color_text: "Texte", translations.composer.jaune_color_text =
settings.jaune_color_text;
orangecolor_button: "Colorer en orange", translations.orange_color_button = settings.orange_color_button;
orangecolor_text: "Texte", translations.composer.orange_color_text =
settings.orange_color_text;
rouge_color_button: "Colorer en rouge", translations.rouge_color_button = settings.rouge_color_button;
rouge_color_text: "Texte", translations.composer.rouge_color_text =
settings.rouge_color_text;
vert_color_button: "Colorer en vert", translations.vert_color_button = settings.vert_color_button;
vert_color_text: "Texte" translations.composer.vert_color_text =
}; settings.vert_color_text;
// 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" default: "Souligner"
description: description:
en: Enter the text for the title of the button in the composer. 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: underline_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: align_center_button:
default: "Centrer" default: "Centrer"
description: description:
en: Enter the text for the title of the button in the composer. 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: align_center_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: align_justify_button:
default: "Justifier" default: "Justifier"
description: description:
en: Enter the text for the title of the button in the composer. 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: align_justify_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: strikethrough_button:
default: "Barrer" default: "Barrer"
description: description:
en: Enter the text for the title of the button in the composer. 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: strikethrough_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: superscript_button:
default: "Exposant" default: "Exposant"
description: description:
en: Enter the text for the title of the button in the composer. 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: superscript_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: subscript_button:
default: "Indice" default: "Indice"
description: description:
en: Enter the text for the title of the button in the composer. 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: subscript_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: bleu_color_button:
default: "Colorer en bleu" default: "Colorer en bleu"
description: description:
en: Enter the text for the title of the button in the composer. 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: bleu_color_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: rose_color_button:
default: "Colorer en rose" default: "Colorer en rose"
description: description:
en: Enter the text for the title of the button in the composer. 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: rose_color_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: jaune_color_button:
default: "Colorer en jaune" default: "Colorer en jaune"
description: description:
en: Enter the text for the title of the button in the composer. 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: jaune_color_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: orange_color_button:
default: "Colorer en orange" default: "Colorer en orange"
description: description:
en: Enter the text for the title of the button in the composer. 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: orange_color_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: rouge_color_button:
default: "Colorer en rouge" default: "Colorer en rouge"
description: description:
en: Enter the text for the title of the button in the composer. 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: rouge_color_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: vert_color_button:
default: "Colorer en vert" default: "Colorer en vert"
description: description:
en: Enter the text for the title of the button in the composer. 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: vert_color_text:
default: "Texte" default: "Texte"
description: description:
en: Enter the placeholder text that appears in the composer after the user clicks the button. 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: Svg_icons:
type: 'list' type: 'list'
list_type: 'compact' list_type: 'compact'