您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/22751/144752/WaniKani%20Settings.js
- // ==UserScript==
- // @name WaniKani Settings
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @grant none
- // ==/UserScript==
- function test(){
- alert('test');
- }
- function openSettingsDialog(data){
- if (typeof jQuery.ui == 'undefined') {
- jQuery.getScript("https://code.jquery.com/ui/1.12.0/jquery-ui.js", function(data, status, jqxhr) {
- openSettingsDialog2(data);
- });
- } else {
- openSettingsDialog2(data);
- }
- }
- function openSettingsDialog2(data){
- var divSettings = "<div id='divSettings'><table>";
- $('#txtApiKey').val(apiKey);
- $('#ddlDisplayMode').val(srsGridDisplay);
- $.each(data,function(item,value){
- divSettings = divSettings + '<tr><td><span>value.Name:</span></td>';
- switch(value.Type) {
- case "textbox":
- divSettings = divSettings + '<td><input type="textbox" id="txt' + value.Name + '"></input></td></tr>';
- break;
- case "checkbox":
- divSettings = divSettings + '<td>coming soon</td>';
- break;
- case "select":
- divSettings = divSettings + '<td><select id="ddl' + value.Name + '">';
- $.each(value.Options,function(item2,value2){
- divSettings = divSettings + '<option value="' + value2.Value + '">' + value2.Text + '</option>';
- }
- divSettings = divSettings + '</td></tr>';
- break;
- default:
- default code block
- }
- }
- divSettings = divSettings + '</table>';
- $('section.progression').after(divSettings);
- $.each(data,function(item,value){
- switch(value.Type) {
- case "textbox":
- $('#txt' + value.Name).val(getSetting(value.Name));
- break;
- case "checkbox":
- break;
- case "select":
- $('#ddl' + value.Name).val(getSetting(value.Name));
- break;
- default:
- default code block
- }
- }
- $('#divSettings').dialog({
- autoOpen: false,
- height: 300,
- width: 400,
- modal: true,
- buttons: {
- "Save": function () {
- //localStorage.setItem('apiKeyForSRS', $('#txtApiKey').val());
- //localStorage.setItem('srsGridDisplay', $('#ddlDisplayMode option:selected').val());
- $(this).dialog("close");
- },
- Cancel: function () {
- $(this).dialog("close");
- }
- }
- }).dialog('open');
- }
- function getSetting(setting){
- return localStorage.getItem(setting);
- }