Moving into LANG

This commit is contained in:
Official Noob
2019-08-07 17:04:50 +01:00
committed by GitHub
parent 21b5fc9723
commit 86fee63a8b

View File

@@ -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();
}
}