-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
5723 lines (5525 loc) · 376 KB
/
index.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0064)https://www.spitz8823.com/typing/nihonsi/japanhistory04/type.cgi -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Style-Type" content="text/javascript">
<title>日本史タイピング 複製</title>
<link rel="icon" href="https://www.spitz8823.com/typing/favicon.ico">
<style type="text/css">
<!--
BODY {font-size:10pt;
background-color:#996633;
background-image:url(./img/bg.jpg); }
TD.count {font-size:17pt;
text-align:center;
background-color:#ffeeff;
color:#800080;}
TD.countlabel {font-size:13pt;
vertical-align:bottom;}
TD.comment {font-size:12pt;
line-height: 150%}
TD.text1 {background-color:#ffffff;
font-size:15pt;
color:#003300;
font-weight:bold;
font-family:"MS Pゴシック";
line-height:150%;
vertical-align:top;
height:auto;
padding: 5px 20px;
border: solid 2px #cc99cc;}
TD.text2 {background-color:#ffffff;
color:#000099;
font-size:15pt;
font-family:"MS ゴシック";
line-height:130%;
padding: 5px 20px;
border: solid 2px #cc99cc;}
TD.text3 {background-color:#ffffff;
color:#000099;
font-size:17pt;
font-family:"MS ゴシック";
padding: 5px 20px;
line-height:130%;
border: solid 2px #cc99cc;}
FONT.typemarker {color:#000099;
border-top:solid 0px #ffdab6;
border-left:solid 0px #ffdab6;
border-right:solid 0px #ffdab6;
border-bottom:solid 2px #0000ff;}
TD.key1 {text-align:center;
font-weight:bold;
border:4px outset #ffffff;}
TD.key2 {text-align:center;
font-weight:bold;
border:4px outset #ffffff;}
TD.key3 {text-align:center;
font-weight:bold;
border:4px outset #ffffff;}
TD.key4 {text-align:center;
font-weight:bold;
border:4px outset #ffffff;}
A.start {color:#800080;
font-weight:bold;
font-size:11pt;}
A.start:hover {font-weight:bold;
color:#ffffff;}
A.link {font-size:12pt;
color:#000080;}
A.link:hover {font-size:12pt;
color:#9999ff;}
.font10 {font-size:10pt;}
.font12 {font-size:12pt;
line-height: 150%}
.font9 {font-size:9pt;}
SELECT {background-color:#ffccff;}
-->
</style>
<bgsound src="" id="errsound">
<bgsound src="" loop="infinite" id="music">
<script src="./日本史_files/f(7).txt"></script><script src="./日本史_files/f(8).txt"></script><script src="./日本史_files/f(9).txt" id="google_shimpl"></script><script type="text/javascript">
<!--
var text2endcolor = "#cccccc";
var text3endcolor = "#cccccc";
var text3esize = "17pt";
var text2ksize = "15pt";
var text3eweight = "normal";
var text2kweight = "bold";
var text1endcolor = "#bbbbbb";
var text1typeend = 1;
var typemisscolor = "#ff00ff";
var optionflg = 0;
var playtime = 360;
var dakenstop = 200;
var compend = 26;
var comptarray = new Array(26+1);
var example = 3000;
var sort = 0;
var scroll_e = 40;
var scroll_k = 24;
var scl_e = 18;
var scl_k = 10;
var scroll_nn = 24; // ネスケだけの特殊パラメータ
var demerit = 0;
var toppath = "https://www.spitz8823.com/typing/";
var viewflg = 1;
var ji = 0;
var hu = 0;
var ti = 0;
var si = 0;
var tu = 0;
var nn = 1;
var sya = 0;
var tya = 0;
var ja = 0;
var misssound = 0;
var backsound = 0;
var keyboardflg = 1;
var key1col = "#ffff66";
var key2col = "#99ffff";
var key3col = "#33ff33";
var key4col = "#ffccff";
var errpath = "./err.wav";
var musicpath = "";
var guidecolor = "#ff6600";
var loadErrSound=new Image();
loadErrSound.src="./err.wav";
var loadBackSound=new Image();
loadBackSound.src="";
var joinmode="0";
var joinstr="_";
var playmode="0";
var inputmode="0";
//=======================================================================
// 打鍵トレーナー タイピングプログラム(2015/2/20)
//
// Copyright(C) 2002-2015 Muras
// http://www.purasusikou.com/muras/
//
// 本プログラムはフリーソフトとして配布していますが
// 著作権は放棄していません。
// 著作権表示(リンクを含む)は削除しないでください。
//
// このソフトを使用することによるいかなる損害も作者は
// 一切責任を負いません。
//=======================================================================
//----------------- 変数(変更不可)
var stcountNum = 3; // カウントダウン用数字
var text_pos = 0; // 現在の文位置インデックス
var str_posk = 0; // 現在の文字位置インデックス(ひらがな)
var str_posa = 0; // 現在の文字位置インデックス(例文)
var str_pose = 0; // 現在の文字位置インデックス(ローマ字)
var textlength; // 文字列の長さを格納
var timerID1; // カウントダウン用タイマー変数
var timerID2; // 残り時間用タイマー変数
var startflg = false;// 開始したかどうかのフラグ
var agreeflg; // 一致するかどうかのフラグ
var strbuf = ""; // 入力文字格納バッファ
var dakentime = 0; // 打ち切りモードの秒数
var comptime = 0; // 初速モードの秒数
var dakencount = 0; // 打鍵数
var dakencntreg = 0; //登録用の打鍵数保存変数
var misscount = 0; // ミス数
var timecount; // 残り時間(ミリ秒)
var starttime; // 始まりの時間
var comptsub; // 初速計算用
var max = 0; // 打鍵Max
var maxmiss = 0; // 打鍵Max時のミス数
var min = 0; // 打鍵Min
var softflg = 5; // ブラウザ判別 IE:0 NN:1(初期値5でOK)
var search_str = new Array(34); // 入力文字例格納配列
var view_text = new Array(example); // 表示用テキスト(メイン)
var advance_text = new Array(example);// 進行用テキスト(メイン用)
var input_textk = new Array(example); // 表示用テキスト(ひらがな)
var input_texte; // 表示用テキスト一時格納(ローマ字)
var keyguide = "key4";// キーIDの一時バッファ
var keypress = "key1";//
var weakbuf = ""; // ミス文字格納バッファ
var time1;
var time2;
var time3;
var timesub;
var english_pos;
var english_len;
var kana_pos;
//-- setInputStr用
var eword;
var subtext;
var exflg;
var err;
//-- setText用
var stno_e;
var stno_k;
//===================
// データ登録画面へ
//===================
function dataTrans(){
if(startflg){return;}
if(max == 0){alert("登録できるデータがありません");return;}
document.form1.para0.value = max;
document.form1.para1.value = maxmiss;
document.form1.para3.value = dakencntreg;
document.form1.submit();
}
//==================
// 入力文作成
//==================
function sortText(){
var sentencemax = 0;
while(view_base[sentencemax] != ""){sentencemax++;}
var subNum = sentencemax;
var index1 = 0;
var tmp_view_text = "";
var tmp_input_textk = "";
var tmp_advance_text = "";
for(i=0; i<example; i++){
if(sort == 0){ // ランダム
if(joinmode == 0){
// 文字非連結
index1 = Math.floor(Math.random()*subNum);
view_text[i] = view_base[index1];
input_textk[i] = input_base[index1];
if(text1typeend == 1){ advance_text[i] = advance_base[index1]; }
for(k=index1; k<sentencemax-1; k++){
view_base[k] = view_base[k+1];
input_base[k] = input_base[k+1];
if(text1typeend == 1){ advance_base[k] = advance_base[k+1]; }
}
view_base[sentencemax-1] = view_text[i];
input_base[sentencemax-1] = input_textk[i];
if(text1typeend == 1){ advance_base[sentencemax-1] = advance_text[i]; }
if(--subNum <= 0){
subNum = sentencemax;
}
}else{
// 文字連結
index1 = Math.floor(Math.random()*subNum);
tmp_view_text = view_base[index1];
tmp_input_textk = input_base[index1];
if(text1typeend == 1){tmp_advance_text = advance_base[index1];}
if(i == 0){
view_text[0] = view_base[index1];
input_textk[0] = input_base[index1];
if(text1typeend == 1){ advance_text[0] = advance_base[index1]; }
}else{
view_text[0] += joinstr.toString() + view_base[index1];
input_textk[0] += joinstr.toString() + input_base[index1];
if(text1typeend == 1){ advance_text[0] += joinstr.toString() + advance_base[index1]; }
}
for(k=index1; k<sentencemax-1; k++){
view_base[k] = view_base[k+1];
input_base[k] = input_base[k+1];
if(text1typeend == 1){ advance_base[k] = advance_base[k+1]; }
}
view_base[sentencemax-1] = tmp_view_text;
input_base[sentencemax-1] = tmp_input_textk;
if(text1typeend == 1){ advance_base[sentencemax-1] = tmp_advance_text; }
if(--subNum <= 0){
subNum = sentencemax;
}
}
}else{ // 順番
if(joinmode == 0){
// 文字非連結
view_text[i] = view_base[index1];
input_textk[i] = input_base[index1];
if(text1typeend == 1){ advance_text[i] = advance_base[index1]; }
}else{
// 文字連結
if(i == 0){
view_text[0] = view_base[index1];
input_textk[0] = input_base[index1];
if(text1typeend == 1){ advance_text[0] = advance_base[index1]; }
}else{
view_text[0] += joinstr.toString() + view_base[index1];
input_textk[0] += joinstr.toString() + input_base[index1];
if(text1typeend == 1){ advance_text[0] += joinstr.toString() + advance_base[index1]; }
}
}
if(++index1 >= sentencemax){index1 = 0;}
}
}
}
//========================
// キーボード表示全クリヤ
//========================
function keyAllClear(){
keyAllSub("key1", 4);keyAllSub("key2", 3);keyAllSub("key3", 2);keyAllSub("key4", 1);keyAllSub("key5", 1);keyAllSub("key6", 1);
keyAllSub("key7", 1);keyAllSub("key8", 2);keyAllSub("key9", 3);keyAllSub("key10", 4);keyAllSub("key11", 4);keyAllSub("key12", 4);
keyAllSub("key13", 4);keyAllSub("key14", 4);keyAllSub("key15", 3);keyAllSub("key16", 2);keyAllSub("key17", 1);keyAllSub("key18", 1);
keyAllSub("key19", 1);keyAllSub("key20", 1);keyAllSub("key21", 2);keyAllSub("key22", 3);keyAllSub("key23", 4);keyAllSub("key24", 4);
keyAllSub("key25", 4);keyAllSub("key26", 4);keyAllSub("key27", 3);keyAllSub("key28", 2);keyAllSub("key29", 1);keyAllSub("key30", 1);
keyAllSub("key31", 1);keyAllSub("key32", 1);keyAllSub("key33", 2);keyAllSub("key34", 3);keyAllSub("key35", 4);keyAllSub("key36", 4);
keyAllSub("key37", 4);keyAllSub("key38", 4);keyAllSub("key39", 4);keyAllSub("key40", 3);keyAllSub("key41", 2);keyAllSub("key42", 1);
keyAllSub("key43", 1);keyAllSub("key44", 1);keyAllSub("key45", 1);keyAllSub("key46", 2);keyAllSub("key47", 3);keyAllSub("key48", 4);
keyAllSub("key49", 4);keyAllSub("key50", 4);keyAllSub("key51", 4);
}
function keyAllSub(id, colindex){
if(softflg == 0){
if(colindex == 1){document.getElementById(id).style.backgroundColor = key1col;}
else if(colindex == 2){document.getElementById(id).style.backgroundColor = key2col;}
else if(colindex == 3){document.getElementById(id).style.backgroundColor = key3col;}
else if(colindex == 4){document.getElementById(id).style.backgroundColor = key4col;}
}else{
if(colindex == 1){document.getElementById(id).style.backgroundColor = key1col;}
if(colindex == 2){document.getElementById(id).style.backgroundColor = key2col;}
if(colindex == 3){document.getElementById(id).style.backgroundColor = key3col;}
if(colindex == 4){document.getElementById(id).style.backgroundColor = key4col;}
}
}
//========================
// キーボードガイドクリヤ
//========================
function keyApointClear(id){
if(id=="key4" || id=="key5" || id=="key6" || id=="key7" || id=="key17" || id=="key18" || id=="key19" || id=="key20" || id=="key29" ||
id=="key30" || id=="key31" || id=="key32" || id=="key42" || id=="key43" || id=="key44" || id=="key45"){keyAllSub(id, 1);}
if(id=="key3" || id=="key8" || id=="key16" || id=="key21" || id=="key28" || id=="key33" || id=="key41" || id=="key46"){keyAllSub(id, 2);}
if(id=="key2" || id=="key9" || id=="key15" || id=="key22" || id=="key27" || id=="key34" || id=="key40" || id=="key47"){keyAllSub(id, 3);}
if(id=="key1" || id=="key10" || id=="key11" || id=="key12" || id=="key13" || id=="key14" || id=="key23" || id=="key24" || id=="key25" ||
id=="key26" || id=="key35" || id=="key36" || id=="key37" || id=="key39" || id=="key48" || id=="key49" || id=="key51"){keyAllSub(id, 4);}
keyAllSub("key38", 4); // 左右シフトクリヤ
keyAllSub("key50", 4); //
}
function keyPressClear(id){
if(softflg == 0){
document.getElementById(id).style.borderStyle="outset";
}else{
document.getElementById(id).style.borderStyle="outset";
}
}
//=========================
// ソフトキーボードに表示
//=========================
// ローマ字
function setKeyboardRoma(key){
keyApointClear(keyguide); // 前回表示のキーガイドクリヤ
for(i=0; i<138; i++){
if(id[i][0] == key){
keyguide = id[i][1];
if(softflg == 0){document.getElementById(id[i][1]).style.backgroundColor = guidecolor;}
else{document.getElementById(id[i][1]).style.backgroundColor = guidecolor;}
if(id[i][2] != ""){
if(softflg == 0){
document.getElementById("key38").style.backgroundColor = guidecolor;
document.getElementById("key50").style.backgroundColor = guidecolor;
}else{
document.getElementById("key38").style.backgroundColor = guidecolor;
document.getElementById("key50").style.backgroundColor = guidecolor;
}
}
break;
}
}
}
// かな
function setKeyboardKana(key){
keyApointClear(keyguide); // 前回表示のキーガイドクリヤ
for(i=0; i<64; i++){
if(idkana[i][0] == key){
keyguide = idkana[i][1];
if(softflg == 0){document.getElementById(idkana[i][1]).style.backgroundColor = guidecolor;}
else{document.getElementById(idkana[i][1]).style.backgroundColor = guidecolor;}
if(idkana[i][2] != ""){
if(softflg == 0){
document.getElementById("key38").style.backgroundColor = guidecolor;
document.getElementById("key50").style.backgroundColor = guidecolor;
}else{
document.getElementById("key38").style.backgroundColor = guidecolor;
document.getElementById("key50").style.backgroundColor = guidecolor;
}
}
break;
}
}
}
//========================
// 押したキーを表示
//========================
function showKeyPressRoma(key){
keyPressClear(keypress);
for(i=0; i<138; i++){
if(id[i][0] == key){
if(softflg == 0){document.getElementById(id[i][1]).style.borderStyle = "solid";}
else{document.getElementById(id[i][1]).style.borderStyle = "solid";}
keypress = id[i][1];
break;
}
}
}
function showKeyPressKana(key){
keyPressClear(keypress);
for(i=0; i<64; i++){
if(idkana[i][0] == key){
if(softflg == 0){document.getElementById(idkana[i][1]).style.borderStyle = "solid";}
else{document.getElementById(idkana[i][1]).style.borderStyle = "solid";}
keypress = idkana[i][1];
break;
}
}
}
//==========================
// ローマ字入力文作成
//==========================
function setInputStr(){
if(text_pos >= example){alert("問題文不足エラー");return false;}
if(joinmode == 1 && text_pos >= 1){alert("問題文不足エラー");return false;};
eword = "";
exflg;
err = 0;
subtext = input_textk[text_pos]; //現在の入力文取り出し
while(subtext != ""){
if(++err > 2000){alert("ローマ字変換エラー:(" + subtext + ")\n\nタイピング文を確認してください");return false;}
textlength = subtext.length;
exflg = false;
if(subtext.charAt(0) == "ん" || subtext.charAt(0) == "ン"){ // 一文字目が「ん」
//「ん」「っ」付き4文字
if(!exflg && textlength >= 4){
for(k=0; k<234; k++){
if(subtext.substr(0,4) == stntex[k][0]){
eword += stntex[k][1];
subtext = subtext.substr(4, textlength-4);
exflg = true;
break;
}
}
}
//「ん」「っ」付き3文字
if(!exflg && textlength >= 3){
for(k=0; k<144; k++){
if(subtext.substr(0,3) == stnt[k][0]){
eword += stnt[k][1];
subtext = subtext.substr(3, textlength-3);
exflg = true;
break;
}
}
}
//「ん」付き3文字
if(!exflg && textlength >= 3){
for(k=0; k<232; k++){
if(subtext.substr(0,3) == stnex[k][0]){
eword += stnex[k][1];
subtext = subtext.substr(3, textlength-3);
exflg = true;
break;
}
}
}
//「ん」付き2文字
if(!exflg && textlength >= 2){
for(k=0; k<136; k++){
if(subtext.substr(0,2) == stn[k][0]){
eword += stn[k][1];
subtext = subtext.substr(2, textlength-2);
exflg = true;
break;
}
}
}
//ん
if(!exflg){
eword += "nn";
subtext = subtext.substr(1, textlength-1);
}
}else if(subtext.charAt(0) == "っ" || subtext.charAt(0) == "ッ"){ // 一文字目が「っ」
//「っ」付き3文字
if(!exflg && textlength >= 3){
for(k=0; k<234; k++){
if(subtext.substr(0,3) == sttex[k][0]){
eword += sttex[k][1];
subtext = subtext.substr(3, textlength-3);
exflg = true;
break;
}
}
}
//「っ」付き2文字
if(!exflg && textlength >= 2){
for(k=0; k<144; k++){
if(subtext.substr(0,2) == stt[k][0]){
eword += stt[k][1];
subtext = subtext.substr(2, textlength-2);
exflg = true;
break;
}
}
}
//つ
if(!exflg){
eword += "ltu";
subtext = subtext.substr(1, textlength-1);
}
}else{ // その他
//2文字
if(!exflg && textlength >= 2){
for(k=0; k<stex.length; k++){
if(subtext.substr(0,2) == stex[k][0]){
eword += stex[k][1];
subtext = subtext.substr(2, textlength-2);
exflg = true;
break;
}
}
}
//1文字
if(!exflg){
for(k=0; k<st.length; k++){
if(subtext.substr(0,1) == st[k][0]){
eword += st[k][1];
//if(viewflg == 1 || viewflg == 2){
// 全角半角で形が変わる文字をかな表記が含まれる表示分のみ全角に戻す
/*
if(st[k][0] == "ー"){eword += "ー";}
else if(st[k][0] == "^"){eword += "^";}else if(st[k][0] == "¥"){eword += "¥";}
else if(st[k][0] == "!"){eword += "!";}else if(st[k][0] == "”"){eword += "”";}
else if(st[k][0] == "#"){eword += "#";}else if(st[k][0] == "$"){eword += "$";}
else if(st[k][0] == "%"){eword += "%";}else if(st[k][0] == "&"){eword += "&";}
else if(st[k][0] == "’"){eword += "’";}else if(st[k][0] == "("){eword += "(";}
else if(st[k][0] == ")"){eword += ")";}else if(st[k][0] == "="){eword += "=";}
else if(st[k][0] == "~"){eword += "~";}else if(st[k][0] == "|"){eword += "|";}
else if(st[k][0] == "‘"){eword += "‘";}else if(st[k][0] == "@"){eword += "@";}
else if(st[k][0] == "{"){eword += "{";}else if(st[k][0] == "「"){eword += "「";}
else if(st[k][0] == ";"){eword += ";";}else if(st[k][0] == "+"){eword += "+";}
else if(st[k][0] == ":"){eword += ":";}else if(st[k][0] == "*"){eword += "*";}
else if(st[k][0] == "」"){eword += "」";}else if(st[k][0] == "}"){eword += "}";}
else if(st[k][0] == "、"){eword += "、";}else if(st[k][0] == "<"){eword += "<";}
else if(st[k][0] == "。"){eword += "。";}else if(st[k][0] == ">"){eword += ">";}
else if(st[k][0] == "・"){eword += "・";}else if(st[k][0] == "?"){eword += "?";}
else if(st[k][0] == "_"){eword += "_";}else if(st[k][0] == " "){eword += " ";}
else if(st[k][0] == "1"){eword += "1";}else if(st[k][0] == "2"){eword += "2";}
else if(st[k][0] == "3"){eword += "3";}else if(st[k][0] == "4"){eword += "4";}
else if(st[k][0] == "5"){eword += "5";}else if(st[k][0] == "6"){eword += "6";}
else if(st[k][0] == "7"){eword += "7";}else if(st[k][0] == "8"){eword += "8";}
else if(st[k][0] == "9"){eword += "9";}else if(st[k][0] == "0"){eword += "0";}else{eword += st[k][1];}
*/
//}else{
// eword += st[k][1];
//}
subtext = subtext.substr(1, textlength-1);
exflg = true;
break;
}
}
}
}
}
input_texte = eword;
return true;
}
//=========================
// 現在の状態を表示
//=========================
function setText(flg){
// 基本文表示
if(softflg == 0){ //IE
if(text1typeend == 1){
document.getElementById("text1").innerHTML = '<FONT color="' + text1endcolor + '">' +
view_text[text_pos].substr(0, str_posa) + '</FONT>' + view_text[text_pos].substr(str_posa);
}else{
document.getElementById("text1").innerHTML = view_text[text_pos];
}
}else{
if(text1typeend == 1){
document.getElementById("text1").innerHTML = '<FONT color="' + text1endcolor + '">' +
view_text[text_pos].substr(0, str_posa) + '</FONT>' + view_text[text_pos].substr(str_posa);
}else{
document.getElementById("text1").innerHTML = view_text[text_pos];
}
}
// 入力文表示
// ローマ字のみ
if(viewflg == 0 && inputmode == 0){
textlength = input_texte.length;
//スクロール調整
if(str_pose > scl_e && textlength > scroll_e){
stno_e = str_pose - scl_e;
}else{
stno_e = 0;
}
if(softflg == 0){ //IE
if(input_texte.substr(stno_e, 1) == " " || input_texte.substr(stno_e, 1) == " "){ // 表示文字の先頭が半角スペースの場合に消えてしまう不具合対応
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + "_" + halfReplace(input_texte.substr(stno_e+1, str_pose-stno_e-1).toUpperCase()) +
'</FONT><FONT class="typemarker" id="typemark">' + halfReplace(input_texte.substr(str_pose, 1).toUpperCase()) +
'</FONT>' + halfReplace(input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase());
}else{
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + halfReplace(input_texte.substr(stno_e, str_pose-stno_e).toUpperCase().toUpperCase()) +
'</FONT><FONT class="typemarker" id="typemark">' + halfReplace(input_texte.substr(str_pose, 1).toUpperCase().toUpperCase()) +
'</FONT>' + halfReplace(input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase().toUpperCase());
}
if(!flg){document.getElementById("typemark").style.color=typemisscolor;}
}else{
if(input_texte.substr(stno_e, 1) == " " || input_texte.substr(stno_e, 1) == " "){ // 表示文字の先頭が半角スペースの場合に消えてしまう不具合対応
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + "_" + input_texte.substr(stno_e+1, str_pose-stno_e-1).toUpperCase() +
'</FONT><FONT class="typemarker" id="typemark">' + input_texte.substr(str_pose, 1).toUpperCase() +
'</FONT>' + input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase();
}else{
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + input_texte.substr(stno_e, str_pose-stno_e).toUpperCase().toUpperCase() +
'</FONT><FONT class="typemarker" id="typemark">' + input_texte.substr(str_pose, 1).toUpperCase().toUpperCase() +
'</FONT>' + input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase().toUpperCase();
}
if(!flg){document.getElementById("typemark").style.color=typemisscolor;}
}
// かな+ローマ字
}else{
if(inputmode == 0){
//ローマ
textlength = input_texte.length;
//スクロール調整
if(str_pose > scl_e && textlength > scroll_e){
stno_e = str_pose - scl_e;
}else{
stno_e = 0;
}
if(softflg == 0){ //IE
if(input_texte.substr(stno_e, 1) == " " || input_texte.substr(stno_e, 1) == " "){ // 表示文字の先頭が半角スペースの場合に消えてしまう不具合対応
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + "_" + halfReplace(input_texte.substr(stno_e+1, str_pose-stno_e-1).toUpperCase()) +
'</FONT><FONT class="typemarker" id="typemark">' + halfReplace(input_texte.substr(str_pose, 1).toUpperCase()) +
'</FONT>' + halfReplace(input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase());
}else{
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + halfReplace(input_texte.substr(stno_e, str_pose-stno_e).toUpperCase().toUpperCase()) +
'</FONT><FONT class="typemarker" id="typemark">' + halfReplace(input_texte.substr(str_pose, 1).toUpperCase().toUpperCase()) +
'</FONT>' + halfReplace(input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase().toUpperCase());
}
if(!flg){document.getElementById("typemark").style.color=typemisscolor;}
}else{
if(input_texte.substr(stno_e, 1) == " " || input_texte.substr(stno_e, 1) == " "){ // 表示文字の先頭が半角スペースの場合に消えてしまう不具合対応
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + "_" + input_texte.substr(stno_e+1, str_pose-stno_e-1).toUpperCase() +
'</FONT><FONT class="typemarker" id="typemark">' + input_texte.substr(str_pose, 1).toUpperCase() +
'</FONT>' + input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase();
}else{
document.getElementById("text3").innerHTML = '<FONT color="' + text3endcolor + '">' + input_texte.substr(stno_e, str_pose-stno_e).toUpperCase().toUpperCase() +
'</FONT><FONT class="typemarker" id="typemark">' + input_texte.substr(str_pose, 1).toUpperCase().toUpperCase() +
'</FONT>' + input_texte.substr(str_pose+1, scroll_e-str_pose+stno_e).toUpperCase().toUpperCase();
}
if(!flg){document.getElementById("typemark").style.color=typemisscolor;}
}
}
//かな
textlength = input_textk[text_pos].length;
if(str_posk > scl_k && textlength > scroll_k){
stno_k = str_posk - scl_k;
}else{
stno_k = 0;
}
if(softflg == 0){ //IE
document.getElementById("text2").innerHTML = '<FONT color="' + text2endcolor + '">' + input_textk[text_pos].substr(stno_k, str_posk-stno_k) +
'</FONT><FONT class="typemarker" id="ktypemark">' + input_textk[text_pos].substr(str_posk, 1) +
'</FONT>' + input_textk[text_pos].substr(str_posk+1, scroll_k-str_posk+stno_k);
if(!flg){document.getElementById("ktypemark").style.color=typemisscolor;}
}else{
document.getElementById("text2").innerHTML = '<FONT color="' + text2endcolor + '">' + input_textk[text_pos].substr(stno_k, str_posk-stno_k) +
'</FONT><FONT class="typemarker" id="ktypemark">' + input_textk[text_pos].substr(str_posk, 1) +
'</FONT>' + input_textk[text_pos].substr(str_posk+1, scroll_k-str_posk+stno_k);
if(!flg){document.getElementById("ktypemark").style.color=typemisscolor;}
}
}
//ソフトキーボード表示
if(keyboardflg == 1){
if(inputmode == 0){
setKeyboardRoma(input_texte.charAt(str_pose));
}else{
// かなは入力文字ベースで指定
setKeyboardKana(search_str[0]);
}
}
}
function halfReplace(str){
str = str.split("ー").join("-");
str = str.split("^").join("^");
str = str.split("¥").join("\\");
str = str.split("!").join("!");
str = str.split("”").join("\"");
str = str.split("#").join("#");
str = str.split("$").join("$");
str = str.split("%").join("%");
str = str.split("&").join("&");
str = str.split("’").join("'");
str = str.split("(").join("(");
str = str.split(")").join(")");
str = str.split("=").join("=");
str = str.split("~").join("~");
str = str.split("|").join("|");
str = str.split("‘").join("`");
str = str.split("@").join("@");
str = str.split("{").join("{");
str = str.split("「").join("[");
str = str.split(";").join(";");
str = str.split("+").join("+");
str = str.split(":").join(":");
str = str.split("*").join("*");
str = str.split("」").join("]");
str = str.split("}").join("}");
str = str.split("、").join(",");
str = str.split("<").join("<");
str = str.split("。").join(".");
str = str.split(">").join(">");
str = str.split("・").join("/");
str = str.split("?").join("?");
str = str.split("_").join("_");
str = str.split(" ").join(" ");
str = str.split("1").join("1");
str = str.split("2").join("2");
str = str.split("3").join("3");
str = str.split("4").join("4");
str = str.split("5").join("5");
str = str.split("6").join("6");
str = str.split("7").join("7");
str = str.split("8").join("8");
str = str.split("9").join("9");
str = str.split("0").join("0");
return str;
}
//===================================
// 入力文字例配列への格納(ローマ字)
//===================================
function setSearchStrRoma(){
for(i=0; i<34; i++){search_str[i] = "";} //入力文字例配列クリア
var restword = input_textk[text_pos].length - str_posk;
exflg = false;
if(input_textk[text_pos].charAt(str_posk) == "ん" || input_textk[text_pos].charAt(str_posk) == "ン"){ // 一文字目が「ん」
//「ん」「っ」付き4文字 12候補 0-11:4文字 12-21:3文字 22-29:2文字 30-33:1文字
if(!exflg && restword >= 4){
subtext = input_textk[text_pos].substr(str_posk,4);
for(i=0; i<234; i++){
if(subtext == stntex[i][0]){
for(k=0; k<12; k++){
search_str[k] = stntex[i][k+1];
}
exflg = true;
break;
}
}
}
//「ん」「っ」付き3文字 10候補
if(!exflg && restword >= 3){
subtext = input_textk[text_pos].substr(str_posk,3);
for(i=0; i<144; i++){
if(subtext == stnt[i][0]){
for(k=12; k<22; k++){
search_str[k] = stnt[i][k-11];
}
exflg = true;
break;
}
}
}
//「ん」付き3文字 6候補
if(!exflg && restword >= 3){
subtext = input_textk[text_pos].substr(str_posk,3);
for(i=0; i<232; i++){
if(subtext == stnex[i][0]){
for(k=12; k<18; k++){
search_str[k] = stnex[i][k-11];
}
exflg = true;
break;
}
}
}
//「ん」付き2文字 8候補
if(!exflg && restword >= 2){
subtext = input_textk[text_pos].substr(str_posk,2);
for(i=0; i<136; i++){
if(subtext == stn[i][0]){
for(k=22; k<30; k++){
search_str[k] = stn[i][k-21];
}
exflg = true;
break;
}
}
}
//ん
if(!exflg){
search_str[30] = "nn";
search_str[31] = "xn";
}
}else if(input_textk[text_pos].charAt(str_posk) == "っ" || input_textk[text_pos].charAt(str_posk) == "ッ"){ // 一文字目が「っ」
//「っ」付き3文字 6候補 0-11:4文字 12-21:3文字 22-29:2文字 30-33:1文字
if(!exflg && restword >= 3){
subtext = input_textk[text_pos].substr(str_posk,3);
for(i=0; i<234; i++){
if(subtext == sttex[i][0]){
for(k=12; k<18; k++){
search_str[k] = sttex[i][k-11];
}
exflg = true;
break;
}
}
}
//「っ」付き2文字 5候補
if(!exflg && restword >= 2){
subtext = input_textk[text_pos].substr(str_posk,2);
for(i=0; i<144; i++){
if(subtext == stt[i][0]){
for(k=22; k<27; k++){
search_str[k] = stt[i][k-21];
}
exflg = true;
break;
}
}
}
//つ
if(!exflg){
search_str[30] = "ltu";
search_str[31] = "xtu";
search_str[32] = "ltsu";
}
}else{ // その他
//2文字 5候補 0-11:4文字 12-21:3文字 22-29:2文字 30-33:1文字
if(!exflg && restword >= 2){
subtext = input_textk[text_pos].substr(str_posk,2);
for(i=0; i<stex.length; i++){
if(subtext == stex[i][0]){
for(k=22; k<27; k++){
search_str[k] = stex[i][k-21];
}
exflg = true;
break;
}
}
}
// 1文字 4候補
if(!exflg){
subtext = input_textk[text_pos].substr(str_posk,1);
for(i=0; i<st.length; i++){
if(subtext == st[i][0]){
for(k=30; k<34; k++){
search_str[k] = st[i][k-29];
}
}
}
}
}
kana_pos = 0; // 次入力候補内のポジションインデックス
english_pos = str_pose;// 検索配列のローマ表示テキストにおける先頭文字位置(入力時の文字が表示している例と違う場合の修正用)
for(i=0; i<34; i++){ // 検索文字配列
if(search_str[i] != ""){
english_len = search_str[i].length; // 現在1番手候補の文字長さ保存
break;
}
}
}
//===================================
// 入力文字例配列への格納(かな)
//===================================
function setSearchStrKana(){
for(i=0; i<34; i++){search_str[i] = "";} //入力文字例配列クリア
for(i=0; i<200; i++){
if(input_textk[text_pos].charAt(str_posk) == stkana[i][0]){
search_str[0] = stkana[i][1];
search_str[1] = stkana[i][2];
break;
}
}
if(search_str[0] == ""){alert("例文エラー:" + input_textk[text_pos].charAt(str_posk));timeStop();}
}
//=========================
// カウントダウン
//=========================
function countDown(){
if(--stcountNum < 0){
if(backsound == 1 && softflg == 0){music.src = musicpath;}
if(inputmode == 0){
setSearchStrRoma();
}else{
setSearchStrKana();
}
startflg = true; // スタートON
time1 = new Date();
starttime = time1.getTime();
timeStart(); // 時間更新
setText(true); // 問題文+入力文の表示更新
showCount(); // 打鍵+ミス数の表示
}else{
if(softflg == 0){
document.getElementById("daken").innerHTML = stcountNum + 1;
document.getElementById("miss").innerHTML = stcountNum + 1;
document.getElementById("time").innerHTML = stcountNum + 1;
}else{
document.getElementById("daken").innerHTML = stcountNum + 1;
document.getElementById("miss").innerHTML = stcountNum + 1;
document.getElementById("time").innerHTML = stcountNum + 1;
}
timerID1 = setTimeout("countDown()", 1000);
}
}
//===================
// 各種設定処理
//===================
function setJI(no){
ji = no;
setAllOption();
if(ji != 0){
//ZI
st[64][1]="zi";st[64][2]="ji";
st[145][1]="zi";st[145][2]="ji";
stt[53][1]="zzi";stt[53][2]="jji";stt[53][3]="ltuzi";stt[53][4]="ltuji";
stt[125][1]="zzi";stt[125][2]="jji";stt[125][3]="ltuzi";stt[125][4]="ltuji";
stn[49][1]="nnzi";stn[49][2]="nnji";stn[49][5]="nzi";stn[49][6]="nji";
stn[117][1]="nnzi";stn[117][2]="nnji";stn[117][5]="nzi";stn[117][6]="nji";
stnt[53][1]="nnzzi";stnt[53][2]="nnjji";stnt[53][3]="nnltuzi";stnt[53][4]="nnltuji";stnt[53][5]="nzzi";stnt[53][6]="njji";stnt[53][7]="nltuzi";stnt[53][8]="nltuji";
stnt[125][1]="nnzzi";stnt[125][2]="nnjji";stnt[125][3]="nnltuzi";stnt[125][4]="nnltuji";stnt[125][5]="nzzi";stnt[125][6]="njji";stnt[125][7]="nltuzi";stnt[125][8]="nltuji";
if(nn == 1){
stn[49][1]="nzi";stn[49][2]="nji";stn[49][5]="nnzi";stn[49][6]="nnji";
stn[117][1]="nzi";stn[117][2]="nji";stn[117][5]="nnzi";stn[117][6]="nnji";
stnt[53][1]="nzzi";stnt[53][2]="njji";stnt[53][3]="nltuzi";stnt[53][4]="nltuji";stnt[53][5]="nnzzi";stnt[53][6]="nnjji";stnt[53][7]="nnltuzi";stnt[53][8]="nnltuji";
stnt[125][1]="nzzi";stnt[125][2]="njji";stnt[125][3]="nltuzi";stnt[125][4]="nltuji";stnt[125][5]="nnzzi";stnt[125][6]="nnjji";stnt[125][7]="nnltuzi";stnt[125][8]="nnltuji";
}
}else{
//JI
st[64][1]="ji";st[64][2]="zi";
st[145][1]="ji";st[145][2]="zi";
stt[53][1]="jji";stt[53][2]="zzi";stt[53][3]="ltuji";stt[53][4]="ltuzi";
stt[125][1]="jji";stt[125][2]="zzi";stt[125][3]="ltuji";stt[125][4]="ltuzi";
stn[49][1]="nnji";stn[49][2]="nnzi";stn[49][5]="nji";stn[49][6]="nzi";
stn[117][1]="nnji";stn[117][2]="nnzi";stn[117][5]="nji";stn[117][6]="nzi";
stnt[53][1]="nnjji";stnt[53][2]="nnzzi";stnt[53][3]="nnltuji";stnt[53][4]="nnltuzi";stnt[53][5]="njji";stnt[53][6]="nzzi";stnt[53][7]="nltuji";stnt[53][8]="nltuzi";
stnt[125][1]="nnjji";stnt[125][2]="nnzzi";stnt[125][3]="nnltuji";stnt[125][4]="nnltuzi";stnt[125][5]="njji";stnt[125][6]="nzzi";stnt[125][7]="nltuji";stnt[125][8]="nltuzi";
if(nn == 1){
stn[49][1]="nji";stn[49][2]="nzi";stn[49][5]="nnji";stn[49][6]="nnzi";
stn[117][1]="nji";stn[117][2]="nzi";stn[117][5]="nnji";stn[117][6]="nnzi";
stnt[53][1]="njji";stnt[53][2]="nzzi";stnt[53][3]="nltuji";stnt[53][4]="nltuzi";stnt[53][5]="nnjji";stnt[53][6]="nnzzi";stnt[53][7]="nnltuji";stnt[53][8]="nnltuzi";
stnt[125][1]="njji";stnt[125][2]="nzzi";stnt[125][3]="nltuji";stnt[125][4]="nltuzi";stnt[125][5]="nnjji";stnt[125][6]="nnzzi";stnt[125][7]="nnltuji";stnt[125][8]="nnltuzi";
}
}
}
function setHU(no){
hu = no;
setAllOption();
if(hu != 0){
//FU
st[27][1]="fu";st[27][2]="hu";
st[110][1]="fu";st[110][2]="hu";
stt[17][1]="ffu";stt[17][2]="hhu";stt[17][3]="ltufu";stt[17][4]="ltuhu";
stt[89][1]="ffu";stt[89][2]="hhu";stt[89][3]="ltufu";stt[89][4]="ltuhu";
stn[17][1]="nnfu";stn[17][2]="nnhu";stn[17][5]="nfu";stn[17][6]="nhu";
stn[85][1]="nnfu";stn[85][2]="nnhu";stn[85][5]="nfu";stn[85][6]="nhu";
stnt[17][1]="nnffu";stnt[17][2]="nnhhu";stnt[17][3]="nnltufu";stnt[17][4]="nnltuhu";stnt[17][5]="nffu";stnt[17][6]="nhhu";stnt[17][7]="nltufu";stnt[17][8]="nltuhu";
stnt[89][1]="nnffu";stnt[89][2]="nnhhu";stnt[89][3]="nnltufu";stnt[17][4]="nnltuhu";stnt[89][5]="nffu";stnt[89][6]="nhhu";stnt[89][7]="nltufu";stnt[89][8]="nltuhu";
if(nn == 1){
stn[17][1]="nfu";stn[17][2]="nhu";stn[17][5]="nnfu";stn[17][6]="nnhu";
stn[85][1]="nfu";stn[85][2]="nhu";stn[85][5]="nnfu";stn[85][6]="nnhu";
stnt[17][1]="nffu";stnt[17][2]="nhhu";stnt[17][3]="nltufu";stnt[17][4]="nltuhu";stnt[17][5]="nnffu";stnt[17][6]="nnhhu";stnt[17][7]="nnltufu";stnt[17][8]="nnltuhu";
stnt[89][1]="nffu";stnt[89][2]="nhhu";stnt[89][3]="nltufu";stnt[17][4]="nltuhu";stnt[89][5]="nnffu";stnt[89][6]="nnhhu";stnt[89][7]="nnltufu";stnt[89][8]="nnltuhu";
}
}else{
//HU
st[27][1]="hu";st[27][2]="fu";
st[110][1]="hu";st[110][2]="fu";
stt[17][1]="hhu";stt[17][2]="ffu";stt[17][3]="ltuhu";stt[17][4]="ltufu";
stt[89][1]="hhu";stt[89][2]="ffu";stt[89][3]="ltuhu";stt[89][4]="ltufu";
stn[17][1]="nnhu";stn[17][2]="nnfu";stn[17][5]="nhu";stn[17][6]="nfu";
stn[85][1]="nnhu";stn[85][2]="nnfu";stn[85][5]="nhu";stn[85][6]="nfu";