あいもげ用のユーザースクリプト向けの、共通設定モーダル・UI描画ライブラリです。
이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyfork.org/scripts/593408/1916229/%E3%81%82%E3%81%84%E3%82%82%E3%81%92%20%E5%85%B1%E9%80%9AUI%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA.js을(를) 사용하여 포함하는 라이브러리입니다.
あいもげ向けのユーザースクリプトを作成する際に、
ダーク/ライトテーマに連動した設定モーダルや共通処理を簡単に構築できるライブラリです。
ユーザースクリプトのメタデータブロックに本ライブラリの @require を追加してください。
// ==UserScript==
// @name あなたのスクリプト名
// @match https://nijiurachan.net/*
// @require https://update.greasyfork.org/scripts/593408/1916228/aimoge-ui-core.js
// @grant GM_registerMenuCommand
// ==/UserScript==
設定の設計図 (Schema配列) を渡すだけで設定画面が自動生成されます。
const ui = AimogeUI.createSettingsModal({
storageKey: 'my_script_settings',
title: '設定 (マイ拡張機能)',
tabs: [{ id: 'general', label: '全般' }],
items: [
{ tab: 'general', type: 'switch', id: 'enableFeatureA', label: '機能Aを有効にする' }
],
defaultSettings: { enableFeatureA: true },
toolbarButton: { enableKey: 'enableFeatureA', label: 'マイ設定' }
});
// メニューから手動で開く場合
AimogeUI.registerMenuCommand('設定を開く', () => ui.show());