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

Commit

Permalink
Things will be pushed down if thing is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
YePpHa committed Aug 17, 2013
1 parent fdc6e6c commit 10f3d5f
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 184 deletions.
2 changes: 1 addition & 1 deletion build/.styles/ytcenter-styles-general.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/.styles/ytcenter-styles-grid-subscriptions.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/YouTubeCenter.crx
Binary file not shown.
Binary file modified dist/YouTubeCenter.mxaddon
Binary file not shown.
Binary file modified dist/YouTubeCenter.oex
Binary file not shown.
85 changes: 25 additions & 60 deletions dist/YouTubeCenter.safariextension/YouTubeCenter.user.js

Large diffs are not rendered by default.

85 changes: 25 additions & 60 deletions dist/YouTubeCenter.user.js

Large diffs are not rendered by default.

Binary file modified dist/YouTubeCenter.xpi
Binary file not shown.
37 changes: 33 additions & 4 deletions src/.styles/ytcenter-styles-general.css
Original file line number Diff line number Diff line change
Expand Up @@ -869,23 +869,52 @@ ul.ytcenter-menu-3d-hide li.ytcenter-menu-item-3d {
}

/* Thumbnail */
.ytcenter-thumbnail-quality {
position: absolute;
vertical-align: middle;
padding: 2px 4px;
line-height: 14px;
font-weight: bold;
font-size: 11px;
zoom: 1;
border-radius: 2px;
}


