|
17 | 17 | // Import DATA |
18 | 18 | const { app } = await chrome.storage.local.get('app'), |
19 | 19 | { sites } = await chrome.storage.local.get('sites') |
| 20 | + app.name = env.browser.displaysEnglish ? app.name : getMsg('appName') // for shorter notifs |
20 | 21 |
|
21 | 22 | // Export DEPENDENCIES to imported resources |
22 | 23 | icons.import({ app }) // for src's using app.urls.assetHost |
|
84 | 85 |
|
85 | 86 | // Run MAIN routine |
86 | 87 |
|
87 | | - const appName = env.browser.displaysEnglish ? app.name : getMsg('appName') // for shorter notifs |
88 | | - |
89 | 88 | // LOCALIZE extension title, set document lang |
90 | 89 | const menuTitle = document.querySelector('.menu-title') |
91 | 90 | menuTitle.innerText = getMsg(menuTitle.dataset.locale) |
|
103 | 102 | env.extensionWasDisabled = extensionIsDisabled() |
104 | 103 | masterToggle.switch.classList.toggle('on') ; settings.save('extensionDisabled', !config.extensionDisabled) |
105 | 104 | Object.keys(sync).forEach(key => sync[key]()) // sync fade + storage to UI |
106 | | - if (env.extensionWasDisabled ^ extensionIsDisabled()) notify(`${appName} 🧩 ${ |
| 105 | + if (env.extensionWasDisabled ^ extensionIsDisabled()) notify(`${app.name} 🧩 ${ |
107 | 106 | getMsg(`state_${ extensionIsDisabled() ? 'off' : 'on' }`).toUpperCase()}`) |
108 | 107 | } |
109 | 108 |
|
|
148 | 147 | // Create SITE SETTINGS label |
149 | 148 | const ssLabel = { // category label row |
150 | 149 | div: dom.create.elem('div', { id: 'site-settings', class: 'menu-entry highlight-on-hover', |
151 | | - title: `${getMsg('helptip_enableDisable')} ${appName} ${getMsg('helptip_perSite')}` |
| 150 | + title: `${getMsg('helptip_enableDisable')} ${app.name} ${getMsg('helptip_perSite')}` |
152 | 151 | }), |
153 | 152 | label: dom.create.elem('label', { class: 'menu-icon' }), labelSpan: dom.create.elem('span'), |
154 | 153 | caret: icons.create('caretDown', { size: 11, class: 'caret', |
|
170 | 169 | // Init entry's elems |
171 | 170 | const ssEntry = { |
172 | 171 | div: dom.create.elem('div', { class: 'menu-entry highlight-on-hover', |
173 | | - title: `${getMsg('helptip_run')} ${appName} on ${sites[site].urls.homepage}` }), |
| 172 | + title: `${getMsg('helptip_run')} ${app.name} on ${sites[site].urls.homepage}` }), |
174 | 173 | switch: dom.create.elem('div', { class: 'toggle menu-icon' }), |
175 | 174 | track: dom.create.elem('span', { class: 'track' }), label: dom.create.elem('span'), |
176 | 175 | favicon: dom.create.elem('img', { |
|
189 | 188 | settings.save(`${site}Disabled`, !config[`${site}Disabled`]) ; sync.configToUI() |
190 | 189 | if (env.site == site) { // fade/notify if setting of active site toggled |
191 | 190 | sync.fade() |
192 | | - if (env.extensionWasDisabled ^ extensionIsDisabled()) notify(`${appName} 🧩 ${ |
| 191 | + if (env.extensionWasDisabled ^ extensionIsDisabled()) notify(`${app.name} 🧩 ${ |
193 | 192 | getMsg(`state_${ extensionIsDisabled() ? 'off' : 'on' }`).toUpperCase()}`) |
194 | 193 | } |
195 | 194 | } |
|
221 | 220 |
|
222 | 221 | // Create/append ABOUT footer button |
223 | 222 | const aboutSpan = dom.create.elem('span', { |
224 | | - title: `${getMsg('menuLabel_about')} ${getMsg('appName')}`, |
| 223 | + title: `${getMsg('menuLabel_about')} ${getMsg('app.name')}`, |
225 | 224 | class: 'menu-icon highlight-on-hover', style: 'right:30px ; padding-top: 2px' }) |
226 | 225 | const aboutIcon = icons.create('questionMark', { width: 15, height: 13, style: 'margin-bottom: 0.04rem' }) |
227 | 226 | aboutSpan.onclick = () => { chrome.runtime.sendMessage({ action: 'showAbout' }) ; close() } |
|
0 commit comments