From 43bb2fd060a84bac744af87fdb9f10d87078f44e Mon Sep 17 00:00:00 2001 From: Particle Date: Thu, 27 Jul 2017 20:38:39 +0000 Subject: [PATCH] 0.0.5b Closes #86 Closes #84 --- src/userscript/Iridium.user.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/userscript/Iridium.user.js b/src/userscript/Iridium.user.js index 3eba25d..8dc7e78 100644 --- a/src/userscript/Iridium.user.js +++ b/src/userscript/Iridium.user.js @@ -1,5 +1,5 @@ // ==UserScript== -// @version 0.0.4b +// @version 0.0.5b // @name Iridium // @namespace https://github.com/ParticleCore // @description YouTube with more freedom @@ -188,7 +188,7 @@ type: "checkbox", value: false, i18n: { - label: "Preview videos by hovering the thumbnails" + label: "Play videos by hovering the thumbnails" } }, thumbnail_preview_mute: { @@ -198,7 +198,7 @@ type: "checkbox", value: false, i18n: { - label: "Shift key toggles audio on video preview" + label: "Shift key toggles audio on video thumbnail playback" } } }, @@ -3377,9 +3377,21 @@ }, saveSettings: function (single_setting) { + var settings; + + if (single_setting in user_settings) { + + settings = user_settings[single_setting]; + + } else { + + settings = user_settings; + + } + window.dispatchEvent(new CustomEvent(receive_settings_from_page, { detail: { - settings: user_settings[single_setting] || user_settings, + settings: settings, single_setting: single_setting } })); @@ -3604,11 +3616,11 @@ var locale_request; var updated_settings; - if ((updated_settings = custom_event.detail.settings)) { + if ((updated_settings = custom_event.detail.settings) !== undefined) { if (custom_event.detail.single_setting) { - if (this.user_settings[custom_event.detail.single_setting]) { + if (custom_event.detail.single_setting in this.user_settings) { this.user_settings[custom_event.detail.single_setting] = custom_event.detail.settings; @@ -3677,7 +3689,7 @@ holder = document.createElement("link"); holder.rel = "stylesheet"; holder.type = "text/css"; - holder.href = "https://particlecore.github.io/Iridium/css/Iridium.css?v=0.0.4b"; + holder.href = "https://particlecore.github.io/Iridium/css/Iridium.css?v=0.0.5b"; document.documentElement.appendChild(holder);