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

Commit cfcf24c

Browse files
committed
1.7.7
- Removed webextension migration notice - Fixed control check for a page element
1 parent b234b66 commit cfcf24c

5 files changed

Lines changed: 38 additions & 80 deletions

File tree

bin/update.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"addons": {
33
"unlisted-particle@particlecore.github.io": {
44
"updates": [{
5-
"version": "1.7.6",
5+
"version": "1.7.7",
66
"update_link": "https://github.com/ParticleCore/Particle/raw/master/dist/YouTubePlus.xpi",
77
"applications": {
88
"gecko": {

dist/YouTubePlus.xpi

-427 Bytes
Binary file not shown.

src/Userscript/YouTubePlus.user.js

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==UserScript==
2-
// @version 1.7.6
2+
// @version 1.7.7
33
// @name YouTube +
44
// @namespace https://github.com/ParticleCore
55
// @description YouTube with more freedom
@@ -1556,9 +1556,9 @@
15561556
};
15571557
} else if (
15581558
event.type === "mousemove" && (
1559-
window.hasMoved ||
1560-
Math.abs(event.clientX - window.oldPos.orgX) > 10 ||
1561-
Math.abs(event.clientY - window.oldPos.orgY) > 10)
1559+
window.hasMoved ||
1560+
Math.abs(event.clientX - window.oldPos.orgX) > 10 ||
1561+
Math.abs(event.clientY - window.oldPos.orgY) > 10)
15621562
) {
15631563
window.moveBy(event.clientX - window.oldPos.X, event.clientY - window.oldPos.Y);
15641564
window.hasMoved = true;
@@ -1789,19 +1789,19 @@
17891789
if (
17901790
sidebar &&
17911791
sidebar.parentNode && (
1792-
window.location.pathname === "/results" &&
1793-
sidebar &&
1794-
sidebar.querySelectorAll("*").length < 10) || (
1795-
sidebar && (
1796-
user_settings.GEN_HDE_RECM_SDBR &&
1797-
window.location.href.split("/feed/subscriptions").length > 1 ||
1798-
user_settings.GEN_HDE_SRCH_SDBR &&
1799-
window.location.pathname === "/results" ||
1800-
user_settings.GEN_HDE_CHN_SDBR &&
1801-
window.location.href.split(/\/(channel|user|c)\//).length > 1
1802-
)
1792+
window.location.pathname === "/results" &&
1793+
sidebar &&
1794+
sidebar.querySelectorAll("*").length < 10) || (
1795+
sidebar && (
1796+
user_settings.GEN_HDE_RECM_SDBR &&
1797+
window.location.href.split("/feed/subscriptions").length > 1 ||
1798+
user_settings.GEN_HDE_SRCH_SDBR &&
1799+
window.location.pathname === "/results" ||
1800+
user_settings.GEN_HDE_CHN_SDBR &&
1801+
window.location.href.split(/\/(channel|user|c)\//).length > 1
18031802
)
1804-
) {
1803+
)
1804+
) {
18051805
sidebar.outerHTML = "";
18061806
}
18071807
if (window.location.pathname === "/watch" && user_settings.VID_HIDE_COMS > 1 && comments) {
@@ -1978,7 +1978,7 @@
19781978
if (window.ytpsetwide) {
19791979
window.ytpsetwide("wide", (user_settings.theaterMode ? "1" : "0"), -1);
19801980
}
1981-
if (playerElement && window.location.pathname === "/watch") {
1981+
if (pageElement && playerElement && window.location.pathname === "/watch") {
19821982
pageElement.classList[user_settings.theaterMode ? "add" : "remove"]("watch-wide");
19831983
pageElement.className = pageElement.className.replace(user_settings.theaterMode ? "non-" : "watch-stage", user_settings.theaterMode ? "" : "watch-non-stage");
19841984
playerElement.className = user_settings.theaterMode ? playerElement.className.replace("small", "large") : playerElement.className.replace("large", "small").replace("medium", "small");
@@ -2098,24 +2098,6 @@
20982098
return true;
20992099
}
21002100
}
2101-
function closeMigrationInstructions(event) {
2102-
if (event && event.target && event.target.id === "close_migration_instructions") {
2103-
document.removeEventListener("click", closeMigrationInstructions);
2104-
event.target.parentNode.outerHTML = "";
2105-
set("migration_instructions", true);
2106-
}
2107-
}
2108-
function migrationInstructions() {
2109-
var temp = document.createElement("template");
2110-
temp.innerHTML = //
2111-
`<div style='border-radius: 2px; color: #FFF; font: 12px Roboto,arial,sans-serif; padding: 10px; background-color: rgb(0, 153, 255); box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); position: fixed; z-index: 99999; top: 50%; left: 50%; transform: translate(-50%, -50%);'>
2112-
YouTube Plus has been updated and is now a Webextension. Unfortunately this means that your previous settings need to be imported manually.<br>
2113-
<a href='https://github.com/ParticleCore/Particle/wiki/Restore-settings' target='_blank' style='color:#FFF;font-weight:bold;'>Click here</a> if you wish to import the previous settings or know more about this change.<br>
2114-
<button id='close_migration_instructions' style='background-color: rgba(255, 255, 255, 0.3); color: #FFF; cursor: pointer; margin-top: 10px; border-radius: 2px; padding: 4px; float: right;'>CLOSE</button>
2115-
</div>`;
2116-
document.documentElement.appendChild(temp.content.firstChild);
2117-
document.addEventListener("click", closeMigrationInstructions);
2118-
}
21192101
var api, cid, language, user_settings, player_instance, default_settings;
21202102
if (isMaterial()) {
21212103
return;
@@ -2298,9 +2280,6 @@
22982280
} else {
22992281
document.addEventListener("afterscriptexecute", scriptExit);
23002282
}
2301-
if (!is_userscript && !window.chrome && !user_settings.migration_instructions) {
2302-
migrationInstructions();
2303-
}
23042283
document.addEventListener("spfdone", main);
23052284
document.addEventListener("spfrequest", request);
23062285
document.addEventListener("readystatechange", main, true);
@@ -2354,7 +2333,7 @@
23542333
holder = document.createElement("link");
23552334
holder.rel = "stylesheet";
23562335
holder.type = "text/css";
2357-
holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.6";
2336+
holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.7";
23582337
document.documentElement.appendChild(holder);
23592338
}
23602339
holder = document.createElement("script");

src/Webextension/JS/YouTubePlus.user.js

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==UserScript==
2-
// @version 1.7.6
2+
// @version 1.7.7
33
// @name YouTube +
44
// @namespace https://github.com/ParticleCore
55
// @description YouTube with more freedom
@@ -1556,9 +1556,9 @@
15561556
};
15571557
} else if (
15581558
event.type === "mousemove" && (
1559-
window.hasMoved ||
1560-
Math.abs(event.clientX - window.oldPos.orgX) > 10 ||
1561-
Math.abs(event.clientY - window.oldPos.orgY) > 10)
1559+
window.hasMoved ||
1560+
Math.abs(event.clientX - window.oldPos.orgX) > 10 ||
1561+
Math.abs(event.clientY - window.oldPos.orgY) > 10)
15621562
) {
15631563
window.moveBy(event.clientX - window.oldPos.X, event.clientY - window.oldPos.Y);
15641564
window.hasMoved = true;
@@ -1789,19 +1789,19 @@
17891789
if (
17901790
sidebar &&
17911791
sidebar.parentNode && (
1792-
window.location.pathname === "/results" &&
1793-
sidebar &&
1794-
sidebar.querySelectorAll("*").length < 10) || (
1795-
sidebar && (
1796-
user_settings.GEN_HDE_RECM_SDBR &&
1797-
window.location.href.split("/feed/subscriptions").length > 1 ||
1798-
user_settings.GEN_HDE_SRCH_SDBR &&
1799-
window.location.pathname === "/results" ||
1800-
user_settings.GEN_HDE_CHN_SDBR &&
1801-
window.location.href.split(/\/(channel|user|c)\//).length > 1
1802-
)
1792+
window.location.pathname === "/results" &&
1793+
sidebar &&
1794+
sidebar.querySelectorAll("*").length < 10) || (
1795+
sidebar && (
1796+
user_settings.GEN_HDE_RECM_SDBR &&
1797+
window.location.href.split("/feed/subscriptions").length > 1 ||
1798+
user_settings.GEN_HDE_SRCH_SDBR &&
1799+
window.location.pathname === "/results" ||
1800+
user_settings.GEN_HDE_CHN_SDBR &&
1801+
window.location.href.split(/\/(channel|user|c)\//).length > 1
18031802
)
1804-
) {
1803+
)
1804+
) {
18051805
sidebar.outerHTML = "";
18061806
}
18071807
if (window.location.pathname === "/watch" && user_settings.VID_HIDE_COMS > 1 && comments) {
@@ -1978,7 +1978,7 @@
19781978
if (window.ytpsetwide) {
19791979
window.ytpsetwide("wide", (user_settings.theaterMode ? "1" : "0"), -1);
19801980
}
1981-
if (playerElement && window.location.pathname === "/watch") {
1981+
if (pageElement && playerElement && window.location.pathname === "/watch") {
19821982
pageElement.classList[user_settings.theaterMode ? "add" : "remove"]("watch-wide");
19831983
pageElement.className = pageElement.className.replace(user_settings.theaterMode ? "non-" : "watch-stage", user_settings.theaterMode ? "" : "watch-non-stage");
19841984
playerElement.className = user_settings.theaterMode ? playerElement.className.replace("small", "large") : playerElement.className.replace("large", "small").replace("medium", "small");
@@ -2098,24 +2098,6 @@
20982098
return true;
20992099
}
21002100
}
2101-
function closeMigrationInstructions(event) {
2102-
if (event && event.target && event.target.id === "close_migration_instructions") {
2103-
document.removeEventListener("click", closeMigrationInstructions);
2104-
event.target.parentNode.outerHTML = "";
2105-
set("migration_instructions", true);
2106-
}
2107-
}
2108-
function migrationInstructions() {
2109-
var temp = document.createElement("template");
2110-
temp.innerHTML = //
2111-
`<div style='border-radius: 2px; color: #FFF; font: 12px Roboto,arial,sans-serif; padding: 10px; background-color: rgb(0, 153, 255); box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); position: fixed; z-index: 99999; top: 50%; left: 50%; transform: translate(-50%, -50%);'>
2112-
YouTube Plus has been updated and is now a Webextension. Unfortunately this means that your previous settings need to be imported manually.<br>
2113-
<a href='https://github.com/ParticleCore/Particle/wiki/Restore-settings' target='_blank' style='color:#FFF;font-weight:bold;'>Click here</a> if you wish to import the previous settings or know more about this change.<br>
2114-
<button id='close_migration_instructions' style='background-color: rgba(255, 255, 255, 0.3); color: #FFF; cursor: pointer; margin-top: 10px; border-radius: 2px; padding: 4px; float: right;'>CLOSE</button>
2115-
</div>`;
2116-
document.documentElement.appendChild(temp.content.firstChild);
2117-
document.addEventListener("click", closeMigrationInstructions);
2118-
}
21192101
var api, cid, language, user_settings, player_instance, default_settings;
21202102
if (isMaterial()) {
21212103
return;
@@ -2298,9 +2280,6 @@
22982280
} else {
22992281
document.addEventListener("afterscriptexecute", scriptExit);
23002282
}
2301-
if (!is_userscript && !window.chrome && !user_settings.migration_instructions) {
2302-
migrationInstructions();
2303-
}
23042283
document.addEventListener("spfdone", main);
23052284
document.addEventListener("spfrequest", request);
23062285
document.addEventListener("readystatechange", main, true);
@@ -2354,7 +2333,7 @@
23542333
holder = document.createElement("link");
23552334
holder.rel = "stylesheet";
23562335
holder.type = "text/css";
2357-
holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.6";
2336+
holder.href = "https://particlecore.github.io/Particle/stylesheets/YouTubePlus.css?v=1.7.7";
23582337
document.documentElement.appendChild(holder);
23592338
}
23602339
holder = document.createElement("script");

src/Webextension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "YouTube Plus",
4-
"version": "1.7.6",
4+
"version": "1.7.7",
55
"description": "YouTube with more freedom",
66
"default_locale": "en",
77
"icons": {

0 commit comments

Comments
 (0)