diff --git a/2.0/_locales/en/messages.json b/2.0/_locales/en/messages.json index cbe3ae76a..ea7549caf 100644 --- a/2.0/_locales/en/messages.json +++ b/2.0/_locales/en/messages.json @@ -2,9 +2,6 @@ "about": { "message": "About" }, - "saveAs": { - "message": "Save us" - }, "activateCaptions": { "message": "Activate captions" }, @@ -38,9 +35,6 @@ "annotations": { "message": "Annotations" }, - "hideAnnotations": { - "message": "Hide annotations" - }, "appearance": { "message": "Appearance" }, @@ -110,9 +104,6 @@ "cancel": { "message": "Cancel" }, - "hideCards": { - "message": "Hide cards" - }, "channel": { "message": "Channel" }, @@ -206,9 +197,6 @@ "enabled": { "message": "Enabled" }, - "hideEndscreen": { - "message": "Hide endscreen" - }, "expanded": { "message": "Expanded" }, @@ -218,18 +206,12 @@ "extension": { "message": "Extension" }, - "hideFeaturedContent": { - "message": "Hide featured content" - }, "fitToWindow": { "message": "Fit to window" }, "flash": { "message": "Flash" }, - "hideFooter": { - "message": "Hide footer" - }, "footer": { "message": "Footer" }, @@ -278,12 +260,30 @@ "hideAnimatedThumbnails": { "message": "Hide animated thumbnails" }, + "hideAnnotations": { + "message": "Hide annotations" + }, + "hideCards": { + "message": "Hide cards" + }, "hideDetails": { "message": "Hide details" }, + "hideEndscreen": { + "message": "Hide endscreen" + }, + "hideFeaturedContent": { + "message": "Hide featured content" + }, + "hideFooter": { + "message": "Hide footer" + }, "hideRightButtons": { "message": "Hide right buttons" }, + "hideViewsCount": { + "message": "Hide views count" + }, "history": { "message": "History" }, @@ -494,6 +494,9 @@ "save": { "message": "Save" }, + "saveAs": { + "message": "Save us" + }, "schedule": { "message": "Schedule" }, @@ -608,9 +611,6 @@ "videos": { "message": "Videos" }, - "hideViewsCount": { - "message": "Hide views count" - }, "volume": { "message": "Volume" }, diff --git a/2.0/background.js b/2.0/background.js index 2f47ac21a..82a99686c 100644 --- a/2.0/background.js +++ b/2.0/background.js @@ -8,6 +8,7 @@ 5.0 Storage change listener 6.0 Initialization 7.0 Uninstall URL +8.0 Google analytics --------------------------------------------------------------*/ /*----------------------------------------------------------------------------- @@ -286,4 +287,26 @@ chrome.storage.local.get(function(items) { 7.0 Uninstall URL -----------------------------------------------------------------------------*/ -chrome.runtime.setUninstallURL('http://improvedtube.com/uninstalled'); \ No newline at end of file +chrome.runtime.setUninstallURL('http://improvedtube.com/uninstalled'); + + +/*----------------------------------------------------------------------------- +8.0 Google analytics +-----------------------------------------------------------------------------*/ + +if (chrome.runtime.getManifest().version === chrome.runtime.getManifest().version_name) { + var _gaq = _gaq || []; + + _gaq.push(['_setAccount', 'UA-88354155-1']); + _gaq.push(['_setSessionCookieTimeout', 14400000]); + + (function() { + var ga = document.createElement('script'), + s = document.getElementsByTagName('script')[0]; + + ga.type = 'text/javascript'; + ga.async = true; + ga.src = 'https://ssl.google-analytics.com/ga.js'; + s.parentNode.insertBefore(ga, s); + })(); +} \ No newline at end of file diff --git a/2.0/manifest.json b/2.0/manifest.json index c5360ca2d..2ff3b9935 100644 --- a/2.0/manifest.json +++ b/2.0/manifest.json @@ -66,6 +66,7 @@ "youtube/js/features/channel.js", "youtube/js/features/shortcuts.js", "youtube/js/features/volume-mixer.js", + "youtube/js/features/analyzer.js", "youtube/js/features/blacklist.js", "youtube/js/features/settings.js" ], @@ -146,7 +147,7 @@ "satus/templates/improvedtube/template-parts/channel.js", "satus/templates/improvedtube/template-parts/shortcuts.js", "satus/templates/improvedtube/template-parts/mixer.js", - "satus/templates/improvedtube/template-parts/youtube-time.js", + "satus/templates/improvedtube/template-parts/analyzer.js", "satus/templates/improvedtube/template-parts/blacklist.js", "satus/templates/improvedtube/template-parts/settings.js", "satus/templates/improvedtube/index.js" diff --git a/2.0/satus/components/js/shortcut.js b/2.0/satus/components/js/shortcut.js index ad1760ef9..7b9be1b9c 100644 --- a/2.0/satus/components/js/shortcut.js +++ b/2.0/satus/components/js/shortcut.js @@ -76,6 +76,7 @@ Satus.prototype.components.shortcut = { component_surface = document.createElement('div'), component_canvas = document.createElement('div'), component_section = document.createElement('section'), + component_button_reset = document.createElement('div'), component_button_cancel = document.createElement('div'), component_button_save = document.createElement('div'); @@ -85,10 +86,12 @@ Satus.prototype.components.shortcut = { component_surface.className = 'satus-dialog__surface satus-dialog__surface_shortcut'; component_canvas.className = 'satus-shortcut__canvas'; component_section.className = 'satus-section satus-section_shortcut'; + component_button_reset.className = 'satus-button satus-button_shortcut'; component_button_cancel.className = 'satus-button satus-button_shortcut'; component_button_save.className = 'satus-button satus-button_shortcut'; component_dialog_label.innerText = component_label.innerText; + component_button_reset.innerText = self.storage.get('locale/reset'); component_button_cancel.innerText = self.storage.get('locale/cancel'); component_button_save.innerText = self.storage.get('locale/save'); @@ -140,12 +143,17 @@ Satus.prototype.components.shortcut = { } component_scrim.addEventListener('click', close); + component_button_reset.addEventListener('click', function() { + self.storage.remove(name); + close(); + }); component_button_cancel.addEventListener('click', close); component_button_save.addEventListener('click', function() { self.storage.set(name, JSON.stringify(value)); close(false); }); + component_section.appendChild(component_button_reset); component_section.appendChild(component_button_cancel); component_section.appendChild(component_button_save); diff --git a/2.0/satus/components/js/switch.js b/2.0/satus/components/js/switch.js index 402e27d81..5cf2cdb9a 100644 --- a/2.0/satus/components/js/switch.js +++ b/2.0/satus/components/js/switch.js @@ -12,7 +12,8 @@ Satus.prototype.components.switch = { get: function(name, object) { var self = this, component = document.createElement('div'), - label = this.storage.get('locale/' + object.label) || this.storage.get('locale/' + name) || object.label; + label = this.storage.get('locale/' + object.label) || this.storage.get('locale/' + name) || object.label, + stor = this.storage.get((object.storage_path || '') + '/' + name); object.tabindex = true; @@ -21,7 +22,11 @@ Satus.prototype.components.switch = { ((object.icons || {}).start || '') + '