mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
browser.i18n -> chrome.i18n
This commit is contained in:
26
popup.js
26
popup.js
@@ -159,9 +159,9 @@ function runThePopup() {
|
|||||||
chrome.storage.sync.get(["sponsorTimesContributed"], function(result) {
|
chrome.storage.sync.get(["sponsorTimesContributed"], function(result) {
|
||||||
if (result.sponsorTimesContributed != undefined) {
|
if (result.sponsorTimesContributed != undefined) {
|
||||||
if (result.sponsorTimesContributed > 1) {
|
if (result.sponsorTimesContributed > 1) {
|
||||||
SB.sponsorTimesContributionsDisplayEndWord.innerText = browser.i18n.getMessage("Sponsors");
|
SB.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Sponsors");
|
||||||
} else {
|
} else {
|
||||||
SB.sponsorTimesContributionsDisplayEndWord.innerText = browser.i18n.getMessage("Sponsor");
|
SB.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Sponsor");
|
||||||
}
|
}
|
||||||
SB.sponsorTimesContributionsDisplay.innerText = result.sponsorTimesContributed;
|
SB.sponsorTimesContributionsDisplay.innerText = result.sponsorTimesContributed;
|
||||||
SB.sponsorTimesContributionsContainer.style.display = "unset";
|
SB.sponsorTimesContributionsContainer.style.display = "unset";
|
||||||
@@ -177,9 +177,9 @@ function runThePopup() {
|
|||||||
let viewCount = JSON.parse(xmlhttp.responseText).viewCount;
|
let viewCount = JSON.parse(xmlhttp.responseText).viewCount;
|
||||||
if (viewCount != 0) {
|
if (viewCount != 0) {
|
||||||
if (viewCount > 1) {
|
if (viewCount > 1) {
|
||||||
SB.sponsorTimesViewsDisplayEndWord.innerText = browser.i18n.getMessage("Segments");
|
SB.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segments");
|
||||||
} else {
|
} else {
|
||||||
SB.sponsorTimesViewsDisplayEndWord.innerText = browser.i18n.getMessage("Segment");
|
SB.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segment");
|
||||||
}
|
}
|
||||||
|
|
||||||
SB.sponsorTimesViewsDisplay.innerText = viewCount;
|
SB.sponsorTimesViewsDisplay.innerText = viewCount;
|
||||||
@@ -264,11 +264,11 @@ function runThePopup() {
|
|||||||
SB.loadingIndicator.innerHTML = "";
|
SB.loadingIndicator.innerHTML = "";
|
||||||
|
|
||||||
if (request.found) {
|
if (request.found) {
|
||||||
SB.videoFound.innerHTML = browser.i18n.getMessage("SponsorFound");
|
SB.videoFound.innerHTML = chrome.i18n.getMessage("SponsorFound");
|
||||||
|
|
||||||
displayDownloadedSponsorTimes(request);
|
displayDownloadedSponsorTimes(request);
|
||||||
} else {
|
} else {
|
||||||
SB.videoFound.innerHTML = browser.i18n.getMessage("Sponsor404");
|
SB.videoFound.innerHTML = chrome.i18n.getMessage("Sponsor404");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ function runThePopup() {
|
|||||||
function displayDownloadedSponsorTimes(request) {
|
function displayDownloadedSponsorTimes(request) {
|
||||||
if (request.sponsorTimes != undefined) {
|
if (request.sponsorTimes != undefined) {
|
||||||
//set it to the message
|
//set it to the message
|
||||||
if (SB.downloadedSponsorMessageTimes.innerText != browser.i18n.getMessage("ChannelWhitelisted")) {
|
if (SB.downloadedSponsorMessageTimes.innerText != chrome.i18n.getMessage("ChannelWhitelisted")) {
|
||||||
SB.downloadedSponsorMessageTimes.innerText = getSponsorTimesMessage(request.sponsorTimes);
|
SB.downloadedSponsorMessageTimes.innerText = getSponsorTimesMessage(request.sponsorTimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -950,7 +950,7 @@ function runThePopup() {
|
|||||||
//update startTimeChosen letiable
|
//update startTimeChosen letiable
|
||||||
if (!startTimeChosen) {
|
if (!startTimeChosen) {
|
||||||
startTimeChosen = true;
|
startTimeChosen = true;
|
||||||
SB.sponsorStart.innerHTML = browser.i18n.getMessage("SponsorEND");
|
SB.sponsorStart.innerHTML = chrome.i18n.getMessage("SponsorEND");
|
||||||
} else {
|
} else {
|
||||||
resetStartTimeChosen();
|
resetStartTimeChosen();
|
||||||
}
|
}
|
||||||
@@ -982,7 +982,7 @@ function runThePopup() {
|
|||||||
|
|
||||||
//this is not a YouTube video page
|
//this is not a YouTube video page
|
||||||
function displayNoVideo() {
|
function displayNoVideo() {
|
||||||
document.getElementById("loadingIndicator").innerHTML = browser.i18n.getMessage("Sponsor404");
|
document.getElementById("loadingIndicator").innerHTML = chrome.i18n.getMessage("Sponsor404");
|
||||||
}
|
}
|
||||||
|
|
||||||
function reportAnIssue() {
|
function reportAnIssue() {
|
||||||
@@ -1019,16 +1019,16 @@ function runThePopup() {
|
|||||||
//see if it was a success or failure
|
//see if it was a success or failure
|
||||||
if (response.successType == 1) {
|
if (response.successType == 1) {
|
||||||
//success
|
//success
|
||||||
addVoteMessage(browser.i18n.getMessage("VOTED"), UUID)
|
addVoteMessage(chrome.i18n.getMessage("VOTED"), UUID)
|
||||||
} else if (response.successType == 0) {
|
} else if (response.successType == 0) {
|
||||||
//failure: duplicate vote
|
//failure: duplicate vote
|
||||||
addVoteMessage(browser.i18n.getMessage("VOTE_FAIL"), UUID)
|
addVoteMessage(chrome.i18n.getMessage("VOTE_FAIL"), UUID)
|
||||||
} else if (response.successType == -1) {
|
} else if (response.successType == -1) {
|
||||||
if (response.statusCode == 502) {
|
if (response.statusCode == 502) {
|
||||||
addVoteMessage(browser.i18n.getMessage("ServerDown"), UUID)
|
addVoteMessage(chrome.i18n.getMessage("ServerDown"), UUID)
|
||||||
} else {
|
} else {
|
||||||
//failure: unknown error
|
//failure: unknown error
|
||||||
addVoteMessage(browser.i18n.getMessage("connectionError") + response.statusCode, UUID)
|
addVoteMessage(chrome.i18n.getMessage("connectionError") + response.statusCode, UUID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user