Skip to content

Commit

Permalink
0.1.7
Browse files Browse the repository at this point in the history
Update extension name in stores to make it easier for users to find
Closes #490
Closes #479
Closes #402
Closes #460
Closes #466
Closes #506
  • Loading branch information
ParticleCore committed Jul 15, 2018
1 parent 79681db commit 441dc1d
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 78 deletions.
2 changes: 1 addition & 1 deletion bin/update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"[email protected]" : {
"updates" : [
{
"version" : "0.1.6",
"version" : "0.1.7",
"update_link" : "https://github.com/ParticleCore/Iridium/raw/master/dist/Iridium.xpi",
"applications" : {
"gecko" : {
Expand Down
Binary file modified dist/Iridium.xpi
Binary file not shown.
80 changes: 46 additions & 34 deletions src/Userscript/Iridium.user.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// ==UserScript==
// @version 0.1.6
// @version 0.1.7
// @name Iridium
// @namespace https://github.com/ParticleCore
// @description YouTube with more freedom
// @compatible firefox
// @compatible chrome
// @icon https://raw.githubusercontent.com/ParticleCore/Iridium/gh-pages/images/i-icon.png
// @match *://www.youtube.com/*
// @exclude *://www.youtube.com/tv*
// @exclude *://www.youtube.com/embed/*
// @exclude *://www.youtube.com/live_chat*
// @run-at document-start
// @homepageURL https://github.com/ParticleCore/Iridium
// @supportURL https://github.com/ParticleCore/Iridium/wiki
Expand Down Expand Up @@ -1655,18 +1652,18 @@
var upload_info;
var watch_page_active;

watch_page_active = document.querySelector("ytd-watch:not([hidden])");
watch_page_active = document.querySelector("ytd-watch:not([hidden]), ytd-watch-flexy:not([hidden])");

if (watch_page_active) {

if ((channel_url = document.querySelector("#owner-name a"))) {

channel_url = channel_url.getAttribute("href");
channel_url = channel_url.getAttribute("href").split(/\/videos/)[0];
channel_id = channel_url.match(/UC([a-z0-9-_]{22})/i);

} else if ((channel_id = iridium_api.getSingleObjectByKey(window.ytplayer, "ucid"))) {

channel_url = "/channel/" + channel_id + "/videos";
channel_url = "/channel/" + channel_id;
channel_id = channel_url.match(/UC([a-z0-9-_]{22})/i);

} else {
Expand Down Expand Up @@ -1777,7 +1774,7 @@
var yt_navigation_manager;
var twoColumnWatchNextResults;

if ((ytd_watch = document.querySelector("ytd-watch"))) {
if ((ytd_watch = document.querySelector("ytd-watch, ytd-watch-flexy"))) {
if (ytd_watch.data) {
if ((twoColumnWatchNextResults = iridium_api.getSingleObjectByKey(ytd_watch.data, ["twoColumnWatchNextResults"]))) {
if ("playlist" in twoColumnWatchNextResults && "playlist" in (playlist = twoColumnWatchNextResults["playlist"])) {
Expand All @@ -1786,7 +1783,7 @@
playlist["contents"].reverse();

if ("currentIndex" in playlist) {
playlist["currentIndex"] = playlist["contents"].length - playlist["currentIndex"] - 1;
playlist["currentIndex"] = playlist["totalVideos"] - playlist["currentIndex"] - 1;
}

if ("localCurrentIndex" in playlist) {
Expand Down Expand Up @@ -1840,6 +1837,7 @@

var defaultLabel;
var toggledLabel;
var notificationActionRenderer;

this["defaultIcon"].iconType = "REVERSE";
this["accessibility"].label = i18n.playlist_reverse_control.button_label;
Expand All @@ -1860,6 +1858,18 @@
}
}

if ((defaultLabel = iridium_api.getObjectByKey(this["defaultServiceEndpoint"], ["simpleText"]))) {
if (defaultLabel.length) {
defaultLabel[0].target.simpleText = i18n.playlist_reverse_control.toggle_on;
}
}

if ((toggledLabel = iridium_api.getObjectByKey(this["toggledServiceEndpoint"], ["simpleText"]))) {
if (toggledLabel.length) {
toggledLabel[0].target.simpleText = i18n.playlist_reverse_control.toggle_off;
}
}

},
buildReverseButton: function (data) {

Expand Down Expand Up @@ -2402,7 +2412,7 @@

var watch_page_api;

if (user_settings.player_memorize_size && window.location.pathname === "/watch" && (watch_page_api = document.querySelector("ytd-watch"))) {
if (user_settings.player_memorize_size && window.location.pathname === "/watch" && (watch_page_api = document.querySelector("ytd-watch, ytd-watch-flexy"))) {
try {
watch_page_api["theaterModeChanged_"](user_settings.theaterMode);
} catch (ignore) {
Expand Down Expand Up @@ -2883,7 +2893,7 @@

if (this.ironMediaQueryList) {

if ((ytd_watch = document.querySelector("ytd-watch"))) {
if ((ytd_watch = document.querySelector("ytd-watch, ytd-watch-flexy"))) {
for (i = 0; i < this.ironMediaQueryList.childElementCount; i++) {
ytd_watch.appendChild(this.ironMediaQueryList.firstElementChild);
}
Expand Down Expand Up @@ -3050,7 +3060,7 @@
if (!this.ironMediaQueryList) {

this.ironMediaQueryList = document.createDocumentFragment();
media_query_list = document.querySelectorAll("ytd-watch iron-media-query");
media_query_list = document.querySelectorAll("ytd-watch iron-media-query, ytd-watch-flexy iron-media-query");

for (i = 0; i < media_query_list.length; i++) {
this.ironMediaQueryList.appendChild(media_query_list[i]);
Expand Down Expand Up @@ -3092,7 +3102,7 @@

if (this.ironMediaQueryList) {

if ((ytd_watch = document.querySelector("ytd-watch"))) {
if ((ytd_watch = document.querySelector("ytd-watch, ytd-watch-flexy"))) {
for (i = 0; i < this.ironMediaQueryList.childElementCount; i++) {
ytd_watch.appendChild(this.ironMediaQueryList.firstElementChild);
}
Expand Down Expand Up @@ -3246,7 +3256,7 @@

controls = document.querySelector("#iri-quick-controls");

if (user_settings.player_quick_controls && document.querySelector("ytd-watch:not([hidden])") && (meta_section = document.querySelector("#menu-container"))) {
if (user_settings.player_quick_controls && document.querySelector("ytd-watch:not([hidden]), ytd-watch-flexy:not([hidden])") && (meta_section = document.querySelector("#menu-container"))) {

if (!controls) {

Expand Down Expand Up @@ -3918,7 +3928,7 @@

if (!iridium_api.isPopUpPlayer && (player_api = document.getElementById("movie_player"))) {

is_in_theater_mode = document.querySelector("ytd-watch[theater]");
is_in_theater_mode = document.querySelector("ytd-watch[theater], ytd-watch-flexy[theater");

if (!document.querySelector(".iri-always-visible,.iri-always-playing")) {
player_api.removeAttribute("style");
Expand Down Expand Up @@ -4988,12 +4998,16 @@
pos: pos
});

} else if (obj[property].constructor === Object) {
results = results.concat(this.getObjectByKey(obj[property], keys, match, list, pos));
} else if (obj[property].constructor === Array) {
for (i = 0; i < obj[property].length; i++) {
results = results.concat(this.getObjectByKey(obj[property][i], keys, match, obj[property], i));
} else if (obj[property]) {

if (obj[property].constructor === Object) {
results = results.concat(this.getObjectByKey(obj[property], keys, match, list, pos));
} else if (obj[property].constructor === Array) {
for (i = 0; i < obj[property].length; i++) {
results = results.concat(this.getObjectByKey(obj[property][i], keys, match, obj[property], i));
}
}

}

}
Expand Down Expand Up @@ -5624,29 +5638,27 @@
isAllowedPage: function () {

var current_page;
var allowed_pages;
var disallowed_pages;

if ((current_page = window.location.pathname.match(/\/[a-z-]+/))) {
current_page = current_page[0];
} else {
current_page = window.location.pathname;
}

allowed_pages = [
"/",
"/index",
"/feed",
"/results",
"/shared",
"/watch",
"/channel",
"/user",
"/c",
"/playlist",
"/iridium-settings"
disallowed_pages = [
"tv",
"embed",
"live_chat",
"account",
"account_notifications",
"create_channel",
"dashboard",
"upload",
"webcam"
];

return allowed_pages.indexOf(current_page) > -1;
return disallowed_pages.indexOf(current_page) < 0;

},
generateUUID: function () {
Expand Down
9 changes: 6 additions & 3 deletions src/Webextension/css/Iridium.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ svg {
pointer-events : none;
}

ytd-watch:not([hidden]) .ytp-thumbnail-overlay {
ytd-watch:not([hidden]) .ytp-thumbnail-overlay,
ytd-watch-flexy:not([hidden]) .ytp-thumbnail-overlay {
transition : none !important;
}

Expand Down Expand Up @@ -253,7 +254,8 @@ yt-img-shadow:hover #iri-video-preview {
display : none;
}

html.iri-always-playing ytd-watch[hidden] {
html.iri-always-playing ytd-watch[hidden],
html.iri-always-playing ytd-watch-flexy[hidden] {
display : block !important;
height : 0;
overflow : hidden;
Expand Down Expand Up @@ -808,7 +810,8 @@ html:not(.iri-full-browser) #iri-full-browser-info {
opacity : 0;
}

.iri-full-browser.video_active ytd-watch:not([hidden]) #movie_player {
.iri-full-browser.video_active ytd-watch:not([hidden]) #movie_player,
.iri-full-browser.video_active ytd-watch-flexy:not([hidden]) #movie_player {
background : #000;
position : fixed;
top : 0 !important;
Expand Down
Loading

0 comments on commit 441dc1d

Please sign in to comment.