-
Notifications
You must be signed in to change notification settings - Fork 16
/
UnicodeToAscii.jsx
89 lines (76 loc) · 2.08 KB
/
UnicodeToAscii.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Path to IdExtenso entry point.
// ---
#include '../$$.jsxinc'
// UniAsc module.
// ---
#include '../etc/$$.UniAsc.jsxlib'
// Load the framework.
// ---
$$.load();
// =============================================================================
// UnicodeToAscii [220402]
// Basic transliteration module.
// ---
// Demonstrates:
// - Using the `UniAsc` module.
// - Simple modal dialog interface generated by `ScriptUI.builder`.
// =============================================================================
try
{
var init = 'まさゆき たけだ';
ScriptUI.builder
({
properties: { type:'dialog', text:"UniAsc Tester", },
margins: 22,
spacing: 22,
orientation: 'column',
alignChildren: ScriptUI.LT,
Panel$1:
{
properties: { text:'', },
margins: 22,
spacing: 10,
orientation: 'column',
alignChildren: ScriptUI.LT,
StaticText$0: { properties:{text:"Unicode string:"} },
EditText$Input:
{
properties: { text:init, multiline:true },
optimalSize: { width:400, height:60 },
onChanging: function onChanging( w)
{
w = this.window;
w.Info.text = this.text.translit();
},
},
StaticText$1: { properties:{text:"ASCII Translit.:"} },
EditText$Info:
{
properties: { text:init.translit(), multiline:true, readonly:true },
optimalSize: { width:400,height:60 },
},
},
Group$2:
{
margins: 22,
spacing: 20,
orientation: 'row',
alignment: ScriptUI.CT,
Button$Quit:
{
properties: { text:'Quit', name:'cancel' },
}
},
})
.show();
}
catch(e)
{
// Should something go wrong.
// ---
$$.receiveError(e);
}
// =============================================================================
// Unload the framework to cleanup memory.
// ---
$$.unload();