Compare commits

..

21 Commits
1.2.1 ... 1.2.2

Author SHA1 Message Date
Ajay Ramachandran
1abc1b9b28 Merge pull request #212 from ajayyy/experimental-ajay
UserID import, ID fixes, view count fix, embed error fix
2019-12-29 00:29:51 -05:00
Ajay Ramachandran
d10c8041bf Update build number 2019-12-29 00:28:56 -05:00
Ajay Ramachandran
c14c795474 Improved channel name query selector.
Resolves https://github.com/ajayyy/SponsorBlock/issues/199
2019-12-29 00:21:38 -05:00
Ajay Ramachandran
e5937431c3 Prevented error on embed.
Resolves https://github.com/ajayyy/SponsorBlock/issues/202
2019-12-29 00:14:51 -05:00
Ajay Ramachandran
b24a688e63 Improved view count 2019-12-29 00:10:08 -05:00
Ajay Ramachandran
10fd22f49c Fixed view counting being broken. 2019-12-29 00:08:57 -05:00
Ajay Ramachandran
f1dda95847 Merge branch 'experimental' of https://github.com/ajayyy/SponsorBlock into experimental-ajay
# Conflicts:
#	content.js
2019-12-29 00:08:41 -05:00
Ajay Ramachandran
f3f6dd171b Switched vote and view to POST. 2019-12-28 23:56:38 -05:00
Ajay Ramachandran
c802212a62 Added ability to import/export your userID. 2019-12-28 22:13:03 -05:00
Ajay Ramachandran
afb666797d Fixed IDs being localized in some parts. 2019-12-28 11:04:36 -05:00
Ajay Ramachandran
85a591c984 Merge pull request #207 from ImMaax/master
Fixed German translation
2019-12-23 21:01:04 -05:00
Max
3edaea8102 Removed word 2019-12-22 22:57:04 +01:00
Max
93c39c3ecc Fixed German translation 2019-12-22 22:54:43 +01:00
Ajay Ramachandran
ab2f0ef395 Crowdin fixes 2019-12-21 00:00:23 -05:00
Ajay Ramachandran
005ca73cce Update Crowdin configuration file 2019-12-20 23:56:49 -05:00
Ajay Ramachandran
8dd8897f1f Fixed yaml formatting 2019-12-20 23:08:34 -05:00
Ajay Ramachandran
95555ed3fd Fixed yaml 2019-12-20 23:06:07 -05:00
Ajay Ramachandran
11b71f7366 Added custom language mapping to crowdin file 2019-12-20 23:03:41 -05:00
Ajay Ramachandran
4537c70105 Update Crowdin configuration file 2019-12-20 22:42:22 -05:00
Ajay Ramachandran
42a0cff162 Update crowdin.yml 2019-12-20 17:55:35 -05:00
Ajay Ramachandran
527e6d4c24 Update Crowdin configuration file 2019-12-20 17:43:23 -05:00
8 changed files with 86 additions and 21 deletions

View File

