您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Позволяет свернуть список закреплёных тем в разделе
当前为
// ==UserScript== // @name LZTHideStickyThreads // @namespace MeloniuM/LZT // @version 1.0 // @description Позволяет свернуть список закреплёных тем в разделе // @author MeloniuM // @license MIT // @match https://zelenka.guru/forums/* // @icon https://www.google.com/s2/favicons?sz=64&domain=zelenka.guru // @require https://zelenka.guru/js/jquery/jquery-2.1.4.min.js // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; let turn = true; let _button = true; function start(){ if (!turn) return; if ($('.discussionListItems .stickyThreads .discussionListItem').length != 0){ if (_button){ let button, btn_text, span; button = $('<a class="button middle hideStickyThreads" style="width: 100%;"><span class="fas fa-chevron-down" style="position: absolute; right: 7px; top: 2px; text-align: center; width: 30px; line-height: 32px;"></span><p></p></a>'); $('.discussionListItems').prepend(button); span = $('.hideStickyThreads span'); $('.hideStickyThreads p').text((localStorage.getItem('hideStickyThreads') == 'true'? 'Раскрыть закреплённые темы': 'Скрыть закрепленные темы')); $(button).on('click', function(e){ if ($('.discussionListItems .stickyThreads .discussionListItem').is(':hidden')){ $('.hideStickyThreads span').css('transform', 'rotate(180deg)'); $('.discussionListItems .stickyThreads .discussionListItem').slideDown('normal'); $('.hideStickyThreads p').text('Скрыть закреплённые темы'); localStorage.setItem('hideStickyThreads', false) }else{ $('.hideStickyThreads span').css('transform', ''); $('.discussionListItems .stickyThreads .discussionListItem').slideUp('normal'); $('.hideStickyThreads p').text('Раскрыть закреплённые темы'); localStorage.setItem('hideStickyThreads', true); } }); _button = false; } if (localStorage.getItem('hideStickyThreads') == 'false'){ turn = false; return; } $('.discussionListItems .stickyThreads .discussionListItem').hide(); } requestAnimationFrame(start); } $('body').on('redy', function(){ turn = false; }); requestAnimationFrame(start); })();