diff --git a/omega-locales/en_US/LC_MESSAGES/omega-web.po b/omega-locales/en_US/LC_MESSAGES/omega-web.po index 047aea8..11dd9fd 100644 --- a/omega-locales/en_US/LC_MESSAGES/omega-web.po +++ b/omega-locales/en_US/LC_MESSAGES/omega-web.po @@ -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" diff --git a/omega-locales/zh_CN/LC_MESSAGES/omega-web.po b/omega-locales/zh_CN/LC_MESSAGES/omega-web.po index 5b844a1..3958438 100644 --- a/omega-locales/zh_CN/LC_MESSAGES/omega-web.po +++ b/omega-locales/zh_CN/LC_MESSAGES/omega-web.po @@ -248,6 +248,9 @@ msgstr "右键菜单中,可检查网页元素所使用的代理。" msgid "options_addConditionsToBottom" msgstr "把以弹出菜单方式创建的规则添加到列表末尾。" +msgid "options_showResultProfileOnActionBadgeText" +msgstr "将最终使用的情景模式名称显示到徽标上。" + msgid "options_group_keyboardShortcut" msgstr "键盘快捷键" diff --git a/omega-target-chromium-extension/src/coffee/background.coffee b/omega-target-chromium-extension/src/coffee/background.coffee index 58e680d..1a9fa7f 100644 --- a/omega-target-chromium-extension/src/coffee/background.coffee +++ b/omega-target-chromium-extension/src/coffee/background.coffee @@ -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 diff --git a/omega-target-chromium-extension/src/module/tabs.coffee b/omega-target-chromium-extension/src/module/tabs.coffee index 5ad46ac..8fc0dbd 100644 --- a/omega-target-chromium-extension/src/module/tabs.coffee +++ b/omega-target-chromium-extension/src/module/tabs.coffee @@ -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) diff --git a/omega-target/src/default_options.coffee b/omega-target/src/default_options.coffee index 4ae32bd..0cd5c86 100644 --- a/omega-target/src/default_options.coffee +++ b/omega-target/src/default_options.coffee @@ -8,6 +8,7 @@ module.exports = -> "-confirmDeletion": true "-showInspectMenu": true "-addConditionsToBottom": false + "-showResultProfileOnActionBadgeText": false "-showExternalProfile": true "-downloadInterval": 1440 "+proxy": diff --git a/omega-web/src/partials/ui.jade b/omega-web/src/partials/ui.jade index 14c6bdd..3a5b814 100644 --- a/omega-web/src/partials/ui.jade +++ b/omega-web/src/partials/ui.jade @@ -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