mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Popup code cleanup
This commit is contained in:
@@ -130,8 +130,8 @@
|
||||
"voteOnTime": {
|
||||
"message": "Vote On A Segment"
|
||||
},
|
||||
"soFarUHSubmited": {
|
||||
"message": "Submissions:"
|
||||
"Submissions": {
|
||||
"message": "Submissions"
|
||||
},
|
||||
"savedPeopleFrom": {
|
||||
"message": "You've saved people from "
|
||||
@@ -150,7 +150,7 @@
|
||||
"description": "Appears in the popup to inform them that editing has been moved to the video player."
|
||||
},
|
||||
"popupHint": {
|
||||
"message": "Hint: Press the semicolon key while focused on a video to report the start/end of a segment and quote to submit."
|
||||
"message": "Hint: You can setup keybinds for submitting in the options"
|
||||
},
|
||||
"clearTimesButton": {
|
||||
"message": "Clear Times"
|
||||
@@ -162,7 +162,7 @@
|
||||
"message": "This is used on the public stats page to show off how much you've contributed. See it"
|
||||
},
|
||||
"Username": {
|
||||
"message": "Username:"
|
||||
"message": "Username"
|
||||
},
|
||||
"setUsername": {
|
||||
"message": "Set Username"
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<div class="sidebyside">
|
||||
<div id="usernameElement">
|
||||
<div>
|
||||
<p>__MSG_Username__</p>
|
||||
<p>__MSG_Username__:</p>
|
||||
<div id="setUsernameContainer">
|
||||
<p id="usernameValue"></p>
|
||||
<button id="setUsernameButton" title="__MSG_setUsername__">
|
||||
@@ -98,7 +98,7 @@
|
||||
</div>
|
||||
<div id="sponsorTimesContributionsContainer" class="hidden">
|
||||
<div>
|
||||
<p>__MSG_soFarUHSubmited__</p>
|
||||
<p>__MSG_Submissions__:</p>
|
||||
<span id="sponsorTimesContributionsDisplay">
|
||||
0
|
||||
</span>
|
||||
|
||||
@@ -1283,8 +1283,6 @@ function openInfoMenu() {
|
||||
htmlData = htmlData.replace(/<body/gi, "<div");
|
||||
htmlData = htmlData.replace(/<\/body/gi, "</div");
|
||||
|
||||
console.log(htmlData)
|
||||
|
||||
popup.innerHTML = htmlData;
|
||||
|
||||
//close button
|
||||
|
||||
20
src/popup.ts
20
src/popup.ts
@@ -125,21 +125,6 @@ async function runThePopup(messageListener?: MessageListener) {
|
||||
//current video ID of this tab
|
||||
let currentVideoID = null;
|
||||
|
||||
//see if discord link can be shown
|
||||
let hideDiscordLink = Config.config.hideDiscordLink;
|
||||
if (hideDiscordLink == undefined || !hideDiscordLink) {
|
||||
let hideDiscordLaunches = Config.config.hideDiscordLaunches;
|
||||
//only if less than 10 launches
|
||||
if (hideDiscordLaunches == undefined || hideDiscordLaunches < 10) {
|
||||
//PageElements.discordButtonContainer.style.display = null;
|
||||
|
||||
if (hideDiscordLaunches == undefined) {
|
||||
hideDiscordLaunches = 1;
|
||||
}
|
||||
Config.config.hideDiscordLaunches = hideDiscordLaunches + 1;
|
||||
}
|
||||
}
|
||||
|
||||
//show proper disable skipping button
|
||||
let disableSkipping = Config.config.disableSkipping;
|
||||
if (disableSkipping != undefined && disableSkipping) {
|
||||
@@ -199,7 +184,6 @@ async function runThePopup(messageListener?: MessageListener) {
|
||||
}
|
||||
|
||||
PageElements.sponsorTimesOthersTimeSavedDisplay.innerText = getFormattedHours(minutesSaved);
|
||||
//PageElements.sponsorTimesOthersTimeSavedContainer.style.display = "unset";
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1072,10 +1056,6 @@ async function runThePopup(messageListener?: MessageListener) {
|
||||
}
|
||||
|
||||
if (chrome.tabs != undefined) {
|
||||
//add the width restriction (because Firefox)
|
||||
let link = <HTMLLinkElement> document.getElementById("sponsorBlockStyleSheet");
|
||||
//(<CSSStyleSheet> link.sheet).insertRule('.popupBody { width: 325 }', 0);
|
||||
|
||||
//this means it is actually opened in the popup
|
||||
runThePopup();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user