labm0nkey / Youtube Slimfeed

// ==UserScript==
// @id             youtubeslimfeed@labm0nkey
// @name           Youtube Slimfeed
// @version        1.5.5
// @namespace      
// @author         labm0nkey
// @description    Reduces size of each subscription item and removes or makes more visible which video was watched
// @require        http://code.jquery.com/jquery-latest.min.js
// @include        http://www.youtube.com/feed/subscriptions
// @include        https://www.youtube.com/feed/subscriptions
// @include        http://youtube.com/feed/subscriptions/*
// @include        http://*.youtube.com/feed/subscriptions/*
// @include        https://youtube.com/feed/subscriptions/*
// @include        https://*.youtube.com/feed/subscriptions/*
// resource       css style.css
// @run-at         document-end
// @grant          GM_getResourceText
// @grant          GM_addStyle
// @icon	       data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/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NQ3LsXG8PrRUCr/HpG73C7eg+OZlX+1PNK7e/Cy4Ll0nT+CMJrDdNBLIkwoFyBstB9BEBgOFEAQAQxN48/KZU1fPlLof3z0WdB95k9DBA2TNqqDiV88RqKwk0ddH5F9vsezvbxCorKR9+1YA5jf86d5Gw0QoRNfOHRTXr8aJRunct3dCvrJVdZStqrv30dAdHc18YyPU7NozNv4qxa90AlC6ZAmJUIjOA/sx8vKINh+nuH410RMfMnPTZkqXLPl6GghUVpK7aDHX3niNeHc3gcrKiQW4cIH4hQtjQkePHc30r10l2RvGvR4heXVgcgnJ/D17yV20mPNbNhE5e+b/Vu20n/4MgPzaheQuqJ2cDbiWRaKnh6qtvwfg81cOfrMp2cAH73P2qSeJd3eTu2gxTjT6zaZkpT9YRqiymvNbNgHwUMPue58UOo6j7tTC772nPvjJE6rrn2+NzVkjI2qwo0NZIyPKcRw1dOWKGrpy5ba1wY4OFe/vV+/Oq1YXXn15wvPvCkT9R/+Np7SMgpp5t9SWlTXOI3KmT59w7cs8hj93EjbQ0kLszMfj/n3vsbdpWbmC0798hlQkkklIIhHat2+lZeUKuo+8OcZ7cf9faFm5YvJGmF9dTdasCgoeW4q3qAiArr17KK5fjXW5k/73mwEY/LiN6LGjBJ/6BV07d9xKfv96kOL61ZMXwFtYiBHIxxcMYmRljYFL/L8d4901kQBgqPWj287wBYP3vjDxz5mLb/qD+EpKx2vs0UUYgfz7X5r5KyqINh+/DV7936kYg+H7VpoVP7mWS9t/m3nxw3MBKFr4PbqA81s2UfCjVbfUX1k9ziYmInG36jgRCmFkZ+MtLBw35y0qGrOLm7CdGhwc55KuZZEeHR2392sLcL/pfwMAwJ9PUhjyjekAAAAASUVORK5CYII=

// ==/UserScript==

//google chrome fix
if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported") > -1)) {
    this.GM_getValue = function (key, def) {
        return localStorage[key] || def;
    };
    this.GM_setValue = function (key, value) {
        return localStorage[key] = value;
    };
    this.GM_deleteValue = function (key) {
        return delete localStorage[key];
    };
}

