Browse Source

feat: add option to disable badge number

close violentmonkey/violentmonkey#77
Gerald 9 years ago
parent
commit
64ee2b5f25

+ 3 - 0
src/_locales/cs/messages.yml

@@ -382,3 +382,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: Zobrazit počet běžících skriptů

+ 3 - 0
src/_locales/de/messages.yml

@@ -378,3 +378,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/en/messages.yml

@@ -378,3 +378,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: Invalid script!
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: Show number of running scripts on the badge

+ 12 - 3
src/_locales/id/messages.yml

@@ -3,7 +3,9 @@ extName:
   message: Violentmonkey
 extDescription:
   description: Description for this extension.
-  message: Dukungan userscript untuk peramban berbasis Chromium seperti Opera dan Chrome.
+  message: >-
+    Dukungan userscript untuk peramban berbasis Chromium seperti Opera dan
+    Chrome.
 extTranslator:
   description: Information of the translator.
   message: Arif Budiman <[email protected]>
@@ -283,7 +285,9 @@ buttonVacuumed:
   message: Data tervakum
 hintVacuum:
   description: Hint for vacuuming data.
-  message: Buang redundansi dan coba memuat ulang sumber daya yang tidak ada dalam cache.
+  message: >-
+    Buang redundansi dan coba memuat ulang sumber daya yang tidak ada dalam
+    cache.
 menuManageScripts:
   description: 'Menu item to manage scripts, or to open the options page of the extension.'
   message: Kelola script
@@ -325,7 +329,9 @@ labelAutoReloadCurrentTab:
   message: Muat ulang tab saat ini setelah memilih hidupkan/matikan script dari menu
 hintInjectModeNormal:
   description: Hint to explain the normal injection mode.
-  message: 'Efisien tapi gagal di beberapa halaman dengan keamanan yang tinggi, misal. https://github.com'
+  message: >-
+    Efisien tapi gagal di beberapa halaman dengan keamanan yang tinggi, misal.
+    https://github.com
   touched: false
 hintInjectModeAdvanced:
   description: Hint to explain the advanced injection mode.
@@ -378,3 +384,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: Script tidak valid!
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/pl/messages.yml

@@ -380,3 +380,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/ro/messages.yml

@@ -384,3 +384,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/ru/messages.yml

@@ -380,3 +380,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/sr/messages.yml

@@ -382,3 +382,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/vi/messages.yml

@@ -380,3 +380,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: ''
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: ''

+ 3 - 0
src/_locales/zh/messages.yml

@@ -380,3 +380,6 @@ msgNamespaceConflict:
 msgInvalidScript:
   description: Message shown when script is invalid.
   message: 脚本不合法!
+labelShowBadge:
+  description: Option to show number of running scripts on the badge
+  message: 在扩展图标上显示运行的脚本数

+ 2 - 1
src/background/app.js

@@ -237,8 +237,9 @@ var setBadge = function () {
       color: '#808',
       tabId: src.tab.id,
     });
+    var text = (_.options.get('showBadge') && o.num || '').toString();
     chrome.browserAction.setBadgeText({
-      text: (o.num || '').toString(),
+      text: text,
       tabId: src.tab.id,
     });
     if (o.timer) clearTimeout(o.timer);

+ 1 - 0
src/common.js

@@ -155,6 +155,7 @@ _.options = function () {
     autoUpdate: true,
     ignoreGrant: false,
     lastUpdate: 0,
+    showBadge: true,
     exportValues: true,
     closeAfterInstall: false,
     trackLocalFile: false,

+ 4 - 0
src/options/views/tab-settings.html

@@ -4,6 +4,10 @@
     <input type=checkbox v-setting="'autoUpdate'" @change="updateAutoUpdate">
     <span v-text="i18n('labelAutoUpdate')"></span>
   </label>
+  <label class="line">
+    <input type=checkbox v-setting="'showBadge'">
+    <span v-text="i18n('labelShowBadge')"></span>
+  </label>
   <label class="line">
     <input type=checkbox v-setting="'ignoreGrant'">
     <span v-text="i18n('labelIgnoreGrant')"></span>