From 49d434b48191d76cd8b0e7350d13a28279fddf28 Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Tue, 3 Feb 2015 13:43:37 +0800 Subject: [PATCH] Add help and configuration for keyboard shortcut. --- omega-i18n/en/messages.json | 14 +++++++++++++- omega-i18n/zh_CN/messages.json | 14 +++++++++++++- omega-i18n/zh_HK/messages.json | 14 +++++++++++++- omega-i18n/zh_TW/messages.json | 14 +++++++++++++- .../omega_target_web.coffee | 2 ++ omega-web/src/omega/controllers/master.coffee | 2 ++ omega-web/src/partials/profile_pac.jade | 2 +- omega-web/src/partials/ui.jade | 11 +++++++++++ 8 files changed, 68 insertions(+), 5 deletions(-) diff --git a/omega-i18n/en/messages.json b/omega-i18n/en/messages.json index 4069ba2..843e1f1 100644 --- a/omega-i18n/en/messages.json +++ b/omega-i18n/en/messages.json @@ -160,6 +160,18 @@ "options_showInspectMenu": { "message": "Allow inspecting proxy used for page elements via context menu." }, + "options_group_keyboardShortcut": { + "message": "Keyboard Shortcut" + }, + "options_menuShortcutHelp": { + "message": "Pressing the shortcut will open the switch popup menu. (Defaults to Alt+Shift+O)." + }, + "options_menuShortcutMore": { + "message": "The items in the popup menu can also be accessed using the keyboard. Press ? (or /) in the menu to learn more." + }, + "options_menuShortcutConfigure": { + "message": "Configure shortcut" + }, "options_group_switchOptions": { "message": "Switch Options" }, @@ -182,7 +194,7 @@ "message": "Cycled Profiles" }, "options_cycledProfilesHelp": { - "message": "When you click on the icon, the following profiles will be applied in their order." + "message": "When you click on the icon (or use the shortcut above), the following profiles will be applied in their order." }, "options_cycledProfilesTooFew": { "message": "You need to select at least 2 profiles to enable this function! You can drag them from the box below." diff --git a/omega-i18n/zh_CN/messages.json b/omega-i18n/zh_CN/messages.json index a3f9ca7..51be391 100644 --- a/omega-i18n/zh_CN/messages.json +++ b/omega-i18n/zh_CN/messages.json @@ -160,6 +160,18 @@ "options_showInspectMenu": { "message": "右键菜单中,可检查网页元素所使用的代理。" }, + "options_group_keyboardShortcut": { + "message": "键盘快捷键" + }, + "options_menuShortcutHelp": { + "message": "按下快捷键即可打开弹出菜单来切换情景模式。(默认快捷键: Alt+Shift+O)." + }, + "options_menuShortcutMore": { + "message": "弹出菜单中的菜单项也可以用键盘进行选择。在弹出菜单中按下? (问号键,或/斜杠键) 查看帮助。" + }, + "options_menuShortcutConfigure": { + "message": "修改快捷键" + }, "options_group_switchOptions": { "message": "切换选项" }, @@ -182,7 +194,7 @@ "message": "循环切换以下情景模式:" }, "options_cycledProfilesHelp": { - "message": "点击图标时,依次循环切换到以下情景模式。" + "message": "点击图标或按下快捷键时,依次循环切换到以下情景模式。" }, "options_cycledProfilesTooFew": { "message": "必须至少选择2个情景模式才能进行切换。请从下方框中拖动情景模式到此框。" diff --git a/omega-i18n/zh_HK/messages.json b/omega-i18n/zh_HK/messages.json index 0af20a1..60794cd 100644 --- a/omega-i18n/zh_HK/messages.json +++ b/omega-i18n/zh_HK/messages.json @@ -160,6 +160,18 @@ "options_showInspectMenu": { "message": "右鍵選單中,可檢查網頁元素所使用的代理。" }, + "options_group_keyboardShortcut": { + "message": "鍵盤快捷鍵" + }, + "options_menuShortcutHelp": { + "message": "按下快捷鍵即可開啟彈出選單來切換情景模式。(預設快捷鍵: Alt+Shift+O)." + }, + "options_menuShortcutMore": { + "message": "彈出選單中的選單項也可以用鍵盤進行選擇。在彈出選單中按下? (問號鍵,或/斜槓鍵) 檢視幫助。" + }, + "options_menuShortcutConfigure": { + "message": "修改快捷鍵" + }, "options_group_switchOptions": { "message": "切換選項" }, @@ -182,7 +194,7 @@ "message": "循環切換以下情景模式:" }, "options_cycledProfilesHelp": { - "message": "點擊圖標時,依次循環切換到以下情景模式。" + "message": "點擊圖標或按下快捷鍵時,依次循環切換到以下情景模式。" }, "options_cycledProfilesTooFew": { "message": "必須至少選擇2個情景模式才能進行切換。請從下方框中拖動情景模式到此框。" diff --git a/omega-i18n/zh_TW/messages.json b/omega-i18n/zh_TW/messages.json index e758213..9a81a62 100644 --- a/omega-i18n/zh_TW/messages.json +++ b/omega-i18n/zh_TW/messages.json @@ -160,6 +160,18 @@ "options_showInspectMenu": { "message": "右鍵選單中,可檢查網頁元素所使用的代理。" }, + "options_group_keyboardShortcut": { + "message": "鍵盤快捷鍵" + }, + "options_menuShortcutHelp": { + "message": "按下快捷鍵即可開啟彈出選單來切換情景模式。(預設快捷鍵: Alt+Shift+O)." + }, + "options_menuShortcutMore": { + "message": "彈出選單中的選單項也可以用鍵盤進行選擇。在彈出選單中按下? (問號鍵,或/斜槓鍵) 檢視幫助。" + }, + "options_menuShortcutConfigure": { + "message": "修改快捷鍵" + }, "options_group_switchOptions": { "message": "切換選項" }, @@ -182,7 +194,7 @@ "message": "迴圈切換以下情景模式:" }, "options_cycledProfilesHelp": { - "message": "點選圖示時,依次迴圈切換到以下情景模式。" + "message": "點選圖示或按下快捷鍵時,依次迴圈切換到以下情景模式。" }, "options_cycledProfilesTooFew": { "message": "必須至少選擇2個情景模式才能進行切換。請從下方框中拖動情景模式到此框。" diff --git a/omega-target-chromium-extension/omega_target_web.coffee b/omega-target-chromium-extension/omega_target_web.coffee index 023f509..74880bd 100644 --- a/omega-target-chromium-extension/omega_target_web.coffee +++ b/omega-target-chromium-extension/omega_target_web.coffee @@ -136,6 +136,8 @@ angular.module('omegaTarget', []).factory 'omegaTarget', ($q) -> return d.promise openManage: -> chrome.tabs.create url: 'chrome://extensions/?id=' + chrome.runtime.id + openShortcutConfig: -> + chrome.tabs.create url: 'chrome://extensions/configureCommands' setOptionsSync: (enabled, args) -> callBackground('setOptionsSync', enabled, args) diff --git a/omega-web/src/omega/controllers/master.coffee b/omega-web/src/omega/controllers/master.coffee index 882a5fa..b0be72d 100644 --- a/omega-web/src/omega/controllers/master.coffee +++ b/omega-web/src/omega/controllers/master.coffee @@ -293,6 +293,8 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window, $scope.downloadIntervalI18n = (interval) -> "options_downloadInterval_" + (if interval < 0 then "never" else interval) + $scope.openShortcutConfig = omegaTarget.openShortcutConfig.bind(omegaTarget) + omegaTarget.refresh() omegaTarget.state('firstRun').then (firstRun) -> diff --git a/omega-web/src/partials/profile_pac.jade b/omega-web/src/partials/profile_pac.jade index ec75e7d..5947a73 100644 --- a/omega-web/src/partials/profile_pac.jade +++ b/omega-web/src/partials/profile_pac.jade @@ -16,7 +16,7 @@ div(ng-controller='PacProfileCtrl') | #[span.glyphicon.glyphicon-download-alt] {{'options_downloadProfileNow' | tr}} section.settings-group h3 - {{'options_group_pacScript' | tr}} + | {{'options_group_pacScript' | tr}} = ' ' button.btn.btn-xs.proxy-auth-toggle(ng-class='profile.auth["all"] ? "btn-success" : "btn-default"' type='button' role='button' ng-click='editProxyAuth()' title='{{"options_proxy_auth" | tr}}') diff --git a/omega-web/src/partials/ui.jade b/omega-web/src/partials/ui.jade index 0f4aff0..8db614b 100644 --- a/omega-web/src/partials/ui.jade +++ b/omega-web/src/partials/ui.jade @@ -14,6 +14,17 @@ section.settings-group label input(type='checkbox' ng-model='options["-showInspectMenu"]') span {{'options_showInspectMenu' | tr}} +section.settings-group + h3 {{'options_group_keyboardShortcut' | tr}} + p + button.btn.btn-default(type='button' role='button' ng-click='openShortcutConfig()') + span.glyphicon.glyphicon-share-alt + = ' ' + | {{'options_menuShortcutConfigure' | tr}} + = ' ' + | {{'options_menuShortcutHelp' | tr}} + p.help-block + | {{'options_menuShortcutMore' | tr}} section.settings-group h3 {{'options_group_switchOptions' | tr}} div.form-group