mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 10:21:22 +01:00
Popup Configuration
The popup.html and popup.js are configured
This commit is contained in:
1 parent
acf35604cc
commit
0c45be3c0b
2 files changed
+36
-14
No files matched your search
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=utf-8" />
|
<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="stylesheet" href="popup.css" />
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<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" />
|
<path d="m8 12.5 5.1-2.9L8 6.7v5.8z" fill="#fff" />
|
||||||
</svg>
|
</svg>
|
||||||
<h1 style="margin-bottom: 0.75rem">Return YouTube Dislike</h1>
|
<h1 style="margin-bottom: 0.75rem" title="__MSG_extensionName__">__MSG_extensionName__</h1>
|
||||||
<p style="color: var(--lightGrey)">by Dmitrii Selivanov & Community</p>
|
<p style="color: var(--lightGrey)" title="__MSG_textDeveloper__">__MSG_textDeveloper__</p>
|
||||||
|
|
||||||
<button id="link_website">Website</button>
|
<button id="link_website" title="__MSG_linkWebsite__">__MSG_linkWebsite__</button>
|
||||||
<button id="link_github">GitHub</button>
|
<button id="link_github" >GitHub</button>
|
||||||
<button id="link_discord">Discord</button>
|
<button id="link_discord">Discord</button>
|
||||||
<br />
|
<br />
|
||||||
<button style="margin-top: 0.3rem" id="link_faq">FAQ</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">Donate</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">Help</button>
|
<button style="margin-top: 0.3em" id="link_help" title="__MSG_linkHelp__">__MSG_linkHelp__</button>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
@@ -70,12 +70,12 @@
|
|||||||
|
|
||||||
<!-- dialog box -->
|
<!-- dialog box -->
|
||||||
<fieldset id="advancedSettings">
|
<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" />
|
<input type="checkbox" id="disable_vote_submission" />
|
||||||
<span class="slider" />
|
<span class="slider" />
|
||||||
<span class="switchLabel">Disable vote submission</span>
|
<span class="switchLabel" title="__MSG_textSettings__">__MSG_textSettings__</span>
|
||||||
</label>
|
</label>
|
||||||
<!-- <br />
|
<!-- <br />
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
|
|||||||
@@ -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 */
|
/* Links */
|
||||||
createLink(config.links.website,"link_website")
|
createLink(config.links.website,"link_website")
|
||||||
@@ -72,7 +95,7 @@ function initializeVersionNumber() {
|
|||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((json) => {
|
.then((json) => {
|
||||||
if (version !== json.version) {
|
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';
|
document.getElementById('ext-update').style.padding = '.25rem .5rem';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -121,7 +144,6 @@ function handleDisableVoteSubmissionChangeEvent(value) {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
/* popup-script.js
|
/* popup-script.js
|
||||||
document.querySelector('#login')
|
document.querySelector('#login')
|
||||||
.addEventListener('click', function () {
|
.addEventListener('click', function () {
|
||||||
|
|||||||
Reference in new issue
Block a user