Skip to content

Commit

Permalink
Tweaks to preferred locale configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
shirt-dev committed Apr 25, 2022
1 parent 264a18c commit 101b56e
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 75 deletions.
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
111 changes: 41 additions & 70 deletions pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,82 +22,53 @@
<input type="checkbox" id="useDDPlus"><label for="useDDPlus">Use Dolby Digital Plus (Chromium Edge)</label>
<br>
<label for="preferredLocale">Preferred audio language</label>
<select name="preferredLocale" id="preferredLocale">
<option value="null">None</option>
<option value="ar">ar</option>
<option value="cs">cs</option>
<option value="da">da</option>
<option value="de">de</option>
<option value="el">el</option>
<option value="en">en</option>
<option value="es">es</option>
<option value="fi">fi</option>
<option value="fr">fr</option>
<option value="he">he</option>
<option value="hi">hi</option>
<option value="hr">hr</option>
<option value="hu">hu</option>
<option value="id">id</option>
<option value="it">it</option>
<option value="ja">ja</option>
<option value="ko">ko</option>
<option value="ms">ms</option>
<option value="nb">nb</option>
<option value="nl">nl</option>
<option value="pl">pl</option>
<option value="pt">pt</option>
<option value="ro">ro</option>
<option value="ru">ru</option>
<option value="sv">sv</option>
<option value="ta">ta</option>
<option value="te">te</option>
<option value="th">th</option>
<option value="tr">tr</option>
<option value="uk">uk</option>
<option value="vi">vi</option>
<option value="zh">zh</option>
</select>
<input list="locales" id="preferredLocale" maxlength="5">
<br>
<label for="preferredTextLocale">Preferred subtitle language</label>
<select name="preferredTextLocale" id="preferredTextLocale">
<option value="null">None</option>
<option value="ar">ar</option>
<option value="cs">cs</option>
<option value="da">da</option>
<option value="de">de</option>
<option value="el">el</option>
<option value="en">en</option>
<option value="es">es</option>
<option value="fi">fi</option>
<option value="fr">fr</option>
<option value="he">he</option>
<option value="hi">hi</option>
<option value="hr">hr</option>
<option value="hu">hu</option>
<option value="id">id</option>
<option value="it">it</option>
<option value="ja">ja</option>
<option value="ko">ko</option>
<option value="ms">ms</option>
<option value="nb">nb</option>
<option value="nl">nl</option>
<option value="pl">pl</option>
<option value="pt">pt</option>
<option value="ro">ro</option>
<option value="ru">ru</option>
<option value="sv">sv</option>
<option value="ta">ta</option>
<option value="te">te</option>
<option value="th">th</option>
<option value="tr">tr</option>
<option value="uk">uk</option>
<option value="vi">vi</option>
<option value="zh">zh</option>
</select>
<input list="locales" id="preferredTextLocale" maxlength="5">
<br>

<datalist name="locales" id="locales">
<option value="ar">
<option value="cs">
<option value="da">
<option value="de">
<option value="el">
<option value="en">
<option value="es">
<option value="es-ES">
<option value="fi">
<option value="fr">
<option value="he">
<option value="hi">
<option value="hr">
<option value="hu">
<option value="id">
<option value="it">
<option value="ja">
<option value="ko">
<option value="ms">
<option value="nb">
<option value="nl">
<option value="pl">
<option value="pt">
<option value="pt-BR">
<option value="ro">
<option value="ru">
<option value="sv">
<option value="ta">
<option value="te">
<option value="th">
<option value="tr">
<option value="uk">
<option value="vi">
<option value="zh">
</datalist>

<br>
<div id="status"></div>
<button id="save">Save</button>
<button id="reset">Reset</button>

<script src="options.js"></script>
</body>
Expand Down
31 changes: 29 additions & 2 deletions pages/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand All @@ -46,4 +72,5 @@ function restore_options() {
}

document.addEventListener("DOMContentLoaded", restore_options);
document.getElementById("save").addEventListener("click", save_options);
document.getElementById("save").addEventListener("click", save_options);
document.getElementById("reset").addEventListener("click", reset_options);

0 comments on commit 101b56e

Please sign in to comment.