Popup Configuration

The popup.html and popup.js are configured
This commit is contained in:
Fernando Dilland Mireles Cisneros committed 2022-02-18 14:51:59 -06:00
1 parent acf35604cc
commit 0c45be3c0b
2 files changed
+36 -14

No files matched your search

+12 -12
View File
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta content="text/html; charset=utf-8" />
<title>Return YouTube Dislike</title>
<title title="__MSG_extensionName__">__MSG_extensionName__</title>
<link rel="stylesheet" href="popup.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
@@ -20,16 +20,16 @@
/>
<path d="m8 12.5 5.1-2.9L8 6.7v5.8z" fill="#fff" />
</svg>
<h1 style="margin-bottom: 0.75rem">Return YouTube Dislike</h1>
<p style="color: var(--lightGrey)">by Dmitrii Selivanov & Community</p>
<h1 style="margin-bottom: 0.75rem" title="__MSG_extensionName__">__MSG_extensionName__</h1>
<p style="color: var(--lightGrey)" title="__MSG_textDeveloper__">__MSG_textDeveloper__</p>
<button id="link_website">Website</button>
<button id="link_github">GitHub</button>
<button id="link_website" title="__MSG_linkWebsite__">__MSG_linkWebsite__</button>
<button id="link_github" >GitHub</button>
<button id="link_discord">Discord</button>
<br />
<button style="margin-top: 0.3rem" id="link_faq">FAQ</button>
<button style="margin-top: 0.3em" id="link_donate">Donate</button>
<button style="margin-top: 0.3em" id="link_help">Help</button>
<button style="margin-top: 0.3rem" id="link_faq" title="__MSG_linkFAQ__">__MSG_linkFAQ__</button>
<button style="margin-top: 0.3em" id="link_donate" title="__MSG_linkDonate__">__MSG_linkDonate__</button>
<button style="margin-top: 0.3em" id="link_help" title="__MSG_linkHelp__">__MSG_linkHelp__</button>
<br />
<br />
@@ -70,12 +70,12 @@
<!-- dialog box -->
<fieldset id="advancedSettings">
<legend id="advancedLegend">Settings</legend>
<legend id="advancedLegend" title="__MSG_legendSettings__">__MSG_legendSettings__</legend>
<label class="switch" data-hover="Stops counting your likes and dislikes.">
<label class="switch" data-hover="__MSG_textSettingsHover__">
<input type="checkbox" id="disable_vote_submission" />
<span class="slider" />
<span class="switchLabel">Disable vote submission</span>
<span class="switchLabel" title="__MSG_textSettings__">__MSG_textSettings__</span>
</label>
<!-- <br />
<label class="switch">
+24 -2
View File
@@ -16,6 +16,29 @@ const config = {
},
};
/* Change lenguage */
function localizeHtmlPage()
{
//Localize by replacing __MSG_***__ meta tags
var objects = document.getElementsByTagName('html');
for (var j = 0; j < objects.length; j++)
{
var obj = objects[j];
var valStrH = obj.innerHTML.toString();
var valNewH = valStrH.replace(/__MSG_(\w+)__/g, function(match, v1)
{
return v1 ? chrome.i18n.getMessage(v1) : "";
});
if(valNewH != valStrH)
{
obj.innerHTML = valNewH;
}
}
}
localizeHtmlPage();
/* Links */
createLink(config.links.website,"link_website")
@@ -72,7 +95,7 @@ function initializeVersionNumber() {
.then((response) => response.json())
.then((json) => {
if (version !== json.version) {
document.getElementById('ext-update').innerHTML = 'update to v' + json.version;
document.getElementById('ext-update').innerHTML = chrome.i18n.getMessage("textUpdate") +' v' + json.version;
document.getElementById('ext-update').style.padding = '.25rem .5rem';
}
});
@@ -121,7 +144,6 @@ function handleDisableVoteSubmissionChangeEvent(value) {
}
})();
/* popup-script.js
document.querySelector('#login')
.addEventListener('click', function () {