Sidebar [Horizontal]

Puts sidebar elements next to each other in a 2 column layout.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Sidebar [Horizontal]
// @namespace    pxgamer
// @version      0.1
// @description  Puts sidebar elements next to each other in a 2 column layout.
// @author       pxgamer
// @include      *kat.cr/*
// @grant        none
// ==/UserScript==
/*jshint multistr: true */

(function() {
    'use strict';

    var params = {
        watchedThreads: '',
        latestForum: '',
        latestNews: '',
        blogroll: '',
        goodies: '',
        friendsLinks: ''
    };

    function init() {
        $('#sidebar').html('<div class="sbLeftCol inlineSbBlock"></div>');
        $('#sidebar').append('<div class="sbRightCol inlineSbBlock"></div>');
        $('.sbLeftCol').append(params.watchedThreads);
        $('.sbLeftCol').append(params.blogroll);
        $('.sbLeftCol').append(params.goodies);
        $('.sbLeftCol').append(params.friendsLinks);
        $('.sbRightCol').append(params.latestForum);
        $('.sbRightCol').append(params.latestNews);
        $('#sidebar').css('display', 'inline-flex');
        $('.inlineSbBlock').css('margin-right', '10px');
    }

    $('.sliderbox').each(function() {
        if ($(this).find('#watchedThreads').length > 0) {
            params.watchedThreads = $(this);
        }
        if ($(this).find('#latestForum').length > 0) {
            params.latestForum = $(this);
        }
        if ($(this).find('#latestNews').length > 0) {
            params.latestNews = $(this);
        }
        if ($(this).find('#blogroll').length > 0) {
            params.blogroll = $(this);
        }
        if ($(this).find('#goodies').length > 0) {
            params.goodies = $(this);
        }
        if ($(this).find('#friendsLinks').length > 0) {
            params.friendsLinks = $(this);
        }
    });

    init();

})();