-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.html
executable file
·174 lines (137 loc) · 4.25 KB
/
test.html
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<title>JS IM Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="style/style.css">
<style>
textarea{
width:300px;
height:100px;
}
</style>
</head>
<body>
<h1>JS IM Test Page</h1>
© 2005-2008 Colspan All Rights Reserved.
<script language='JavaScript' src='scripts/prototype.js'></script>
<script language='JavaScript' src='scripts/keycode.js'></script>
<script language='JavaScript' src='scripts/caret.js'></script>
<script language='JavaScript' src='scripts/JS_IM.js'></script>
<script language='JavaScript' src='scripts/johab.js'></script>
<script language='JavaScript' src='scripts/JS_IM_hangul.js'></script>
<h2>한국어</h2>
johab.js by chiyu
<form name="hangulIM">
<textarea id="hangul"></textarea><br>
</form>
<script type="text/javascript">
hangulIM_Obj = new JS_IM( $( 'hangul' ), JS_IM_hangul );
</script>
<h2>日本語かな漢字変換</h2>
roma.js by http://la.ma.la/
<form name="japanese">
<textarea id="japaneseime"></textarea>
</form>
<script language='JavaScript' src='scripts/roma.js'></script>
<script language='JavaScript' src='scripts/JS_IM_vje.js'></script>
<script type="text/javascript">
hangulIM_Obj = new JS_IM( $( 'japaneseime' ), JS_IM_vje );
</script>
<h2>ひらがな</h2>
roma.js by http://la.ma.la/
<form name="romatest">
<textarea id="roma"></textarea>
<input id="romadebug" type="text">
</form>
<script>
var JS_IM_roma = {
methodName : "roma",
version : "20080110",
language : "Japanese",
author : "Colspan",
init : function(){
this.romajiBuffer = "";
},
accept : function(){
var outputStr = this.inlineBuffer;
this.romajiBuffer = "";
this.inlineBuffer = roma2["hiragana"](this.romajiBuffer).toString();
document.getElementById('romadebug').value = this.romajiBuffer;
return outputStr;
},
process : function( keyStatus ){
var outputStr = "";
this.romajiBuffer += keyStatus.inputChar.toLowerCase();
this.inlineBuffer = roma2["hiragana"](this.romajiBuffer).toString();
document.getElementById('romadebug').value = this.romajiBuffer;
return outputStr;
},
backspace : function(){
this.romajiBuffer = this.romajiBuffer.substring(0,this.romajiBuffer.length-1);
this.inlineBuffer = roma2["hiragana"](this.romajiBuffer).toString();
document.getElementById('romadebug').value = this.romajiBuffer;
}
}
new JS_IM( $( 'roma' ), JS_IM_roma );
</script>
<div id="debubu"></div>
<h2>アイヌ</h2>
<form name="aynu">
<textarea id="JSIM_aynu"></textarea>
</form>
<script language='JavaScript' src='scripts/JS_IM_aynu.js'></script>
<script>
var JS_IM_aynu = {
methodName : "aynu",
version : "20080123",
language : "Aynu",
author : "Colspan",
init : function(){
globalReplacethis = new RegExp("","g");
this.isUnicode = true;
this.isAscii = false;
},
accept : function(){
var outputStr = this.inlineBuffer;
this.romajiBuffer = "";
this.inlineBuffer = roma2["hiragana"](this.romajiBuffer).toString();
return outputStr;
},
process : function( keyStatus ){
var outputStr = "";
mykey = keyStatus.inputChar.toLowerCase();
mytext = this.inlineBuffer;
if(globalKakuteiStr + globalKouhoStr != mytext) {
globalKakuteiStr = mytext;
globalKouhoStr = globalKouhoKeys = "";
}
mykey = keyTranslate(mykey);
globalUnicodeStrPlusKey(mykey);
this.inlineBuffer = globalKakuteiStr + globalKouhoStr;
/* if( this.inlineBuffer.length == 2 ){ //文字が確定した
outputStr = this.inlineBuffer.substring(0, 1);
this.inlineBuffer = this.inlineBuffer.substring(1,2);
}*/
return outputStr;
},
backspace : function(){
if(globalKouhoKeys.length > 0) {
globalKouhoKeys = globalKouhoKeys.substring(0, globalKouhoKeys.length - 1);
globalKouhoStr = fromAsciiToUnicode(globalKouhoKeys);
} else {
globalKakuteiStr = globalKakuteiStr.substring(0, globalKakuteiStr.length - 1);
}
}
}
new JS_IM( $( 'JSIM_aynu' ), JS_IM_aynu );
</script>
<h2>強制的に大文字</h2>
<form name="hangul">
<textarea id="JSIMtest"></textarea>
</form>
<script>
new JS_IM( $( 'JSIMtest' ), JS_IM_toUpperCase );
</script>
</body>
</html>