From c61268f1f2bd64d6866fd50218f9c898a6bc49c5 Mon Sep 17 00:00:00 2001 From: mic Date: Sat, 4 May 2024 00:00:31 +0200 Subject: [PATCH] prepending * to menutitle if custom prompt needed --- js/mzta-menus.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/js/mzta-menus.js b/js/mzta-menus.js index 4abdb395..708073c8 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -118,7 +118,7 @@ export class mzta_Menus { browser.menus.create({ id: id, - title: browser.i18n.getMessage(id), + title: this.getCustomTextAttribute(id) + browser.i18n.getMessage(id), contexts: this.getContexts(id), parentId: root }); @@ -151,6 +151,17 @@ export class mzta_Menus { } } - + + getCustomTextAttribute(id){ + const curr_prompt = defaultPrompts.find(p => p.id === id); + if (!curr_prompt) { + return ""; + } + if(curr_prompt.need_custom_text === 1){ + return "*"; + }else{ + return ""; + } + } } \ No newline at end of file