.ytcenter-thumbnail-watchlater-pos-topleft .addto-watch-later-button,
.ytcenter-thumbnail-timecode-pos-topleft .video-time {
.ytcenter-thumbnail-timecode-pos-topleft .video-time,
.ytcenter-thumbnail-quality-pos-topleft .ytcenter-thumbnail-quality,
.ytcenter-thumbnail-ratingcount-pos-topleft .ytcenter-thumbnail-ratingcount {
top: 2px!important;
left: 2px!important;
}

.ytcenter-video-watched-wrapper .ytcenter-thumbnail-watchlater-pos-topleft .addto-watch-later-button,
.ytcenter-video-watched-wrapper .ytcenter-thumbnail-timecode-pos-topleft .video-time,
.ytcenter-video-watched-wrapper .ytcenter-thumbnail-quality-pos-topleft .ytcenter-thumbnail-quality,
.ytcenter-video-watched-wrapper .ytcenter-thumbnail-ratingcount-pos-topleft .ytcenter-thumbnail-ratingcount {
top: 24px!important;
left: 2px!important;
}

.ytcenter-thumbnail-watchlater-pos-topright .addto-watch-later-button,
.ytcenter-thumbnail-timecode-pos-topright .video-time {
.ytcenter-thumbnail-timecode-pos-topright .video-time,
.ytcenter-thumbnail-quality-pos-topright .ytcenter-thumbnail-quality,
.ytcenter-thumbnail-ratingcount-pos-topright .ytcenter-thumbnail-ratingcount {
top: 2px!important;
right: 2px!important;
}
.ytcenter-thumbnail-watchlater-pos-bottomleft .addto-watch-later-button,
.ytcenter-thumbnail-timecode-pos-bottomleft .video-time {
.ytcenter-thumbnail-timecode-pos-bottomleft .video-time,
.ytcenter-thumbnail-quality-pos-bottomleft .ytcenter-thumbnail-quality,
.ytcenter-thumbnail-ratingcount-pos-bottomleft .ytcenter-thumbnail-ratingcount {
bottom: 2px!important;
left: 2px!important;
}
.ytcenter-thumbnail-watchlater-pos-bottomright .addto-watch-later-button,
.ytcenter-thumbnail-timecode-pos-bottomright .video-time {
.ytcenter-thumbnail-timecode-pos-bottomright .video-time,
.ytcenter-thumbnail-quality-pos-bottomright .ytcenter-thumbnail-quality,
.ytcenter-thumbnail-ratingcount-pos-bottomright .ytcenter-thumbnail-ratingcount {
bottom: 2px!important;
right: 2px!important;
}
Expand Down
1 change: 1 addition & 0 deletions src/.styles/ytcenter-styles-grid-subscriptions.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
color: #fff;
padding: 5px;
font-weight: bold;
font-size: 12px!important;
}
.ytcenter-video-watched {
opacity: 0.3;
Expand Down
81 changes: 23 additions & 58 deletions src/YouTubeCenter.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3583,8 +3583,8 @@
}
function addNewDataToCache(data) {
if (isInCache(data)) return;
var cacheSize = 150, nData = {};
while (ytcenter.settings.commentCountryData.length >= cacheSize) removeOldestFromCache();
var nData = {};
while (ytcenter.settings.commentCountryData.length >= ytcenter.settings.commentCacheSize) removeOldestFromCache();
nData.id = data.id;
nData.reused = 0;
nData.date = ytcenter.utils.now();
Expand Down Expand Up @@ -4192,7 +4192,8 @@
dislikeIcon = document.createElement("img");
numLikesDislikes.className = "video-extras-likes-dislikes"
+ (ytcenter.settings.videoThumbnailRatingsCountVisible === "show_hover" ? " ytcenter-video-thumb-show-hover" : "")
+ (ytcenter.settings.videoThumbnailRatingsCountVisible === "hide_hover" ? " ytcenter-video-thumb-hide-hover" : "");
+ (ytcenter.settings.videoThumbnailRatingsCountVisible === "hide_hover" ? " ytcenter-video-thumb-hide-hover" : "")
+ " ytcenter-thumbnail-ratingcount";
numLikesDislikes.style.background = "#000";
numLikesDislikes.style.opacity = "0.75";
numLikesDislikes.style.filter = "alpha(opacity=75)";
Expand Down Expand Up @@ -4247,24 +4248,7 @@
}

numLikesDislikes.style.position = "absolute";
switch (ytcenter.settings.videoThumbnailRatingsCountPosition) {
case "topleft":
numLikesDislikes.style.top = "2px";
numLikesDislikes.style.left = "2px";
break;
case "topright":
numLikesDislikes.style.top = "2px";
numLikesDislikes.style.right = "2px";
break;
case "bottomleft":
numLikesDislikes.style.bottom = "2px";
numLikesDislikes.style.left = "2px";
break;
case "bottomright":
numLikesDislikes.style.bottom = "2px";
numLikesDislikes.style.right = "2px";
break;
}
item.content.className += " ytcenter-thumbnail-ratingcount-pos-" + ytcenter.settings.videoThumbnailRatingsCountPosition;
item.content.appendChild(numLikesDislikes);
} catch (e) {
con.error("[Id=" + item.id + "] Likes: " + likes + ", " + dislikes);
Expand Down Expand Up @@ -4317,39 +4301,13 @@
}

wrapper.className = (ytcenter.settings.videoThumbnailQualityVisible === "show_hover" ? " ytcenter-video-thumb-show-hover" : "")
+ (ytcenter.settings.videoThumbnailQualityVisible === "hide_hover" ? " ytcenter-video-thumb-hide-hover" : "");
+ (ytcenter.settings.videoThumbnailQualityVisible === "hide_hover" ? " ytcenter-video-thumb-hide-hover" : "")
+ " ytcenter-thumbnail-quality";
wrapper.textContent = text;
item.content.className += " ytcenter-thumbnail-quality-pos-" + ytcenter.settings.videoThumbnailQualityPosition;

wrapper.style.position = "absolute";
switch (ytcenter.settings.videoThumbnailQualityPosition) {
case "topleft":
wrapper.style.top = "2px";
wrapper.style.left = "2px";
break;
case "topright":
wrapper.style.top = "2px";
wrapper.style.right = "2px";
break;
case "bottomleft":
wrapper.style.bottom = "2px";
wrapper.style.left = "2px";
break;
case "bottomright":
wrapper.style.bottom = "2px";
wrapper.style.right = "2px";
break;
}
wrapper.style.verticalAlign = "middle";
/*wrapper.style.opacity = "0.75";
wrapper.style.filter = "alpha(opacity=75)";*/
wrapper.style.padding = "2px 4px";
wrapper.style.lineHeight = "14px";
wrapper.style.fontWeight = "bold";
wrapper.style.fontSize = "11px";
wrapper.style.zoom = "1";
wrapper.style.background = background;
wrapper.style.color = color;
wrapper.style.borderRadius = "2px";

item.content.appendChild(wrapper);
}
Expand All @@ -4362,15 +4320,20 @@
ytcenter.utils.addClass(item.wrapper, "ytcenter-thumbnail-timecode-visible-" + ytcenter.settings.videoThumbnailTimeCodeVisible);
}
function applyWatchedMessage(item) {
if (ytcenter.settings.gridSubscriptionsPage && loc.pathname === "/feed/subscriptions" && ytcenter.videoHistory.isVideoWatched(item.id) && !ytcenter.utils.hasClass(item.content, "ytcenter-video-watched")) {
var watchedElement = document.createElement("div");
if (ytcenter.videoHistory.isVideoWatched(item.id) && !ytcenter.utils.hasClass(item.content, "ytcenter-video-watched")) {
var watchedElement = document.createElement("div"), a, i;
watchedElement.className = "ytcenter-video-watched-content";
watchedElement.textContent = ytcenter.language.getLocale("SETTINGS_WATCHED");
ytcenter.language.addLocaleElement(watchedElement, "SETTINGS_WATCHED", "@textContent");

item.content.className += " ytcenter-video-watched";
item.content.appendChild(watchedElement);
item.content.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className += " ytcenter-video-watched-wrapper";
a = item.content;
for (i = 0; i < 10; i++) {
a = a.parentNode;
if (a.tagName === "LI" || !a) break;
}
if (a) a.className += " ytcenter-video-watched-wrapper";
}
}
function processItemHeavyLoad(item) {
Expand Down Expand Up @@ -4510,8 +4473,8 @@
}
function addNewDataToCache(data) {
if (isInCache(data)) return;
var cacheSize = 75, nData = {};
while (ytcenter.settings.videoThumbnailData.length >= cacheSize) removeOldestFromCache();
var nData = {};
while (ytcenter.settings.videoThumbnailData.length >= ytcenter.settings.videoThumbnailCacheSize) removeOldestFromCache();
nData.id = data.id;
nData.reused = 0;
nData.date = ytcenter.utils.now();
Expand Down Expand Up @@ -9322,6 +9285,8 @@
})();
con.log("default settings initializing");
ytcenter._settings = {
videoThumbnailCacheSize: 75,
commentCacheSize: 150,
watchedVideosIndicator: true,
hideWatchedVideos: true,
watchedVideos: [],
Expand Down Expand Up @@ -9704,8 +9669,6 @@
}
],
"help": "https://github.com/YePpHa/YouTubeCenter/wiki/Features#set-experimental-topbar-to-static"
}, {
"type": "horizontalRule"
}, {
"label": "SETTINGS_GRIDSUBSCRIPTIONS",
"type": "bool",
Expand All @@ -9718,6 +9681,8 @@
}
],
"defaultSetting": "gridSubscriptionsPage"
}, {
"type": "horizontalRule"
}, {
"label": "SETTINGS_WATCHEDVIDEOS_INDICATOR",
"type": "bool",
Expand Down Expand Up @@ -13498,7 +13463,7 @@
document.getElementById("page").style.setProperty("margin", "");
return false;
}},
{element: function(){return document.body;}, className: "ytcenter-hide-watched-videos", condition: function(){return loc.pathname === "/feed/subscriptions" && ytcenter.settings.gridSubscriptionsPage && ytcenter.settings.hideWatchedVideos;}},
{element: function(){return document.body;}, className: "ytcenter-hide-watched-videos", condition: function(){return ytcenter.settings.gridSubscriptionsPage && ytcenter.settings.hideWatchedVideos;}},
{element: function(){return document.body;}, className: "ytcenter-grid-subscriptions", condition: function(){return loc.pathname === "/feed/subscriptions" && ytcenter.settings.gridSubscriptionsPage;}},
{element: function(){return document.getElementById("page");}, className: "no-flex", condition: function(){return !ytcenter.settings.flexWidthOnPage && loc.pathname !== "/watch";}},
{element: function(){return document.body;}, className: "ytcenter-lights-off", condition: function(){return ytcenter.player.isLightOn;}},
Expand Down

0 comments on commit 10f3d5f

Please sign in to comment.