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": {
|
"voteOnTime": {
|
||||||
"message": "Vote On A Segment"
|
"message": "Vote On A Segment"
|
||||||
},
|
},
|
||||||
"soFarUHSubmited": {
|
"Submissions": {
|
||||||
"message": "Submissions:"
|
"message": "Submissions"
|
||||||
},
|
},
|
||||||
"savedPeopleFrom": {
|
"savedPeopleFrom": {
|
||||||
"message": "You've saved people from "
|
"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."
|
"description": "Appears in the popup to inform them that editing has been moved to the video player."
|
||||||
},
|
},
|
||||||
"popupHint": {
|
"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": {
|
"clearTimesButton": {
|
||||||
"message": "Clear Times"
|
"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"
|
"message": "This is used on the public stats page to show off how much you've contributed. See it"
|
||||||
},
|
},
|
||||||
"Username": {
|
"Username": {
|
||||||
"message": "Username:"
|
"message": "Username"
|
||||||
},
|
},
|
||||||
"setUsername": {
|
"setUsername": {
|
||||||
"message": "Set Username"
|
"message": "Set Username"
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
<div class="sidebyside">
|
<div class="sidebyside">
|
||||||
<div id="usernameElement">
|
<div id="usernameElement">
|
||||||
<div>
|
<div>
|
||||||
<p>__MSG_Username__</p>
|
<p>__MSG_Username__:</p>
|
||||||
<div id="setUsernameContainer">
|
<div id="setUsernameContainer">
|
||||||
<p id="usernameValue"></p>
|
<p id="usernameValue"></p>
|
||||||
<button id="setUsernameButton" title="__MSG_setUsername__">
|
<button id="setUsernameButton" title="__MSG_setUsername__">
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="sponsorTimesContributionsContainer" class="hidden">
|
<div id="sponsorTimesContributionsContainer" class="hidden">
|
||||||
<div>
|
<div>
|
||||||
<p>__MSG_soFarUHSubmited__</p>
|
<p>__MSG_Submissions__:</p>
|
||||||
<span id="sponsorTimesContributionsDisplay">
|
<span id="sponsorTimesContributionsDisplay">
|
||||||
0
|
0
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1283,8 +1283,6 @@ function openInfoMenu() {
|
|||||||
htmlData = htmlData.replace(/<body/gi, "<div");
|
htmlData = htmlData.replace(/<body/gi, "<div");
|
||||||
htmlData = htmlData.replace(/<\/body/gi, "</div");
|
htmlData = htmlData.replace(/<\/body/gi, "</div");
|
||||||
|
|
||||||
console.log(htmlData)
|
|
||||||
|
|
||||||
popup.innerHTML = htmlData;
|
popup.innerHTML = htmlData;
|
||||||
|
|
||||||
//close button
|
//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
|
//current video ID of this tab
|
||||||
let currentVideoID = null;
|
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
|
//show proper disable skipping button
|
||||||
let disableSkipping = Config.config.disableSkipping;
|
let disableSkipping = Config.config.disableSkipping;
|
||||||
if (disableSkipping != undefined && disableSkipping) {
|
if (disableSkipping != undefined && disableSkipping) {
|
||||||
@@ -199,7 +184,6 @@ async function runThePopup(messageListener?: MessageListener) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PageElements.sponsorTimesOthersTimeSavedDisplay.innerText = getFormattedHours(minutesSaved);
|
PageElements.sponsorTimesOthersTimeSavedDisplay.innerText = getFormattedHours(minutesSaved);
|
||||||
//PageElements.sponsorTimesOthersTimeSavedContainer.style.display = "unset";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1072,10 +1056,6 @@ async function runThePopup(messageListener?: MessageListener) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chrome.tabs != undefined) {
|
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
|
//this means it is actually opened in the popup
|
||||||
runThePopup();
|
runThePopup();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user