WK Move a Lesson To Review

Selectively move a Lesson to Review

目前為 2023-11-02 提交的版本,檢視 最新版本

// ==UserScript==
// @name         WK Move a Lesson To Review
// @namespace    wanikani
// @version      0.1
// @description  Selectively move a Lesson to Review
// @author       polv
// @match        *://www.wanikani.com/*
// @match        *://preview.wanikani.com/*
// @license      MIT
// @require      https://gf.qytechs.cn/scripts/430565-wanikani-item-info-injector/code/WaniKani%20Item%20Info%20Injector.user.js?version=1241826
// @icon         https://www.google.com/s2/favicons?sz=64&domain=wanikani.com
// @grant        none
// ==/UserScript==

(function() {
  'use strict';

  wkof.include('ItemData');

  let r = {};
  const injector = wkItemInfo.on('itemPage').appendAtTop('Move to Review', (o) => {
    if (o.id !== r.id) {
      r = o;
      wkof.ready('ItemData').then(() => {
        wkof.ItemData.get_items('assignments').then((rs) => {
          r = rs.find((r) => r.id === o.id) || r;
          injector.renew();
        });
      });
    }

    console.log(r.assignments);
    if (!r.assignments) return;
    if (r.assignments.unlocked_at && !r.assignments.available_at) {
      const a = document.createElement('a');
      a.target = '_blank';
      a.href = `https://www.wanikani.com/subjects/lesson/quiz?queue=${o.id}`;
      a.innerText = 'Lesson Quiz'
      return a;
    }
  })
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址