From 101b56e9a0c85c0660e8347ebc328acc9f5d1fef Mon Sep 17 00:00:00 2001 From: shirt <2660574+shirt-dev@users.noreply.github.com> Date: Mon, 25 Apr 2022 13:02:47 -0400 Subject: [PATCH] Tweaks to preferred locale configuration --- manifest.json | 6 +-- pages/options.html | 111 +++++++++++++++++---------------------------- pages/options.js | 31 ++++++++++++- 3 files changed, 73 insertions(+), 75 deletions(-) diff --git a/manifest.json b/manifest.json index 06b0420..cacb77b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 2, "name": "Netflix International", - "description": "Displays all available Netflix audio tracks.", - "version": "2.0.11", + "description": "Displays all available Netflix audio and subtitle tracks.", + "version": "2.0.12", "author": "shirt", "browser_action": { "default_icon": "img/icon128.png", @@ -34,7 +34,7 @@ }, "options_ui": { "page": "pages/options.html", - "open_in_tab": false + "open_in_tab": true }, "web_accessible_resources": [ "cadmium-playercore-shim.js", diff --git a/pages/options.html b/pages/options.html index 6c75dc6..7d998c1 100644 --- a/pages/options.html +++ b/pages/options.html @@ -22,82 +22,53 @@
- +
- +
+ + + +
+ diff --git a/pages/options.js b/pages/options.js index 1a08a99..55d2ad5 100644 --- a/pages/options.js +++ b/pages/options.js @@ -21,7 +21,33 @@ function save_options() { status.textContent = "Options saved."; setTimeout(function() { status.textContent = ""; - }, 750); + }, 2000); + }); +} + +function reset_options() { + document.getElementById("use51").checked = true; + document.getElementById("showAllTracks").checked = true; + document.getElementById("setMaxBitrate").checked = false; + document.getElementById("disableVP9").checked = false; + document.getElementById("useDDPlus").checked = false; + document.getElementById("preferredLocale").value = null; + document.getElementById("preferredTextLocale").value = null; + + chrome.storage.sync.set({ + use6Channels: true, + showAllTracks: true, + setMaxBitrate: false, + disableVP9: false, + useDDPlus: false, + preferredLocale: null, + preferredTextLocale: null, + }, function() { + var status = document.getElementById("status"); + status.textContent = "Options reset."; + setTimeout(function() { + status.textContent = ""; + }, 2000); }); } @@ -46,4 +72,5 @@ function restore_options() { } document.addEventListener("DOMContentLoaded", restore_options); -document.getElementById("save").addEventListener("click", save_options); \ No newline at end of file +document.getElementById("save").addEventListener("click", save_options); +document.getElementById("reset").addEventListener("click", reset_options);