(function ($) {

    var debug = false;
    // classes
    var c = {
        slim: {
            watched: ".slim-watched",
            hidden: ".slim-hidden",
            clicked: ".slim-clicked",
            item: ".slim-item",
            resize: ".slim-resize",
            toggle: ".slim-hide"
        },
        yt: {
            item: ".feed-item-container",
            menu: ".feed-item-action-menu",
            thumb: ".yt-lockup-thumbnail",
            navigation: "#channel-navigation-menu",
            feed: "#browse-items-primary",
            container: ".branded-page-v2-container"
        }
    };

    if (debug) {
        for (var i in c) {
            console.log(i, c[i]);
            for (var a in c[i]) {
                console.log(a, $(c[i][a]));
            }
        }
    }

    // options
    var o = {
        hidden: {name: "sf.hidden", "default": true},
        watchedShow: {name: "sf.watched.show", "default": "Show watched"},
        watchedHide: {name: "sf.watched.hide", "default": "Hide watched"}
    };

    function dot(str) {
        return str.substring(1);
    }

    $.fn.slimHide = function () {
        return this.each(function () {
            $(this).find(c.yt.thumb + " .watched").each(function () {
                var list = $(this).closest(c.yt.item);
                list.addClass(dot(c.slim.watched));

                if (getSF(o.hidden))
                    list.addClass(dot(c.slim.hidden));
                else
                    list.removeClass(dot(c.slim.hidden));
            });

            $(this).find(".yt-lockup-tile a, .yt-lockup-thumbnail a").each(function () {
                $(this).mouseup(function () {
                    var list = $(this).closest(c.yt.item);
                    if (!list.hasClass(dot(c.slim.watched)))
                        list.addClass(dot(c.slim.clicked));
                });
            });
        });
    };

    $.fn.slimStyle = function () {
        return this.each(function () {
            if (!$(this).hasClass(dot(c.slim.item))) {
                var menu = $(document.createElement('div')).addClass(dot(c.yt.menu));
                menu.prependTo($(this).find(".feed-item-main"));
                $(this).addClass(dot(c.slim.item));
                if ($(this).find(c.slim.resize).length == 0) {
                    var resize = $(document.createElement('div')).addClass(dot(c.slim.resize));

                    resize.click(function () {
                        $(this).closest(c.yt.item).toggleClass(dot(c.slim.item));
                    });
                    resize.prependTo($(this).find(c.yt.menu));
                }

                $(this).find(c.yt.thumb).on({
                    mouseenter: function (e) {
                        $("body").append("<div id='slim-preview'><img src='" + $(this).find('.yt-thumb-clip img').attr('src') + "' alt='Image preview' /></div>");
                        var p = $(this).offset();
                        var preview = $("#slim-preview");
                        var width = preview.outerWidth();
                        preview
                            .css("top", p.top - 1)
                            .css("left", (p.left - width));
                    },
                    mouseleave: function () {
                        $("#slim-preview").remove();
                    }
                });
                $(this).find(".yt-lockup-meta-info li:first-child").append($(this).find(".shelf-annotation").html());
            }
            $(this).slimHide();
        });
    };

    var cssTxt = "";
    if (debug) {
        cssTxt = GM_getResourceText("css");
    } else {
    cssTxt = ".feed-header{margin:0;height:38px}.feed-header .feed-manage-link{height:35px !important}.feed-header #channel-navigation-menu li{margin-left:4px}.feed-header #channel-navigation-menu li .yt-uix-button-epic-nav-item,.feed-header #channel-navigation-menu li .epic-nav-item-heading{height:32px;line-height:32px;box-shadow:none}.branded-page-v2-container{overflow:hidden;max-width:900px;margin:0 auto}.branded-page-v2-container .branded-page-v2-primary-col{overflow:hidden}.branded-page-v2-container #browse-items-primary{margin:0}.branded-page-v2-container #browse-items-primary:first-child{margin-top:0}.branded-page-v2-container #browse-items-primary .feed-item-main{margin:0}.branded-page-v2-container #browse-items-primary .feed-author-bubble-container{height:100%;width:38px;position:absolute;top:0;left:0;border-right:1px solid #e2e2e2;background:#f3f3f3}.branded-page-v2-container #browse-items-primary .feed-author-bubble-container .feed-author-bubble{margin:0;padding:0;background:none;height:100%;width:100%}.branded-page-v2-container #browse-items-primary .feed-author-bubble-container .feed-author-bubble .feed-item-author{margin:2px}.branded-page-v2-container #browse-items-primary .feed-author-bubble-container .feed-author-bubble .feed-item-author .video-thumb{width:32px;background:#fff;border:1px solid #d3d3d3}.branded-page-v2-container #browse-items-primary .feed-author-bubble-container .feed-author-bubble .feed-item-author .video-thumb img{width:34px;height:34px}.branded-page-v2-container #browse-items-primary .feed-item-action-menu{background:#f1f1f1;right:0;top:0;height:38px;width:32px;-webkit-transition:right 0.3s ease;-moz-transition:right 0.3s ease;-o-transition:right 0.3s ease;transition:right 0.3s ease;border-left:1px solid #e2e2e2;border-bottom:1px solid #e2e2e2;z-index:30}.branded-page-v2-container #browse-items-primary .feed-item-action-menu .yt-uix-button-action-menu{padding:0;height:100%;width:auto;opacity:1 !important}.branded-page-v2-container #browse-items-primary .feed-item-action-menu .slim-resize{float:left;width:10px;height:24px;margin:7px 3px;z-index:99;cursor:pointer;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAYCAYAAAAoG9cuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHlJREFUeNpiZEACq9asNwBS64E4MCwk8AJMnBFNwX4gFgDiD0DsCFPIiEUBDMAVMuJQgKKQBUg4APFEqGA9koJGKO3AiObw/zA20Bq4HBMDEYB6ioY3GIwhDkpPBUhpCVtS+QBKTwdwJLp6WKIjLvkSnREIZSmAAAMApsw4GVv+GT8AAAAASUVORK5CYII=');background-repeat:no-repeat}.branded-page-v2-container .slim-item{margin:0;padding:0;height:38px;border-bottom:1px solid #e2e2e2;border-right:1px solid #e2e2e2;-webkit-transition:background 0.3s ease;-moz-transition:background 0.3s ease;-o-transition:background 0.3s ease;transition:background 0.3s ease}.branded-page-v2-container .slim-item *{padding:0;margin:0}.branded-page-v2-container .slim-item .feed-item-action-menu{right:-33px !important}.branded-page-v2-container .slim-item:last-child{border-bottom:1px solid #e2e2e2}.branded-page-v2-container .slim-item .feed-item-action-menu .yt-uix-button-menu .yt-uix-button-menu-item{padding:0 23px}.branded-page-v2-container .slim-item .shelf-annotation{display:none}.branded-page-v2-container .slim-item .yt-lockup-badges{position:absolute;top:50%;margin-top:-10px;right:10px}.branded-page-v2-container .slim-item .yt-lockup-badges .item-badge-line{display:none}.branded-page-v2-container .slim-item .yt-lockup-badges .yt-subscription-button-subscriber-count-unbranded-horizontal,.branded-page-v2-container .slim-item .yt-lockup-badges .yt-uix-button{padding:0 8px}.branded-page-v2-container .slim-item .feed-item-main{margin:0;padding:0;position:absolute;width:auto;top:0;left:0;right:0;height:38px;min-height:38px;-webkit-transition:right 0.3s ease;-moz-transition:right 0.3s ease;-o-transition:right 0.3s ease;transition:right 0.3s ease}.branded-page-v2-container .slim-item .feed-item-main .yt-shelf-grid-item{width:100%}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container{position:absolute;top:0;left:39px;margin:0;z-index:10;height:100%;right:0;background:transparent}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .feed-item-actions-line,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .feed-item-actions-line{height:100%;display:block;line-height:16px;font-size:12px}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .feed-item-actions-line>a,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .feed-item-actions-line>a{font-weight:bold}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .feed-item-actions-line .feed-item-owner,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .feed-item-actions-line .feed-item-owner{height:100%;display:inline-block;border-right:1px solid #e2e2e2;padding-right:8px;margin-right:6px;font-size:11px}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .feed-item-actions-line .feed-item-time,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .feed-item-actions-line .feed-item-time{display:none}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .yt-lockup-thumbnail,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .yt-lockup-thumbnail{width:67.59615384615384px;margin:0;height:38px;border-right:1px solid #e2e2e2}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .yt-lockup-thumbnail a,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .yt-lockup-thumbnail a{display:block;width:100%;height:100%}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .yt-lockup-thumbnail .video-thumb,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .yt-lockup-thumbnail .video-thumb{display:block;width:100%;height:100%}.branded-page-v2-container .slim-item .feed-item-main .expanded-shelf-content-list .yt-lockup-thumbnail .watched-badge,.branded-page-v2-container .slim-item .feed-item-main .compact-shelf-content-container .yt-lockup-thumbnail .watched-badge{left:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content{position:absolute;top:0;left:0;right:0;height:38px}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .feed-item-content-wrapper{border:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .feed-item-post{display:none}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-wrapper{height:100%}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .branded-page-module-title-text{display:none}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item{height:100%}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .branded-page-module-title{margin:0;height:38px;border-right:1px solid #e2e2e2;width:38px}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .branded-page-module-title .watched-badge{left:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .branded-page-module-title .branded-page-module-title-link{display:block;width:100%;height:100%}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .branded-page-module-title .video-thumb{height:38px;width:38px;margin:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .branded-page-module-title .video-thumb .yt-thumb-clip{height:38px;width:38px;top:0;left:0;right:0;bottom:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .branded-page-module-title .video-thumb .yt-thumb-clip img{height:38px;width:38px;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content{position:absolute;top:0;left:67.59615384615384px;right:0;height:38px;overflow:visible}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-title{margin:0;position:absolute;bottom:0;left:0;height:23px;padding:0 8px}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-title a{height:23px;line-height:23px;font-size:12px;background:transparent}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta{margin:0;position:absolute;top:0;right:0;height:16px;border-left:1px solid #e2e2e2;padding:0;left:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta .yt-lockup-meta-info{height:16px;line-height:16px;font-size:11px}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta .yt-lockup-meta-info li{padding:0 8px;font-weight:bold;background:#f1f1f1;border-bottom:1px solid #e2e2e2;margin:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta .yt-lockup-meta-info li:before{content:none}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta .yt-lockup-meta-info li:nth-child(1){float:left;border-right:1px solid #e2e2e2;white-space:nowrap}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta .yt-lockup-meta-info li:nth-child(2){border-left:1px solid #e2e2e2;float:right}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-meta .yt-lockup-meta-info li:nth-child(3){float:right;border-left:1px solid #e2e2e2}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item .yt-lockup-content .yt-lockup-description{display:none}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item.yt-lockup-playlist .yt-lockup-content .yt-lockup-meta{display:none}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item.yt-lockup-playlist .yt-lockup-content .yt-lockup-playlist-items{display:block;position:absolute;top:0;right:0;height:auto;max-height:38px;max-width:160px;-webkit-transition:all 0.3s ease;-moz-transition:all 0.3s ease;-o-transition:all 0.3s ease;transition:all 0.3s ease;z-index:20;overflow:hidden;border-bottom:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item.yt-lockup-playlist .yt-lockup-content .yt-lockup-playlist-items .yt-lockup-playlist-item{padding:0 8px;height:19px;line-height:19px}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item.yt-lockup-playlist .yt-lockup-content .yt-lockup-playlist-items .yt-lockup-playlist-item:hover{background:#f8f8f8}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .shelf-item.yt-lockup-playlist .yt-lockup-content .yt-lockup-playlist-items:hover{border-right:1px solid #e2e2e2;max-height:60px;max-width:320px;z-index:999}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .channel-lockup{height:38px;margin:0;box-shadow:none}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .channel-lockup .feed-item-content{position:relative;height:100%;padding:0}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .channel-lockup .feed-item-content .feed-item-channel-rec-text{position:absolute;bottom:0;left:0;right:0;padding:0 8px;height:20px;line-height:20px}.branded-page-v2-container .slim-item .feed-item-main .feed-item-main-content .channel-lockup .feed-item-content .feed-subscribe-button{margin:8px}.branded-page-v2-container .slim-item:hover{background:#f4fce8 !important;z-index:100000}.branded-page-v2-container .slim-item:hover .feed-item-main{right:32px;opacity:1}.branded-page-v2-container .slim-item.slim-watched{background:#f3f3f3}.branded-page-v2-container .slim-item.slim-watched .feed-item-main{opacity:.7}.branded-page-v2-container .slim-item.slim-clicked{background:#fcfbe3}.branded-page-v2-container .slim-item.slim-clicked .feed-item-main{opacity:.7}.branded-page-v2-container .slim-item.slim-hidden{display:none}#slim-preview{width:200px;z-index:19999999999;position:absolute;border:1px solid #e2e2e2;background:#f1f1f1;padding:2px}#slim-preview img{width:100%}";
    }

    GM_addStyle(cssTxt);

    $(c.yt.navigation).append('<li class="' + dot(c.slim.toggle) + '"><h2 class="epic-nav-item-heading">' + (getSF(o.hidden) ? getSF(o.watchedShow) : getSF(o.watchedHide)) + '</h2></li>');

    $(c.yt.container).on('DOMNodeInserted', function (event) {
        //console.log("slimStyle", $(event.target), $(event.target).find(c.yt.item));
        if ($(event.target).hasClass(dot(c.yt.item))) {
            $(event.target).slimStyle();
        }
    });

    // first run
    $(c.yt.feed).find(c.yt.item).slimStyle();

    $(c.slim.toggle).click(function () {
        setSF(o.hidden, !getSF(o.hidden));
        $(c.yt.feed).find(c.yt.item).slimHide();
        $(c.slim.toggle + " h2").text(getSF(o.hidden) ? getSF(o.watchedShow) : getSF(o.watchedHide));
    });

    function getSF(key) {
        if (GM_getValue(key.name) == undefined) {
            setSF(key, key.default);
            return key.default;
        } else {
            return GM_getValue(key.name, name);
        }
    }

    function setSF(key, value) {
        GM_setValue(key.name, value);
    }
})
    (jQuery);