「MeryToys」の版間の差分
Haijinboys (トーク | 投稿記録) |
Haijinboys (トーク | 投稿記録) |
||
| (同じ利用者による、間の3版が非表示) | |||
| 18行目: | 18行目: | ||
== ソースコード (MeryToys.js) == | == ソースコード (MeryToys.js) == | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript" copy> | ||
#language = "quickjs" | |||
#title = "MeryToys" | #title = "MeryToys" | ||
| 49行目: | 50行目: | ||
ident: "UseClassicRuler", | ident: "UseClassicRuler", | ||
default: true, | default: true, | ||
}, | |||
{ | |||
name: "対応する括弧", | |||
section: "General", | |||
ident: "BracketPairs", | |||
default: "", | |||
}, | |||
{ | |||
name: "自動的に囲む括弧/引用符", | |||
section: "General", | |||
ident: "SurroundingPairs", | |||
default: "", | |||
}, | }, | ||
{ | { | ||
| 54行目: | 67行目: | ||
section: "General", | section: "General", | ||
ident: "ImeCandidatePos", | ident: "ImeCandidatePos", | ||
default: false, | |||
}, | |||
{ | |||
name: "IME 入力モード ウィンドウの位置を修正する", | |||
section: "General", | |||
ident: "ImeCandidateFix", | |||
default: false, | default: false, | ||
}, | }, | ||
| 148行目: | 167行目: | ||
ident: "ReplaceStrict", | ident: "ReplaceStrict", | ||
default: true, | default: true, | ||
}, | |||
] | |||
}, | |||
{ | |||
name: "編集", | |||
items: [ | |||
{ | |||
name: "指定した文字を全角カナとして扱う", | |||
section: "Edit", | |||
ident: "KatakanaFullWidthChars", | |||
default: "", | |||
}, | }, | ||
] | ] | ||
| 259行目: | 289行目: | ||
section: "Display", | section: "Display", | ||
ident: "CursorIndicator", | ident: "CursorIndicator", | ||
default: false, | |||
}, | |||
] | |||
}, | |||
{ | |||
name: "マクロ", | |||
items: [ | |||
{ | |||
name: "QuickJS を使用する", | |||
section: "Macros", | |||
ident: "UseQuickJS", | |||
default: false, | default: false, | ||
}, | }, | ||
| 335行目: | 376行目: | ||
default: 8, | default: 8, | ||
description: "px", | description: "px", | ||
}, | |||
{ | |||
name: "タイトル", | |||
section: "Window", | |||
ident: "Title", | |||
default: "", | |||
}, | }, | ||
] | ] | ||
| 455行目: | 502行目: | ||
break; | break; | ||
default: | default: | ||
value = undefined; | |||
break; | break; | ||
} | } | ||
| 480行目: | 528行目: | ||
if (result !== 0) { | if (result !== 0) { | ||
var d = commandMap[result]; | var d = commandMap[result]; | ||
var t = "変更を有効にするには、Mery を再起動する必要があります。"; | |||
switch (typeof d.value) { | switch (typeof d.value) { | ||
case "boolean": | case "boolean": | ||
| 489行目: | 538行目: | ||
var s = prompt(d.name + (d.description ? " (" + d.description + "):" : ":"), d.value); | var s = prompt(d.name + (d.description ? " (" + d.description + "):" : ":"), d.value); | ||
if (s !== null) { | if (s !== null) { | ||
s ? (!isNaN(s) && (editor.WriteSettings(), editor.WriteSettingInteger(d.section, d.ident, Number(s)), editor.ReadSettings())) : editor.DeleteSetting(d.section, d.ident); | s ? (!isNaN(s) && (editor.WriteSettings(), editor.WriteSettingInteger(d.section, d.ident, Number(s)), editor.ReadSettings())) : (editor.DeleteSetting(d.section, d.ident), alert(t)); | ||
} | } | ||
break; | break; | ||
| 495行目: | 544行目: | ||
var s = prompt(d.name + (d.description ? " (" + d.description + "):" : ":"), d.value); | var s = prompt(d.name + (d.description ? " (" + d.description + "):" : ":"), d.value); | ||
if (s !== null) { | if (s !== null) { | ||
s ? (editor.WriteSettings(), editor.WriteSettingString(d.section, d.ident, s), editor.ReadSettings()) : editor.DeleteSetting(d.section, d.ident); | s ? (editor.WriteSettings(), editor.WriteSettingString(d.section, d.ident, s), editor.ReadSettings()) : (editor.DeleteSetting(d.section, d.ident), alert(t)); | ||
} | } | ||
break; | break; | ||
スポンサーリンク