mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Moving into LANG
This commit is contained in:
16
popup.js
16
popup.js
@@ -81,15 +81,6 @@ function runThePopup() {
|
||||
SB.optionsButton.addEventListener("click", openOptions);
|
||||
SB.reportAnIssue.addEventListener("click", reportAnIssue);
|
||||
SB.hideDiscordButton.addEventListener("click", hideDiscordButton);
|
||||
|
||||
//setup error message languages
|
||||
var EN_US = new Map();
|
||||
|
||||
EN_US.set(400, 'Server said this request was invalid"')
|
||||
.set(429, 'You have submitted too many sponsor times for this one video, are you sure there are this many?')
|
||||
.set(409, 'This has already been submitted before')
|
||||
.set(502, 'It seems the server is down. Contact the dev to inform them.')
|
||||
.set('Unknown', 'There was an error submitting your sponsor times, please try again later.');
|
||||
|
||||
//if true, the button now selects the end time
|
||||
let startTimeChosen = false;
|
||||
@@ -698,11 +689,6 @@ function runThePopup() {
|
||||
resetStartTimeChosen();
|
||||
}
|
||||
|
||||
function getErrorMessage(lang, statusCode) {
|
||||
if(lang.has(statusCode)) return lang.get(statusCode);
|
||||
return lang.get('Unknown').concat(" Error code: ") + statusCode;
|
||||
}
|
||||
|
||||
function submitTimes() {
|
||||
//make info message say loading
|
||||
SB.submitTimesInfoMessage.innerText = "Loading...";
|
||||
@@ -1143,4 +1129,4 @@ if (chrome.tabs != undefined) {
|
||||
|
||||
//this means it is actually opened in the popup
|
||||
runThePopup();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user