fe82bc33d739dcb51576c951c91cd4679e6b934c.svn-base 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // ================================================================
  2. // CHEditor 5
  3. // ----------------------------------------------------------------
  4. // Homepage: http://www.chcode.com
  5. // Copyright (c) 1997-2014 CHSOFT
  6. // ================================================================
  7. var c = null;
  8. var curView = null;
  9. var S1 = '" ( ) [ ] { } ‘ ’ “ ” 〔 〕 〈 〉 《 》 「 」 『 』 【 】 § ※ ☆ ★ ○ ● ■ △ ▲ ▽ ▼ → 〓 ◁ ◀ ▷ ▶ ♤ ♣ ⊙ ◈ ▣ ◐ ◑ ▧ ▦ ▩ ♨ ☏ ☎ ‡ ㉿ ↕ ↗ ↙ ↖ ↘ ㈜ № ㏇ ™ ㏂ + - < = > ± × ÷ ≠ ≤ ≥ ∞ ∴ ♂ ♀ ∠ ⊥ ⌒ ∂ ∇ ≡ ≒ ≪ ≫ √ ∽ ∝ ∵ ∫ ∬ ∈ ∋ ⊆ ⊇ ⊂ ⊃ ∮ ∪ ∩ ∑ ∏ ∧ ∨ ¬ ⇒ ⇔ ∀ ∃';
  10. var S2 = '─ │ ┌ ┐ ┘ └ ├ ┬ ┤ ┴ ┼ ━ ┃ ┏ ┓ ┛ ┗ ┣ ┳ ┫ ┻ ╋ ┠ ┯ ┨ ┷ ┿ ┝ ┰ ┥ ┸ ╂ ┒ ┑ ┚ ┙ ┖ ┕ ┎ ┍ ┞ ┟ ┡ ┢ ┦ ┧ ┩ ┪ ┭ ┮ ┱ ┲ ┵ ┶ ┹ ┺ ┽ ┾ ╀ ╁ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊';
  11. var S3 = '½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ¹ ² ³ ⁴ ⁿ ₁ ₂ ₃ ₄ 0 1 2 3 4 5 6 7 8 9 ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ $ % ₩ ° ′ ″ ℃ Å ¢ £ ¥ ¤ ℉ ‰ ㎕ ㎖ ㎗ ℓ ㎘ ㏄ ㎣ ㎤ ㎥ ㎦ ㎙ ㎚ ㎛ ㎜ ㎝ ㎞ ㎟ ㎠ ㎡ ㎢ ㏊ ㎍ ㎎ ㎏ ㏏ ㎈ ㎉ ㏈ ㎧ ㎨ ㎰ ㎱ ㎲ ㎳ ㎴ ㎵ ㎶ ㎷ ㎸ ㎹ ㎀ ㎁ ㎂ ㎃ ㎄ ㎺ ㎻ ㎼ ㎽ ㎾ ㎿ ㎐ ㎑ ㎒ ㎓ ㎔ Ω ㏀ ㏁ ㎊ ㎋ ㎌ ㏖ ㏅ ㎭ ㎮ ㎯ ㏛ ㎩ ㎪ ㎫ ㎬ ㏝ ㏐ ㏓ ㏉ ㏜ ㏆';
  12. var S4 = 'ㅥ ㅦ ㅧ ㅨ ㅩ ㅪ ㅫ ㅬ ㅭ ㅮ ㅰ ㅯ ㅱ ㅲ ㅳ ㅴ ㅵ ㅶ ㅷ ㅸ ㅹ ㅺ ㅻ ㅼ ㅽ ㅾ ㅿ ㆀ ㆁ ㆂ ㆃ ㆄ ㆅ ㆆ ㆇ ㆈ ㆉ ㆊ ㆋ ㆌ ㆍ ㆎ';
  13. var S5 = '㉠ ㉡ ㉢ ㉣ ㉤ ㉥ ㉦ ㉧ ㉨ ㉩ ㉪ ㉫ ㉬ ㉭ ㉮ ㉯ ㉰ ㉱ ㉲ ㉳ ㉴ ㉶ ㉶ ㉷ ㉸ ㉹ ㉺ ㉻ ㈀ ㈁ ㈂ ㈃ ㈄ ㈅ ㈆ ㈇ ㈈ ㈉ ㈊ ㈋ ㈌ ㈍ ㈎ ㈏ ㈐ ㈑ ㈒ ㈓ ㈔ ㈕ ㈖ ㈗ ㈘ ㈙ ㈚ ㈛ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⒜ ⒝ ⒞ ⒟ ⒠ ⒡ ⒢ ⒣ ⒤ ⒥ ⒦ ⒧ ⒨ ⒩ ⒪ ⒫ ⒬ ⒭ ⒮ ⒯ ⒰ ⒱ ⒲ ⒳ ⒴ ⒵ ⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾ ⑿ ⒀ ⒁ ⒂';
  14. var japan1 = 'ぁ か さ た ど び ぽ ょ ゑ あ が ざ だ な ぴ ま よ を ぃ き し ち に ふ み ら ん い ぎ じ ぢ ぬ ぶ む り ぅ く す っ ね ぷ め る う ぐ ず つ の へ も れ ぇ け せ づ は べ ゃ ろ え げ ぜ て ば ぺ や ゎ ぉ こ そ で ぱ ほ ゅ わ お ご ぞ と ひ ぼ ゆ ゐ';
  15. var japan2 = 'ァ カ サ タ ド ビ ポ ョ ヱ ア ガ ザ ダ ナ ピ マ ヨ ヲ ィ キ シ チ ニ フ ミ ラ ン イ ギ ジ ヂ ヌ ブ ム リ ヴ ゥ ク ス ッ ネ プ メ ル ヵ ウ グ ズ ツ ノ ヘ モ レ ヶ ェ ケ セ ヅ ハ ベ ャ ロ エ ゲ ゼ テ バ ペ ヤ ヮ ォ コ ソ デ パ ホ ュ ワ オ ゴ ゾ ト ヒ ボ ユ ヰ';
  16. c = S1.split(' ');
  17. var button = [ { alt : "", img : 'input.gif', cmd : inputChar },
  18. { alt : "", img : 'cancel.gif', cmd : popupClose } ];
  19. var oEditor = null;
  20. function init(dialog) {
  21. oEditor = this;
  22. oEditor.dialog = dialog;
  23. var dlg = new Dialog(oEditor);
  24. dlg.showButton(button);
  25. setupEvent();
  26. dlg.setDialogHeight();
  27. }
  28. function hover(obj, val) {
  29. obj.style.backgroundColor = val ? "#5579aa" : "#fff";
  30. obj.style.color = val ? "#fff" : "#000";
  31. }
  32. function showTable() {
  33. var k = 0;
  34. var len = c.length;
  35. var w = 9;
  36. var h = 20;
  37. var span, i, j, tr, td;
  38. var table = document.createElement('table');
  39. table.border = 0;
  40. table.cellSpacing = 1;
  41. table.cellPadding = 0;
  42. table.align = 'center';
  43. var getChar = function() {
  44. document.getElementById('fm_input').value = document.getElementById('fm_input').value + c[this.id];
  45. };
  46. var mouseOver = function() {
  47. hover(this, true);
  48. };
  49. var mouseOut = function() {
  50. hover(this, false);
  51. };
  52. for (i=0; i < w; i++) {
  53. tr = table.insertRow(i);
  54. for (j = 0; j < h; j++) {
  55. td = tr.insertCell(j);
  56. td.className = 'schar';
  57. if ( len < k+1) {
  58. td.appendChild(document.createTextNode('\u00a0'));
  59. }
  60. else {
  61. td.style.cursor = 'pointer';
  62. td.id = k;
  63. td.onclick = getChar;
  64. td.onmouseover = mouseOver;
  65. td.onmouseout = mouseOut;
  66. span = document.createElement("span");
  67. span.style.fontSize = "13px";
  68. span.appendChild(document.createTextNode(c[k]));
  69. td.appendChild(span);
  70. }
  71. k++;
  72. }
  73. }
  74. var output = document.getElementById('output');
  75. if (output.hasChildNodes()) {
  76. for (i=0; i<output.childNodes.length; i++) {
  77. output.removeChild(output.firstChild);
  78. }
  79. }
  80. output.appendChild(table);
  81. }
  82. function sp1 () {
  83. c = S1.split(' ');
  84. showTable();
  85. }
  86. function sp2 () {
  87. c = S2.split(' ');
  88. showTable();
  89. }
  90. function sp3 () {
  91. c = S3.split(' ');
  92. showTable();
  93. }
  94. function sp4 () {
  95. c = S4.split(' ');
  96. showTable();
  97. }
  98. function sp5 () {
  99. c = S5.split(' ');
  100. showTable();
  101. }
  102. function sp6 () {
  103. c = japan1.split(' ').concat(japan2.split(' '));
  104. showTable();
  105. }
  106. function inputChar() {
  107. oEditor.insertHtmlPopup(document.getElementById('fm_input').value);
  108. oEditor.popupWinClose();
  109. }
  110. function popupClose() {
  111. oEditor.popupWinCancel();
  112. }
  113. function setupEvent() {
  114. var el = document.body.getElementsByTagName('LABEL');
  115. var i;
  116. var tab = function() {
  117. document.getElementById(this.id).style.fontWeight = 'bold';
  118. switch (this.id) {
  119. case 's1' : sp1(); break;
  120. case 's2' : sp2(); break;
  121. case 's3' : sp3(); break;
  122. case 's4' : sp4(); break;
  123. case 's5' : sp5(); break;
  124. default : sp6();
  125. }
  126. if (curView != this.id) {
  127. document.getElementById(curView).style.fontWeight = 'normal';
  128. }
  129. curView = this.id;
  130. };
  131. for (i=0; i < el.length; i++) {
  132. el[i].className = 'handCursor';
  133. el[i].style.fontSize = '9pt';
  134. el[i].style.margin = (i==0) ? '0px 0px 5px 5px' : '0px 0px 5px 0px';
  135. el[i].onclick = tab;
  136. }
  137. if (curView == null) {
  138. showTable();
  139. curView = 's1';
  140. document.getElementById(curView).style.fontWeight = 'bold';
  141. document.getElementById('output').style.visibility = 'visible';
  142. }
  143. document.getElementById("fm_input").value = "";
  144. }