Adds a pin/close button to the top-right of the requests pane. Pane stays fully open w/o hovering when pinned.
目前為
// ==UserScript==
// @version 1.0.2
// @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 GM_addStyle
// @require https://code.jquery.com/jquery.min.js
// ==/UserScript==
// Style Updates
var css = [
'body.full div.panel.requests.pinned { transform:translateX(-100%) !important; }',
'body.full div.panel.requests.pinned ul.request_icons li { visibility:visible !important; opacity:.5; }',
'body.full div.panel.requests > div.close:first-child { display:block !important; }',
'body.full div.panel.requests > div.close:first-child > img.close { display:none; }',
'body.full div.panel.requests > div.close:first-child > img.pin { display:block; }',
'body.full div.panel.requests.pinned > div.close:first-child > img.close { display:block; }',
'body.full div.panel.requests.pinned > div.close:first-child > img.pin { display:none; }'
];
GM_addStyle(css.join("\n"));
// Close Button
jQuery(document).ready(function($) {
var closeBtn = $('body.full div.panel.requests > div.close:first-child');
closeBtn.find('img').addClass('close').clone().attr('src', 'http://i.imgur.com/waouJLl.png').attr('class', 'pin').appendTo(closeBtn);
closeBtn.off().click(function() {
$('body.full div.panel.requests').toggleClass('pinned');
});
});