Greasy Fork

Greasy Fork is available in English.

知乎 ReFine

try to take over the world!

目前为 2016-01-20 提交的版本。查看 最新版本

// @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js// ==UserScript==
// @name         知乎 ReFine
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  try to take over the world!
// @author       You
// @match        https://www.zhihu.com/*
// @grant        GM_addStyle
// @run-at       document-start
// @require      http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// ==/UserScript==
/* jshint -W097 */
'use strict';

var styleStr = "";
styleStr = styleStr+".zm-editable-content {";
styleStr = styleStr+'font-family: Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, "TW\-Kai", serif;';
styleStr = styleStr+"	font-size: 19px;";
styleStr = styleStr+"	color:black;";
styleStr = styleStr+"}";

styleStr = styleStr+".zu-top-nav-link, .top-nav-profile, zu-top-add-question {";
styleStr = styleStr+'font-family: Georgia, "Nimbus Roman No9 L", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;';
styleStr = styleStr+"	font-size: 16px;";
styleStr = styleStr+"}";

styleStr = styleStr+".question_link {";
styleStr = styleStr+'font-family: "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;';
styleStr = styleStr+"	font-size: 16px;";
styleStr = styleStr+"}";



styleStr = styleStr+".zm-profile-item-text {";
styleStr = styleStr+'font-family: "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;';
styleStr = styleStr+"	font-size: 12px;";
styleStr = styleStr+"}";


styleStr = styleStr+".zh-summary.summary.clearfix {";
styleStr = styleStr+'font-family: Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, "TW\-Kai", serif;';
styleStr = styleStr+"	font-size: 17px;";
styleStr = styleStr+"}";
styleStr = styleStr+"";
styleStr = styleStr+".zu-main-sidebar {";
styleStr = styleStr+"	display:none;";
styleStr = styleStr+"}";
styleStr = styleStr+"";
styleStr = styleStr+".zu-main-content-inner{";
styleStr = styleStr+"	margin-right:10px;";
styleStr = styleStr+"}";
styleStr = styleStr+"";
styleStr = styleStr+".comment-app-holder, .zm-comment-box{";
styleStr = styleStr+"	max-width:5000px;";
styleStr = styleStr+"}";
styleStr = styleStr+"";
styleStr = styleStr+".zh-backtotop{";
styleStr = styleStr+"	left:80%;";
styleStr = styleStr+"}";
styleStr = styleStr+"";
styleStr = styleStr+".zm-profile-side-following, .zm-profile-side-section {";
styleStr = styleStr+"	display:block!important;";
styleStr = styleStr+"}";



GM_addStyle(styleStr);

$( document ).ready(function(){
    console.log("Let's Take Over the World of 知乎 !");
    if( $('.zm-profile-side-following a').length>0){
        var following = $('.zm-profile-side-following a').eq(0).find('strong').text();
        var followingUrl = $('.zm-profile-side-following a').eq(0).attr('href');
        var followed = $('.zm-profile-side-following a').eq(1).find('strong').text();
        var followedUrl = $('.zm-profile-side-following a').eq(1).attr('href');

        console.info("Following "+ following + ", Followed by " +followed);
        
        $('.profile-navbar').append('<a class="item" href="'+followingUrl+'"> 关注中 <span class="num">'+following+'</span></a>');
        $('.profile-navbar').append('<a class="item" href="'+followedUrl+'"> 关注者 <span class="num">'+followed+'</span></a>');
        
    }
});