Greasy Fork

Greasy Fork is available in English.

汤不热首页只显示视频,并去掉推荐内容(Tumblr Show only video on the Dashboard and remove the recommended content)

首页只显示视频,并去掉推荐内容(Tumblr Show only video on the Dashboard and remove the recommended content)

当前为 2018-08-08 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         汤不热首页只显示视频,并去掉推荐内容(Tumblr Show only video on the Dashboard and remove the recommended content)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  首页只显示视频,并去掉推荐内容(Tumblr Show only video on the Dashboard and remove the recommended content)
// @author       Frank
// @match        https://www.tumblr.com/dashboard
// @grant        none
// ==/UserScript==

var $ = window.jQuery;

var liAmount = 0;

$(document).ready(function(){
    hidePhotoDiv();
    showVpnTutorial();
    $(window).scroll(function(event){
        var newLiAmount = $( "#posts li.post_container" ).length;
        if (newLiAmount > liAmount) {
            hidePhotoDiv();
            liAmount = newLiAmount;
        }
    });
});

function hidePhotoDiv() {
    $( "#posts li.post_container div.post_full" ).each(function( index, element ) {
      if (index > 0){
            var dataType = $(this).attr('data-type');
            var isRecommend = $(this).attr('data-is_recommended');
            if (dataType !== 'video' || isRecommend === '1') {
                $(this).parent().remove();
            }
        }
    });
}

function showVpnTutorial() {
    var firstBlog = $( "#posts li.post_container:eq(1) div.post_content_inner");
    var comment = firstBlog.find("p");
    if(comment.length === 0) {
        firstBlog.append('<div class="reblog-list-item contributed-content"><div class="reblog-content"><p><a href="https://mp.weixin.qq.com/s?__biz=MzI5MDMzODAxMw==&mid=100000611&idx=1&sn=136b2098615aba641745be086c2df3b4&chksm=6c2026d15b57afc72761ca22c981221e20f0b7b382173a8ae5c405ad067d148a016f2e36dc6f&mpshare=1&scene=1&srcid=0731alSomHhi9bDz37l3MDCs#rd">一键安装VPN教程</a></p></div></div>');
    } else {
        $(comment[0]).html('<a href="https://mp.weixin.qq.com/s?__biz=MzI5MDMzODAxMw==&mid=100000611&idx=1&sn=136b2098615aba641745be086c2df3b4&chksm=6c2026d15b57afc72761ca22c981221e20f0b7b382173a8ae5c405ad067d148a016f2e36dc6f&mpshare=1&scene=1&srcid=0731alSomHhi9bDz37l3MDCs#rd">一键安装VPN教程</a>');
    }

}