mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-03-10 15:38:12 -04:00
Add an option to display Badge text on the icon in the toolbar #101
This commit is contained in:
parent
fa756d806a
commit
fca91b8b36
@ -266,6 +266,9 @@ msgstr "Allow inspecting proxy used for page elements via context menu."
|
||||
msgid "options_addConditionsToBottom"
|
||||
msgstr "Put new conditions added using the popup to the bottom of the list."
|
||||
|
||||
msgid "options_showResultProfileOnActionBadgeText"
|
||||
msgstr "show the result profile's name on the action badge text."
|
||||
|
||||
msgid "options_group_keyboardShortcut"
|
||||
msgstr "Keyboard Shortcut"
|
||||
|
||||
|
@ -248,6 +248,9 @@ msgstr "右键菜单中,可检查网页元素所使用的代理。"
|
||||
msgid "options_addConditionsToBottom"
|
||||
msgstr "把以弹出菜单方式创建的规则添加到列表末尾。"
|
||||
|
||||
msgid "options_showResultProfileOnActionBadgeText"
|
||||
msgstr "将最终使用的情景模式名称显示到徽标上。"
|
||||
|
||||
msgid "options_group_keyboardShortcut"
|
||||
msgstr "键盘快捷键"
|
||||
|
||||
|
@ -194,6 +194,8 @@ zeroBackground = (zeroStorage, opts) ->
|
||||
shortTitle = 'Omega: ' + currentName # TODO: I18n.
|
||||
if profile.name != currentName
|
||||
shortTitle += ' => ' + profile.name # TODO: I18n.
|
||||
if options._options['-showResultProfileOnActionBadgeText']
|
||||
badgeText = profile.name
|
||||
|
||||
return {
|
||||
title: chrome.i18n.getMessage('browserAction_titleWithResult', [
|
||||
@ -202,6 +204,7 @@ zeroBackground = (zeroStorage, opts) ->
|
||||
details
|
||||
])
|
||||
|
||||
badgeText: badgeText
|
||||
shortTitle: shortTitle
|
||||
icon: icon
|
||||
resultColor: resultColor
|
||||
|
@ -53,9 +53,15 @@ class ChromeTabs
|
||||
@actionForUrl(tab.url).then((action) =>
|
||||
if not action
|
||||
@clearIcon tab.id
|
||||
chrome.action.setBadgeText?(text: '', tabId: tab.id)
|
||||
return
|
||||
@setIcon(action.icon, tab.id)
|
||||
title = if @_canSetPopup() then action.title else action.shortTitle
|
||||
if action.badgeText
|
||||
chrome.action.setBadgeText?(
|
||||
text: action.badgeText.substring(0,3),
|
||||
tabId: tab.id
|
||||
)
|
||||
return chrome.action.setTitle({title: title, tabId: tab.id})
|
||||
).catch((e) ->
|
||||
console.log('error:', e)
|
||||
|
@ -8,6 +8,7 @@ module.exports = ->
|
||||
"-confirmDeletion": true
|
||||
"-showInspectMenu": true
|
||||
"-addConditionsToBottom": false
|
||||
"-showResultProfileOnActionBadgeText": false
|
||||
"-showExternalProfile": true
|
||||
"-downloadInterval": 1440
|
||||
"+proxy":
|
||||
|
@ -18,6 +18,10 @@ section.settings-group
|
||||
label
|
||||
input(type='checkbox' ng-model='options["-addConditionsToBottom"]')
|
||||
span {{'options_addConditionsToBottom' | tr}}
|
||||
div.checkbox
|
||||
label
|
||||
input(type='checkbox' ng-model='options["-showResultProfileOnActionBadgeText"]')
|
||||
span {{'options_showResultProfileOnActionBadgeText' | tr}}
|
||||
section.settings-group
|
||||
h3 {{'options_group_keyboardShortcut' | tr}}
|
||||
p
|
||||
|
Loading…
Reference in New Issue
Block a user