Skip to content
This repository has been archived by the owner on Mar 23, 2018. It is now read-only.

Commit

Permalink
1.9.5
Browse files Browse the repository at this point in the history
Closes #610
  • Loading branch information
ParticleCore committed Nov 18, 2017
1 parent f91e6c3 commit f6b88cd
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bin/update.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"addons": {
"[email protected]": {
"updates": [{
"version": "1.9.4",
"version": "1.9.5",
"update_link": "https://github.com/ParticleCore/Particle/raw/master/dist/YouTubePlus.xpi",
"applications": {
"gecko": {
Expand Down
Binary file modified dist/Particle.nex
Binary file not shown.
Binary file modified dist/YouTubePlus.xpi
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Opera/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Particle",
"version": "1.9.4",
"version": "1.9.5",
"description": "YouTube with more freedom",
"default_locale": "en",
"icons": {
Expand Down
25 changes: 21 additions & 4 deletions src/Userscript/YouTubePlus.user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ==UserScript==
// @version 1.9.4
// @version 1.9.5
// @name YouTube +
// @namespace https://github.com/ParticleCore
// @description YouTube with more freedom
Expand Down Expand Up @@ -1215,7 +1215,7 @@
button.content.firstChild.dataset.link = temp[j].querySelector("a[href*='/watch?v']").href;
thumb.appendChild(setLocale(button.content).firstChild);
}
if (user_settings.BLK_ON && !thumb.querySelector(".blacklist") && window.yt.config_.PAGE_NAME !== "channel" && window.location.pathname !== "/feed/subscriptions") {
if (user_settings.BLK_ON && list[i] !== "no_channel_id" && !thumb.querySelector(".blacklist") && window.yt.config_.PAGE_NAME !== "channel" && window.location.pathname !== "/feed/subscriptions") {
button = document.createElement("template");
button.innerHTML = //
`<div data-p='ttl|BLCK_ADD&ttp|BLCK_ADD' class='yt-uix-tooltip blacklist'>
Expand Down Expand Up @@ -1285,7 +1285,7 @@
}
}
function getVideos() {
var i, list, temp, video_list, channel_id;
var i, list, temp, video_list, watch_id, channel_id;
modThumbs.thumbs = {};
video_list = Array.from(document.querySelectorAll(`
.yt-shelf-grid-item,
Expand All @@ -1297,7 +1297,8 @@
.yt-lockup-byline > a,
.yt-lockup-content .g-hovercard,
.video-list-item .g-hovercard,
.channels-content-item .yt-lockup-title > a
.channels-content-item .yt-lockup-title > a,
.watch-sidebar-section .content-link
`);
i = list.length;
while (i--) {
Expand All @@ -1318,6 +1319,22 @@
}
temp = temp.parentNode;
}
} else {
watch_id = temp.href.match(/\/watch?/);
if (watch_id) {
watch_id = watch_id[1];
while (temp) {
if (temp.tagName && temp.tagName === "LI" && video_list.indexOf(temp) > -1) {
if (!modThumbs.thumbs["no_channel_id"]) {
modThumbs.thumbs["no_channel_id"] = [temp];
} else if (modThumbs.thumbs["no_channel_id"].indexOf(temp) < 0) {
modThumbs.thumbs["no_channel_id"].push(temp);
}
break;
}
temp = temp.parentNode;
}
}
}
}
}
Expand Down
25 changes: 21 additions & 4 deletions src/Webextension/JS/YouTubePlus.user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ==UserScript==
// @version 1.9.4
// @version 1.9.5
// @name YouTube +
// @namespace https://github.com/ParticleCore
// @description YouTube with more freedom
Expand Down Expand Up @@ -1215,7 +1215,7 @@
button.content.firstChild.dataset.link = temp[j].querySelector("a[href*='/watch?v']").href;
thumb.appendChild(setLocale(button.content).firstChild);
}
if (user_settings.BLK_ON && !thumb.querySelector(".blacklist") && window.yt.config_.PAGE_NAME !== "channel" && window.location.pathname !== "/feed/subscriptions") {
if (user_settings.BLK_ON && list[i] !== "no_channel_id" && !thumb.querySelector(".blacklist") && window.yt.config_.PAGE_NAME !== "channel" && window.location.pathname !== "/feed/subscriptions") {
button = document.createElement("template");
button.innerHTML = //
`<div data-p='ttl|BLCK_ADD&ttp|BLCK_ADD' class='yt-uix-tooltip blacklist'>
Expand Down Expand Up @@ -1285,7 +1285,7 @@
}
}
function getVideos() {
var i, list, temp, video_list, channel_id;
var i, list, temp, video_list, watch_id, channel_id;
modThumbs.thumbs = {};
video_list = Array.from(document.querySelectorAll(`
.yt-shelf-grid-item,
Expand All @@ -1297,7 +1297,8 @@
.yt-lockup-byline > a,
.yt-lockup-content .g-hovercard,
.video-list-item .g-hovercard,
.channels-content-item .yt-lockup-title > a
.channels-content-item .yt-lockup-title > a,
.watch-sidebar-section .content-link
`);
i = list.length;
while (i--) {
Expand All @@ -1318,6 +1319,22 @@
}
temp = temp.parentNode;
}
} else {
watch_id = temp.href.match(/\/watch?/);
if (watch_id) {
watch_id = watch_id[1];
while (temp) {
if (temp.tagName && temp.tagName === "LI" && video_list.indexOf(temp) > -1) {
if (!modThumbs.thumbs["no_channel_id"]) {
modThumbs.thumbs["no_channel_id"] = [temp];
} else if (modThumbs.thumbs["no_channel_id"].indexOf(temp) < 0) {
modThumbs.thumbs["no_channel_id"].push(temp);
}
break;
}
temp = temp.parentNode;
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Webextension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "YouTube Plus",
"version": "1.9.4",
"version": "1.9.5",
"description": "YouTube with more freedom",
"default_locale": "en",
"icons": {
Expand Down

0 comments on commit f6b88cd

Please sign in to comment.