Bunpro: Disable Undo on SRS 11 reviews

Disables the undo button on the last SRS stage

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Bunpro: Disable Undo on SRS 11 reviews
// @namespace    http://tampermonkey.net/
// @version      1.0.3
// @description  Disables the undo button on the last SRS stage
// @author       Kumirei
// @include      *bunpro.jp/*
// @exclude      *community.bunpro.jp*
// @require      https://greasyfork.org/scripts/370623-bunpro-helpful-events/code/Bunpro:%20Helpful%20Events.js?version=974369
// @grant        none
// ==/UserScript==

(function() {
    var $ = window.$;

    const disable_srs = 11; // Disables undo on all items at and above this srs level
    $('html')[0].addEventListener('new-review-item', ()=>{
        var srs = $('.srs-tracker')[0].innerText.split(' ')[1];
        var button_moved = $('head .oops-button').length;
        if (srs >= disable_srs && !button_moved) $('head').append($('.oops-button'));
        else if (srs < disable_srs && button_moved) $('.undo-button').before($('.oops-button'));
    });
})();