@@ -82,10 +82,10 @@
"message": "Bist du sicher, dass du Folgendes löschen möchtest?\n\n"
},
"Unknown": {
"message": "Deine Segmente konnte nicht gesendet werden, bitte versuche es später erneut."
"message": "Deine Segmente konnten nicht gesendet werden, bitte versuche es später erneut."
},
"sponsorFound": {
"message": "Die gesponsorten Inhalte dieses Videos befindet sich bereits in der Datenbank!"
"message": "Die gesponsorten Inhalte dieses Videos befinden sich bereits in der Datenbank!"
},
"sponsor404": {
"message": "Keine Sponsoren gefunden"
@@ -214,10 +214,10 @@
"message": "Dieser Knopf entfernt sämtlich Segmente in der Youtube-Zeitleiste."
},
"disableViewTracking": {
"message": "Deaktiviere mitzählen übersprungener Sponsoren"
"message": "Deaktiviere das Mitzählen übersprungener Sponsoren"
},
"enableViewTracking": {
"message": "Aktiviere mitzählen übersprungener Sponsoren"
"message": "Aktiviere das Mitzählen übersprungener Sponsoren"
},
"whatViewTracking": {
"message": "Diese Funktion hält fest, welche Sponsoren von dir übersprungen wurden und hilft anderen zu erfahren, was ihre Einsendungen bewirkt haben.\n Außerdem dienen die Werte zusammen mit positiven Rückmeldungen als Anti-Spam-Schutz. \n Wenn ein gesponsorter Inhalt übersprungen wird, sendet die Erweiterung eine Nachricht an den Server. \n Hoffentlich wird diese Funktion auch weiterhin genutzt, damit der Algorithmus funktioniert. :)"
@@ -292,10 +292,10 @@
"message": "Auto-Überspringen überspringt gesponsorte Inhalte für dich. Wenn deaktiviert, fragt die Benachrichtigung, ob übersprungen werden soll."
},
"youHaveSkipped": {
"message": "Du hast übersprungen "
"message": "Du übersprangst "
},
"youHaveSaved": {
"message": "Du hast dir erspart "
"message": "Du erspartest dir "
},
"minLower": {
"message": "Minute"

View File

@@ -320,5 +320,17 @@
},
"statusReminder": {
"message": "Check status.sponsor.ajay.app for server status."
},
"changeUserID": {
"message": "Import/Export Your UserID"
},
"whatChangeUserID": {
"message": "This should be kept private. This is like a password and should not be shared with anyone. If someone has this, they can impersonate you."
},
"setUserID": {
"message": "Set UserID"
},
"userIDChangeWarning": {
"message": "Warning: Changing the UserID is permanent. Are you sure you would like to do this? Make sure to backup your old one just in case."
}
}

View File

