a11yhelp.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. CKEDITOR.dialog.add("a11yHelp", function(f) {
  6. function m(a) {
  7. for (var b, c, h = [], d = 0; d < g.length; d++)
  8. (c = g[d]), (b = a / g[d]), 1 < b && 2 >= b && ((a -= c), h.push(e[c]));
  9. h.push(e[a] || String.fromCharCode(a));
  10. return h.join("+");
  11. }
  12. function t(a, b) {
  13. var c = f.getCommandKeystroke(b, !0);
  14. return c.length ? CKEDITOR.tools.array.map(c, m).join(" / ") : a;
  15. }
  16. var a = f.lang.a11yhelp,
  17. b = f.lang.common.keyboard,
  18. p = CKEDITOR.tools.getNextId(),
  19. q = /\$\{(.*?)\}/g,
  20. g = [CKEDITOR.ALT, CKEDITOR.SHIFT, CKEDITOR.CTRL],
  21. e = {
  22. 8: b[8],
  23. 9: a.tab,
  24. 13: b[13],
  25. 16: b[16],
  26. 17: b[17],
  27. 18: b[18],
  28. 19: a.pause,
  29. 20: a.capslock,
  30. 27: a.escape,
  31. 33: a.pageUp,
  32. 34: a.pageDown,
  33. 35: b[35],
  34. 36: b[36],
  35. 37: a.leftArrow,
  36. 38: a.upArrow,
  37. 39: a.rightArrow,
  38. 40: a.downArrow,
  39. 45: a.insert,
  40. 46: b[46],
  41. 91: a.leftWindowKey,
  42. 92: a.rightWindowKey,
  43. 93: a.selectKey,
  44. 96: a.numpad0,
  45. 97: a.numpad1,
  46. 98: a.numpad2,
  47. 99: a.numpad3,
  48. 100: a.numpad4,
  49. 101: a.numpad5,
  50. 102: a.numpad6,
  51. 103: a.numpad7,
  52. 104: a.numpad8,
  53. 105: a.numpad9,
  54. 106: a.multiply,
  55. 107: a.add,
  56. 109: a.subtract,
  57. 110: a.decimalPoint,
  58. 111: a.divide,
  59. 112: a.f1,
  60. 113: a.f2,
  61. 114: a.f3,
  62. 115: a.f4,
  63. 116: a.f5,
  64. 117: a.f6,
  65. 118: a.f7,
  66. 119: a.f8,
  67. 120: a.f9,
  68. 121: a.f10,
  69. 122: a.f11,
  70. 123: a.f12,
  71. 144: a.numLock,
  72. 145: a.scrollLock,
  73. 186: a.semiColon,
  74. 187: a.equalSign,
  75. 188: a.comma,
  76. 189: a.dash,
  77. 190: a.period,
  78. 191: a.forwardSlash,
  79. 192: a.graveAccent,
  80. 219: a.openBracket,
  81. 220: a.backSlash,
  82. 221: a.closeBracket,
  83. 222: a.singleQuote
  84. };
  85. e[CKEDITOR.ALT] = b[18];
  86. e[CKEDITOR.SHIFT] = b[16];
  87. e[CKEDITOR.CTRL] = CKEDITOR.env.mac ? b[224] : b[17];
  88. return {
  89. title: a.title,
  90. minWidth: 600,
  91. minHeight: 400,
  92. contents: [
  93. {
  94. id: "info",
  95. label: f.lang.common.generalTab,
  96. expand: !0,
  97. elements: [
  98. {
  99. type: "html",
  100. id: "legends",
  101. style: "white-space:normal;",
  102. focus: function() {
  103. this.getElement().focus();
  104. },
  105. html:
  106. (function() {
  107. for (
  108. var b =
  109. '\x3cdiv class\x3d"cke_accessibility_legend" role\x3d"document" aria-labelledby\x3d"' +
  110. p +
  111. '_arialbl" tabIndex\x3d"-1"\x3e%1\x3c/div\x3e\x3cspan id\x3d"' +
  112. p +
  113. '_arialbl" class\x3d"cke_voice_label"\x3e' +
  114. a.contents +
  115. " \x3c/span\x3e",
  116. e = [],
  117. c = a.legend,
  118. h = c.length,
  119. d = 0;
  120. d < h;
  121. d++
  122. ) {
  123. for (
  124. var f = c[d], g = [], r = f.items, m = r.length, n = 0;
  125. n < m;
  126. n++
  127. ) {
  128. var k = r[n],
  129. l =
  130. CKEDITOR.env.edge && k.legendEdge
  131. ? k.legendEdge
  132. : k.legend,
  133. l = l.replace(q, t);
  134. l.match(q) ||
  135. g.push(
  136. "\x3cdt\x3e%1\x3c/dt\x3e\x3cdd\x3e%2\x3c/dd\x3e"
  137. .replace("%1", k.name)
  138. .replace("%2", l)
  139. );
  140. }
  141. e.push(
  142. "\x3ch1\x3e%1\x3c/h1\x3e\x3cdl\x3e%2\x3c/dl\x3e"
  143. .replace("%1", f.name)
  144. .replace("%2", g.join(""))
  145. );
  146. }
  147. return b.replace("%1", e.join(""));
  148. })() +
  149. '\x3cstyle type\x3d"text/css"\x3e.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}\x3c/style\x3e'
  150. }
  151. ]
  152. }
  153. ],
  154. buttons: [CKEDITOR.dialog.cancelButton]
  155. };
  156. });