您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds an option to hide locked threads on the cubecraft forums.
当前为
- // ==UserScript==
- // @name CubecraftHideLockedThreads
- // @namespace de.rasmusantons
- // @description Adds an option to hide locked threads on the cubecraft forums.
- // @include https://www.cubecraft.net/forums/*/*
- // @version 2
- // @grant none
- // ==/UserScript==
- function updateThreadList(hideLocked) {
- var lockedThreads = $('.discussionListItem.locked');
- lockedThreads.each(function(i, e) {
- var thread = $(e);
- thread.css('display', hideLocked ? 'none' : '');
- });
- cnt.text(hideLocked ? '(' + lockedThreads.length + ' locked threads hidden)' : '');
- }
- function onCbChange() {
- localStorage.setItem('hideLocked', this.checked);
- updateThreadList(this.checked);
- }
- var cb = $('<input type="checkbox" />');
- var cnt = $('<span></span>');
- cnt.css('margin-left', '5px');
- cb.get(0).checked = (localStorage.getItem('hideLocked') == "true");
- updateThreadList(cb.get(0).checked);
- cb.change(onCbChange);
- $($('.secondaryContent > .col2')[0]).append($('<li></li>').append($('<a></a>').append($('<label>hide locked threads</label>').prepend(cb))));
- $($('.sectionFooter.SelectionCountContainer')[0]).append(cnt);