1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | // ==UserScript== // @name 噗浪:表符群組增高器 // @namespace https://www.plurk.com/anonymous // @version 0.1 // @description 表符選單的群組左箭咀將會化為增高箭咀,輕鬆一覽點擊全部群組 // @author ಠ_ಠ // @match https://www.plurk.com/* // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; window.custPlugin = window.custPlugin || {}; window.custPlugin.emo = window.custPlugin.emo || $(); window.custPlugin.emo.extend({ addEmoGroupExpander: function (){ var leftArrow = $('#emoticon-tabs .tabs-arrow-left'); if (leftArrow.hasClass('plug-expander')){ return; } leftArrow.addClass('plug-expander'); var emoTabHeight = $('#emoticon-tabs').css('height'); var emoTabUlWhiteSpace = $('#emoticon-tabs ul').css('white-space'); leftArrow.hover(function(){ if ($(this).hasClass("disabled")){ $(this).removeClass('pif-back'); $(this).removeClass('disabled'); $(this).addClass('pif-option'); } }, function(){ if ($(this).hasClass("pif-option")){ $(this).removeClass('pif-option'); $(this).addClass('pif-back'); $(this).addClass('disabled'); } }); leftArrow.on('click', function(evt){ if ($(this).hasClass("pif-option")){ $(this).removeClass('pif-option'); $(this).addClass('pif-arrow-up'); $('#emoticon-tabs').css('height', 'auto'); $('#emoticon-tabs ul').css('white-space', 'normal'); } else if ($(this).hasClass("pif-arrow-up") && evt.originalEvent !== undefined){ $(this).removeClass('pif-arrow-up'); $(this).addClass('pif-option'); $('#emoticon-tabs').css('height', emoTabHeight); $('#emoticon-tabs ul').css('white-space', emoTabUlWhiteSpace); } }); }, }); new MutationObserver(function (mutations, me) { if (document.querySelector('#emoticon-tabs li.current')){ custPlugin.emo.addEmoGroupExpander(); me.disconnect(); } }).observe(document, {childList: true, subtree: true }); })(); |
Direct link: https://paste.plurk.com/show/PrPuK3nXuwJ3uSJ3zRUb