您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
CTRL+Double-click to open up a reply and quote whole post
// ==UserScript== // @name Wanikani Forums: Double click Secret // @namespace http://tampermonkey.net/ // @version 0.3 // @description CTRL+Double-click to open up a reply and quote whole post // @author Kumirei // @include https://community.wanikani.com* // @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012 // @grant none // ==/UserScript== ;(function () { 'use strict' var ctrlDown = false window.onkeyup = function (e) { if (e.keyCode == 17) { ctrlDown = false } } window.onkeydown = function (e) { if (e.keyCode == 17) { ctrlDown = true } } waitForKeyElements('#topic', function () { $('.post-stream').on('dblclick', '.topic-post', function () { try { if (ctrlDown) { $(this).find('.widget-button.reply')[0].click() setTimeout(function () { $('textarea.d-editor-input')[0].value = '' $('button.quote').click() setTimeout(function () { var text = $('textarea.d-editor-input').val() if (text.includes('<sup><sup><sup>')) { text = text.slice(text.lastIndexOf('<sup><sup><sup>') + 16, text.length - 11) text = text.replace(/`/g, '') $('textarea.d-editor-input').val(text) $('textarea.d-editor-input').blur() } }, 500) }, 100) } } catch (TypeError) { console.log("I can't believe you've done this") } }) }) })()