Rainwave v5: Pin Request Pane

Adds a pin/close button to the top-right of the requests pane. Pane stays fully open w/o hovering when pinned.

当前为 2015-12-28 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @version      1.0.1
// @author       Nmaster64
// @namespace    http://twitter.com/nmaster64
// @match        http://*.rainwave.cc/*
// @name         Rainwave v5: Pin Request Pane
// @description  Adds a pin/close button to the top-right of the requests pane. Pane stays fully open w/o hovering when pinned.
// @grant        none
// @require      https://code.jquery.com/jquery.min.js
// ==/UserScript==

jQuery(document).ready(function($) {
    
    function addGlobalStyle(css) {
        var stylesId = 'tm-custom-styles';
        if($('#'+stylesId).length < 1) {
            $('<style>').attr('id', stylesId).attr('type', 'text/css').html('').appendTo($('head'));
        }
        $('#'+stylesId).append(css);
    }
    
    addGlobalStyle('body.full div.panel.requests.pinned { transform:translateX(-100%) !important; }');
    addGlobalStyle('body.full div.panel.requests.pinned ul.request_icons li { visibility:visible !important; opacity:.5; }');
    
    addGlobalStyle('body.full div.panel.requests > div.close:first-child { display:block !important; }');
    addGlobalStyle('body.full div.panel.requests > div.close:first-child > img.close { display:none; }');
    addGlobalStyle('body.full div.panel.requests > div.close:first-child > img.pin { display:block; }');
    addGlobalStyle('body.full div.panel.requests.pinned > div.close:first-child > img.close { display:block; }');
    addGlobalStyle('body.full div.panel.requests.pinned > div.close:first-child > img.pin {  display:none; }');
    
    var $close = $('body.full div.panel.requests > div.close:first-child');
    $close.find('img').addClass('close').clone().attr('src', 'http://i.imgur.com/waouJLl.png').attr('class', 'pin').appendTo($close);
    $close.off().click(function() {
        $('body.full div.panel.requests').toggleClass('pinned');
    });
    
});