@@ -109,7 +109,7 @@ function submitVote(type, UUID, callback) {
}
//publish this vote
sendRequestToServer("GET", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + "&type=" + type, function(xmlhttp, error) {
sendRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + "&type=" + type, function(xmlhttp, error) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
callback({
successType: 1

View File

@@ -498,12 +498,11 @@ function updatePreviewBar() {
function getChannelID() {
//get channel id
let channelNameContainer = document.getElementById("channel-name");
let channelURLContainer = null;
if (channelNameContainer !== null) {
channelURLContainer = channelNameContainer.querySelector("#container").querySelector("#text-container").querySelector("#text").firstElementChild;
channelURLContainer = document.querySelector("#channel-name > #container > #text-container > #text");
if (channelURLContainer !== null) {
channelURLContainer = channelURLContainer.firstElementChild;
} else {
//old YouTube theme
let channelContainers = document.getElementsByClassName("yt-user-info");
@@ -652,9 +651,9 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
}
}
//send telemetry that a this sponsor was skipped happened
//send telemetry that a this sponsor was skipped
if (trackViewCount && !sponsorSkipped[index]) {
sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
sendRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
if (!disableAutoSkip) {
// Count this as a skip
@@ -941,11 +940,13 @@ function vote(type, UUID, skipNotice) {
let sponsorIndex = UUIDs.indexOf(UUID);
// See if the local time saved count and skip count should be reverted
// See if the local time saved count and skip count should be saved
if (type == 0 && sponsorSkipped[sponsorIndex] || type == 1 && !sponsorSkipped[sponsorIndex]) {
let factor = 1;
if (type == 0) {
factor = -1;
sponsorSkipped[sponsorIndex] = false;
}
// Count this as a skip
@@ -959,8 +960,6 @@ function vote(type, UUID, skipNotice) {
chrome.storage.sync.set({"skipCount": result.skipCount + factor * 1 });
});
sponsorSkipped[sponsorIndex] = !sponsorSkipped[sponsorIndex];
}
chrome.runtime.sendMessage({

9
crowdin.yml Normal file
View File

@@ -0,0 +1,9 @@
files:
- source: /_locales/en/*
translation: /_locales/%two_letters_code%/%original_file_name%
languages_mapping:
two_letters_code:
pr-BR: "pt_BR"
pr-PT: "pt_PT"
zh-CN: "zh_CH"
zh-TW: "zh_TW"

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "__MSG_Name__",
"version": "1.2.1",
"version": "1.2.2",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [

View File

@@ -253,6 +253,28 @@
<br/>
<br/>
<button id="changeUserIDButton" class="warningButton popupElement">__MSG_changeUserID__</button>
<br/>
<sub class="popupElement">
__MSG_whatChangeUserID__
</sub>
<div id="changeUserID" class="popupElement" style="display: none">
<br/>
<br/>
<input id="userIDInput" hint="userID"></input>
<br/>
<br/>
<button id="setUserID" class="warningButton popupElement">__MSG_setUserID__</button>
</div>
<br/>
<br/>
<button id="disableSponsorViewTracking" class="warningButton popupElement">__MSG_disableViewTracking__</button>
<button id="enableSponsorViewTracking" style="display: none" class="warningButton popupElement">__MSG_enableViewTracking__</button>
<br/>

View File

@@ -82,6 +82,11 @@ function runThePopup() {
"setUsername",
"usernameInput",
"submitUsername",
// UserID
"changeUserID",
"changeUserIDButton",
"userIDInput",
"setUserID",
// More
"submissionSection",
"mainControls",
@@ -118,6 +123,8 @@ function runThePopup() {
SB.enableSponsorViewTracking.addEventListener("click", enableSponsorViewTracking);
SB.setUsernameButton.addEventListener("click", setUsernameButton);
SB.submitUsername.addEventListener("click", submitUsername);
SB.changeUserIDButton.addEventListener("click", changeUserIDButton);
SB.setUserID.addEventListener("click", setUserID);
SB.optionsButton.addEventListener("click", openOptions);
SB.reportAnIssue.addEventListener("click", reportAnIssue);
SB.hideDiscordButton.addEventListener("click", hideDiscordButton);
@@ -740,8 +747,8 @@ function runThePopup() {
tabs[0].id,
{message: "getCurrentTime"},
function (response) {
let minutes = document.getElementById(idStartName + chrome.i18n.getMessage("Mins") + index);
let seconds = document.getElementById(idStartName + chrome.i18n.getMessage("Secs") + index);
let minutes = document.getElementById(idStartName + "Minutes" + index);
let seconds = document.getElementById(idStartName + "Seconds" + index);
minutes.value = getTimeInMinutes(response.currentTime);
seconds.value = getTimeInFormattedSeconds(response.currentTime);
@@ -752,8 +759,8 @@ function runThePopup() {
//id start name is whether it is the startTime or endTime
//gives back the time in seconds
function getSponsorTimeEditTimes(idStartName, index) {
let minutes = document.getElementById(idStartName + chrome.i18n.getMessage("Mins") + index);
let seconds = document.getElementById(idStartName + chrome.i18n.getMessage("Secs") + index);
let minutes = document.getElementById(idStartName + "Minutes" + index);
let seconds = document.getElementById(idStartName + "Seconds" + index);
return parseInt(minutes.value) * 60 + parseFloat(seconds.value);
}
@@ -1158,6 +1165,22 @@ function runThePopup() {
SB.setUsernameContainer.style.display = "none";
SB.setUsername.style.display = "unset";
}
function changeUserIDButton() {
//get the user ID
chrome.storage.sync.get(["userID"], function(result) {
SB.userIDInput.value = result.userID;
SB.setUserID.style.display = "unset";
SB.userIDInput.style.display = "unset";
SB.changeUserID.style.display = "unset";
});
}
function setUserID() {
if (!confirm(chrome.i18n.getMessage("userIDChangeWarning"))) return;
chrome.storage.sync.set({"userID": SB.userIDInput.value});
}
//this is not a YouTube video page
function displayNoVideo() {