glebtv-ckeditor 4.5.10.3 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ckeditor/config.js.erb +1 -1
  3. data/lib/ckeditor.rb +1 -0
  4. data/lib/ckeditor/version.rb +2 -2
  5. data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +1 -1
  6. data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +1 -1
  7. data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +1 -1
  8. data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +1 -1
  9. data/vendor/assets/javascripts/ckeditor/LICENSE.md +2 -2
  10. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +1 -1
  11. data/vendor/assets/javascripts/ckeditor/build-config.js +26 -26
  12. data/vendor/assets/javascripts/ckeditor/ckeditor.js +605 -576
  13. data/vendor/assets/javascripts/ckeditor/lang/en.js +2 -2
  14. data/vendor/assets/javascripts/ckeditor/lang/ru.js +2 -2
  15. data/vendor/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +9 -0
  16. data/vendor/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +2 -1
  17. data/vendor/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +3 -1
  18. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +6 -6
  19. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -4
  20. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +4 -4
  21. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +4 -3
  22. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +1 -1
  23. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/LICENSE.md +21 -0
  24. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +183 -0
  25. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +341 -0
  26. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  27. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +206 -0
  28. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +85 -0
  29. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +32 -0
  30. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +157 -0
  31. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +202 -0
  32. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +169 -0
  33. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +51 -0
  34. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +122 -0
  35. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +66 -0
  36. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +27 -0
  37. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +105 -0
  38. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +59 -0
  39. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +150 -0
  40. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +20 -0
  41. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +146 -0
  42. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +44 -0
  43. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +49 -0
  44. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +182 -0
  45. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +43 -0
  46. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +226 -0
  47. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +41 -0
  48. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +60 -0
  49. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +348 -0
  50. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +155 -0
  51. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.css +36 -0
  52. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +438 -0
  53. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +271 -0
  54. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +110 -0
  55. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +64 -0
  56. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +123 -0
  57. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +33 -0
  58. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +85 -0
  59. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +213 -0
  60. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +49 -0
  61. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +165 -0
  62. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +8 -0
  63. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +97 -0
  64. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +252 -0
  65. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +189 -0
  66. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +74 -0
  67. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +118 -0
  68. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +98 -0
  69. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +952 -0
  70. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +2087 -0
  71. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
  72. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  73. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +9109 -0
  74. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
  75. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
  76. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  77. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -1
  78. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +137 -0
  79. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +73 -0
  80. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +161 -0
  81. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +128 -0
  82. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +785 -0
  83. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +360 -0
  84. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +767 -0
  85. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +55 -0
  86. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +825 -0
  87. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +103 -0
  88. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +17 -0
  89. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +75 -0
  90. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +152 -0
  91. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +54 -0
  92. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +157 -0
  93. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +110 -0
  94. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +200 -0
  95. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +28 -0
  96. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +60 -0
  97. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +152 -0
  98. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +89 -0
  99. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +114 -0
  100. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +784 -0
  101. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +72 -0
  102. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +247 -0
  103. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +61 -0
  104. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +64 -0
  105. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +234 -0
  106. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +154 -0
  107. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +61 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +51 -0
  109. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +394 -0
  110. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +30 -24
  111. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +1 -1
  112. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -0
  113. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -0
  114. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +0 -1
  116. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +21 -15
  117. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +1 -1
  118. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +1 -1
  119. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
  120. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +9 -9
  121. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +12 -12
  122. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +1 -1
  123. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
  124. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +1 -1
  125. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
  126. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +1 -1
  127. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +11 -11
  128. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
  129. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
  130. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  131. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  132. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
  133. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +1 -1
  134. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +28 -28
  135. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/LICENSE +0 -0
  136. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/README.md +0 -0
  137. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/LANG.js +3 -0
  138. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/en.js +0 -0
  139. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +3 -3
  140. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/plugin.js +1 -1
  141. data/vendor/assets/javascripts/ckeditor/plugins/lineheight/readme.txt +0 -0
  142. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +1 -1
  143. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +25 -23
  144. data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
  146. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
  147. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +1 -1
  148. data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +1 -1
  149. data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +2 -2
  150. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +40 -29
  151. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +19 -19
  152. data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +20 -0
  153. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
  154. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
  155. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
  156. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
  157. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
  158. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/assets/sample.css +70 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +85 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +1 -1
  161. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -1
  162. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
  163. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
  164. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
  165. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +0 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -1
  170. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +1 -1
  171. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +60 -13
  172. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcount.html +61 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcountWithMaxCount.html +110 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +9 -9
  175. data/vendor/assets/javascripts/ckeditor/plugins/wsc/skins/moono-lisa/wsc.css +43 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +15 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +3 -1
  179. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +1 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -388
  181. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons16.png +0 -0
  182. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons16.svg +175 -0
  183. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons32.png +0 -0
  184. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons32.svg +167 -0
  185. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/locations.json +145 -0
  186. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +5 -0
  187. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +5 -0
  188. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +5 -0
  189. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +5 -0
  190. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +5 -0
  191. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +5 -0
  192. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +5 -0
  193. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +5 -0
  194. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +5 -0
  195. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/arrow.png +0 -0
  196. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/close.png +0 -0
  197. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/close.png +0 -0
  198. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
  199. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock.png +0 -0
  200. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/refresh.png +0 -0
  201. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/lock-open.png +0 -0
  202. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/lock.png +0 -0
  203. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/refresh.png +0 -0
  204. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/spinner.gif +0 -0
  205. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +46 -0
  206. data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +7 -0
  207. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +1 -1
  208. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +1 -1
  209. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +1 -1
  210. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +1 -1
  211. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +1 -1
  212. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +2 -2
  213. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +2 -2
  214. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +2 -2
  215. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +2 -2
  216. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +2 -2
  217. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +2 -2
  218. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  219. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  220. data/vendor/assets/javascripts/ckeditor/skins/moono/images/anchor.png +0 -0
  221. data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
  222. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
  223. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
  224. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
  225. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
  226. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
  227. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
  228. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
  229. data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
  230. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +3 -3
  231. data/vendor/assets/javascripts/ckeditor/styles.js +42 -16
  232. metadata +161 -105
  233. data/app/assets/javascripts/ckeditor/config_orig.js +0 -58
  234. data/vendor/assets/javascripts/ckeditor/README.md +0 -39
  235. data/vendor/assets/javascripts/ckeditor/config.js +0 -10
  236. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +0 -12
  237. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +0 -12
  238. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +0 -12
  239. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +0 -12
  240. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +0 -12
  241. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +0 -12
  242. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +0 -12
  243. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +0 -12
  244. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +0 -12
  245. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +0 -12
  246. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +0 -12
  247. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +0 -12
  248. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +0 -12
  249. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +0 -12
  250. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +0 -12
  251. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +0 -12
  252. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +0 -12
  253. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +0 -12
  254. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +0 -12
  255. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +0 -12
  256. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +0 -12
  257. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +0 -12
  258. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +0 -12
  259. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +0 -12
  260. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +0 -12
  261. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +0 -12
  262. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +0 -12
  263. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +0 -12
  264. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +0 -12
  265. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +0 -12
  266. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +0 -12
  267. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +0 -12
  268. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +0 -12
  269. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +0 -12
  270. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +0 -12
  271. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +0 -12
  272. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +0 -12
  273. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +0 -12
  274. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +0 -12
  275. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +0 -12
  276. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +0 -12
  277. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +0 -12
  278. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +0 -12
  279. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +0 -12
  280. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +0 -12
  281. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +0 -12
  282. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +0 -12
  283. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +0 -12
  284. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +0 -12
  285. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +0 -12
  286. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +0 -12
  287. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +0 -12
  288. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +0 -12
  289. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +0 -12
  290. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +0 -12
  291. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +0 -12
  292. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +0 -12
  293. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +0 -12
  294. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +0 -12
  295. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +0 -12
@@ -0,0 +1,154 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({indentUnit: 2}, "php");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
7
+
8
+ MT('simple_test',
9
+ '[meta <?php] ' +
10
+ '[keyword echo] [string "aaa"]; ' +
11
+ '[meta ?>]');
12
+
13
+ MT('variable_interpolation_non_alphanumeric',
14
+ '[meta <?php]',
15
+ '[keyword echo] [string "aaa$~$!$@$#$$$%$^$&$*$($)$.$<$>$/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]',
16
+ '[meta ?>]');
17
+
18
+ MT('variable_interpolation_digits',
19
+ '[meta <?php]',
20
+ '[keyword echo] [string "aaa$1$2$3$4$5$6$7$8$9$0aaa"]',
21
+ '[meta ?>]');
22
+
23
+ MT('variable_interpolation_simple_syntax_1',
24
+ '[meta <?php]',
25
+ '[keyword echo] [string "aaa][variable-2 $aaa][string .aaa"];',
26
+ '[meta ?>]');
27
+
28
+ MT('variable_interpolation_simple_syntax_2',
29
+ '[meta <?php]',
30
+ '[keyword echo] [string "][variable-2 $aaaa][[','[number 2]', ']][string aa"];',
31
+ '[keyword echo] [string "][variable-2 $aaaa][[','[number 2345]', ']][string aa"];',
32
+ '[keyword echo] [string "][variable-2 $aaaa][[','[number 2.3]', ']][string aa"];',
33
+ '[keyword echo] [string "][variable-2 $aaaa][[','[variable aaaaa]', ']][string aa"];',
34
+ '[keyword echo] [string "][variable-2 $aaaa][[','[variable-2 $aaaaa]',']][string aa"];',
35
+
36
+ '[keyword echo] [string "1aaa][variable-2 $aaaa][[','[number 2]', ']][string aa"];',
37
+ '[keyword echo] [string "aaa][variable-2 $aaaa][[','[number 2345]', ']][string aa"];',
38
+ '[keyword echo] [string "aaa][variable-2 $aaaa][[','[number 2.3]', ']][string aa"];',
39
+ '[keyword echo] [string "aaa][variable-2 $aaaa][[','[variable aaaaa]', ']][string aa"];',
40
+ '[keyword echo] [string "aaa][variable-2 $aaaa][[','[variable-2 $aaaaa]',']][string aa"];',
41
+ '[meta ?>]');
42
+
43
+ MT('variable_interpolation_simple_syntax_3',
44
+ '[meta <?php]',
45
+ '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string .aaaaaa"];',
46
+ '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];',
47
+ '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];',
48
+ '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];',
49
+ '[meta ?>]');
50
+
51
+ MT('variable_interpolation_escaping',
52
+ '[meta <?php] [comment /* Escaping */]',
53
+ '[keyword echo] [string "aaa\\$aaaa->aaa.aaa"];',
54
+ '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];',
55
+ '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];',
56
+ '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];',
57
+ '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];',
58
+ '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];',
59
+ '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];',
60
+ '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];',
61
+ '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];',
62
+ '[meta ?>]');
63
+
64
+ MT('variable_interpolation_complex_syntax_1',
65
+ '[meta <?php]',
66
+ '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa]}[string ->aaa.aaa"];',
67
+ '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];',
68
+ '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];',
69
+ '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa');
70
+
71
+ MT('variable_interpolation_complex_syntax_2',
72
+ '[meta <?php] [comment /* Monsters */]',
73
+ '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>} $aaa<?php } */]}[string ->aaa.aaa"];',
74
+ '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];',
75
+ '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];');
76
+
77
+
78
+ function build_recursive_monsters(nt, t, n){
79
+ var monsters = [t];
80
+ for (var i = 1; i <= n; ++i)
81
+ monsters[i] = nt.join(monsters[i - 1]);
82
+ return monsters;
83
+ }
84
+
85
+ var m1 = build_recursive_monsters(
86
+ ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'],
87
+ '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]',
88
+ 10
89
+ );
90
+
91
+ MT('variable_interpolation_complex_syntax_3_1',
92
+ '[meta <?php] [comment /* Recursive monsters */]',
93
+ '[keyword echo] ' + m1[4] + ';',
94
+ '[keyword echo] ' + m1[7] + ';',
95
+ '[keyword echo] ' + m1[8] + ';',
96
+ '[keyword echo] ' + m1[5] + ';',
97
+ '[keyword echo] ' + m1[1] + ';',
98
+ '[keyword echo] ' + m1[6] + ';',
99
+ '[keyword echo] ' + m1[9] + ';',
100
+ '[keyword echo] ' + m1[0] + ';',
101
+ '[keyword echo] ' + m1[10] + ';',
102
+ '[keyword echo] ' + m1[2] + ';',
103
+ '[keyword echo] ' + m1[3] + ';',
104
+ '[keyword echo] [string "end"];',
105
+ '[meta ?>]');
106
+
107
+ var m2 = build_recursive_monsters(
108
+ ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'],
109
+ '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',
110
+ 5
111
+ );
112
+
113
+ MT('variable_interpolation_complex_syntax_3_2',
114
+ '[meta <?php] [comment /* Recursive monsters 2 */]',
115
+ '[keyword echo] ' + m2[0] + ';',
116
+ '[keyword echo] ' + m2[1] + ';',
117
+ '[keyword echo] ' + m2[5] + ';',
118
+ '[keyword echo] ' + m2[4] + ';',
119
+ '[keyword echo] ' + m2[2] + ';',
120
+ '[keyword echo] ' + m2[3] + ';',
121
+ '[keyword echo] [string "end"];',
122
+ '[meta ?>]');
123
+
124
+ function build_recursive_monsters_2(mf1, mf2, nt, t, n){
125
+ var monsters = [t];
126
+ for (var i = 1; i <= n; ++i)
127
+ monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3];
128
+ return monsters;
129
+ }
130
+
131
+ var m3 = build_recursive_monsters_2(
132
+ m1,
133
+ m2,
134
+ ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'],
135
+ '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',
136
+ 4
137
+ );
138
+
139
+ MT('variable_interpolation_complex_syntax_3_3',
140
+ '[meta <?php] [comment /* Recursive monsters 2 */]',
141
+ '[keyword echo] ' + m3[4] + ';',
142
+ '[keyword echo] ' + m3[0] + ';',
143
+ '[keyword echo] ' + m3[3] + ';',
144
+ '[keyword echo] ' + m3[1] + ';',
145
+ '[keyword echo] ' + m3[2] + ';',
146
+ '[keyword echo] [string "end"];',
147
+ '[meta ?>]');
148
+
149
+ MT("variable_interpolation_heredoc",
150
+ "[meta <?php]",
151
+ "[string <<<here]",
152
+ "[string doc ][variable-2 $]{[variable yay]}[string more]",
153
+ "[string here]; [comment // normal]");
154
+ })();
@@ -0,0 +1,61 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: XML mode</title>
4
+ <meta charset="utf-8"/>
5
+ <link rel=stylesheet href="../../doc/docs.css">
6
+
7
+ <link rel="stylesheet" href="../../lib/codemirror.css">
8
+ <script src="../../lib/codemirror.js"></script>
9
+ <script src="xml.js"></script>
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <div id=nav>
12
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
13
+
14
+ <ul>
15
+ <li><a href="../../index.html">Home</a>
16
+ <li><a href="../../doc/manual.html">Manual</a>
17
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
18
+ </ul>
19
+ <ul>
20
+ <li><a href="../index.html">Language modes</a>
21
+ <li><a class=active href="#">XML</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>XML mode</h2>
27
+ <form><textarea id="code" name="code">
28
+ &lt;html style="color: green"&gt;
29
+ &lt;!-- this is a comment --&gt;
30
+ &lt;head&gt;
31
+ &lt;title&gt;HTML Example&lt;/title&gt;
32
+ &lt;/head&gt;
33
+ &lt;body&gt;
34
+ The indentation tries to be &lt;em&gt;somewhat &amp;quot;do what
35
+ I mean&amp;quot;&lt;/em&gt;... but might not match your style.
36
+ &lt;/body&gt;
37
+ &lt;/html&gt;
38
+ </textarea></form>
39
+ <script>
40
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
41
+ mode: "text/html",
42
+ lineNumbers: true
43
+ });
44
+ </script>
45
+ <p>The XML mode supports these configuration parameters:</p>
46
+ <dl>
47
+ <dt><code>htmlMode (boolean)</code></dt>
48
+ <dd>This switches the mode to parse HTML instead of XML. This
49
+ means attributes do not have to be quoted, and some elements
50
+ (such as <code>br</code>) do not require a closing tag.</dd>
51
+ <dt><code>matchClosing (boolean)</code></dt>
52
+ <dd>Controls whether the mode checks that close tags match the
53
+ corresponding opening tag, and highlights mismatches as errors.
54
+ Defaults to true.</dd>
55
+ <dt><code>alignCDATA (boolean)</code></dt>
56
+ <dd>Setting this to true will force the opening tag of CDATA
57
+ blocks to not be indented.</dd>
58
+ </dl>
59
+
60
+ <p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>
61
+ </article>
@@ -0,0 +1,51 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml";
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); }
7
+
8
+ MT("matching",
9
+ "[tag&bracket <][tag top][tag&bracket >]",
10
+ " text",
11
+ " [tag&bracket <][tag inner][tag&bracket />]",
12
+ "[tag&bracket </][tag top][tag&bracket >]");
13
+
14
+ MT("nonmatching",
15
+ "[tag&bracket <][tag top][tag&bracket >]",
16
+ " [tag&bracket <][tag inner][tag&bracket />]",
17
+ " [tag&bracket </][tag&error tip][tag&bracket&error >]");
18
+
19
+ MT("doctype",
20
+ "[meta <!doctype foobar>]",
21
+ "[tag&bracket <][tag top][tag&bracket />]");
22
+
23
+ MT("cdata",
24
+ "[tag&bracket <][tag top][tag&bracket >]",
25
+ " [atom <![CDATA[foo]",
26
+ "[atom barbazguh]]]]>]",
27
+ "[tag&bracket </][tag top][tag&bracket >]");
28
+
29
+ // HTML tests
30
+ mode = CodeMirror.getMode({indentUnit: 2}, "text/html");
31
+
32
+ MT("selfclose",
33
+ "[tag&bracket <][tag html][tag&bracket >]",
34
+ " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]",
35
+ "[tag&bracket </][tag html][tag&bracket >]");
36
+
37
+ MT("list",
38
+ "[tag&bracket <][tag ol][tag&bracket >]",
39
+ " [tag&bracket <][tag li][tag&bracket >]one",
40
+ " [tag&bracket <][tag li][tag&bracket >]two",
41
+ "[tag&bracket </][tag ol][tag&bracket >]");
42
+
43
+ MT("valueless",
44
+ "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]");
45
+
46
+ MT("pThenArticle",
47
+ "[tag&bracket <][tag p][tag&bracket >]",
48
+ " foo",
49
+ "[tag&bracket <][tag article][tag&bracket >]bar");
50
+
51
+ })();
@@ -0,0 +1,394 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var htmlConfig = {
15
+ autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
16
+ 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
17
+ 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
18
+ 'track': true, 'wbr': true, 'menuitem': true},
19
+ implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
20
+ 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
21
+ 'th': true, 'tr': true},
22
+ contextGrabbers: {
23
+ 'dd': {'dd': true, 'dt': true},
24
+ 'dt': {'dd': true, 'dt': true},
25
+ 'li': {'li': true},
26
+ 'option': {'option': true, 'optgroup': true},
27
+ 'optgroup': {'optgroup': true},
28
+ 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
29
+ 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
30
+ 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
31
+ 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
32
+ 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
33
+ 'rp': {'rp': true, 'rt': true},
34
+ 'rt': {'rp': true, 'rt': true},
35
+ 'tbody': {'tbody': true, 'tfoot': true},
36
+ 'td': {'td': true, 'th': true},
37
+ 'tfoot': {'tbody': true},
38
+ 'th': {'td': true, 'th': true},
39
+ 'thead': {'tbody': true, 'tfoot': true},
40
+ 'tr': {'tr': true}
41
+ },
42
+ doNotIndent: {"pre": true},
43
+ allowUnquoted: true,
44
+ allowMissing: true,
45
+ caseFold: true
46
+ }
47
+
48
+ var xmlConfig = {
49
+ autoSelfClosers: {},
50
+ implicitlyClosed: {},
51
+ contextGrabbers: {},
52
+ doNotIndent: {},
53
+ allowUnquoted: false,
54
+ allowMissing: false,
55
+ caseFold: false
56
+ }
57
+
58
+ CodeMirror.defineMode("xml", function(editorConf, config_) {
59
+ var indentUnit = editorConf.indentUnit
60
+ var config = {}
61
+ var defaults = config_.htmlMode ? htmlConfig : xmlConfig
62
+ for (var prop in defaults) config[prop] = defaults[prop]
63
+ for (var prop in config_) config[prop] = config_[prop]
64
+
65
+ // Return variables for tokenizers
66
+ var type, setStyle;
67
+
68
+ function inText(stream, state) {
69
+ function chain(parser) {
70
+ state.tokenize = parser;
71
+ return parser(stream, state);
72
+ }
73
+
74
+ var ch = stream.next();
75
+ if (ch == "<") {
76
+ if (stream.eat("!")) {
77
+ if (stream.eat("[")) {
78
+ if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
79
+ else return null;
80
+ } else if (stream.match("--")) {
81
+ return chain(inBlock("comment", "-->"));
82
+ } else if (stream.match("DOCTYPE", true, true)) {
83
+ stream.eatWhile(/[\w\._\-]/);
84
+ return chain(doctype(1));
85
+ } else {
86
+ return null;
87
+ }
88
+ } else if (stream.eat("?")) {
89
+ stream.eatWhile(/[\w\._\-]/);
90
+ state.tokenize = inBlock("meta", "?>");
91
+ return "meta";
92
+ } else {
93
+ type = stream.eat("/") ? "closeTag" : "openTag";
94
+ state.tokenize = inTag;
95
+ return "tag bracket";
96
+ }
97
+ } else if (ch == "&") {
98
+ var ok;
99
+ if (stream.eat("#")) {
100
+ if (stream.eat("x")) {
101
+ ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
102
+ } else {
103
+ ok = stream.eatWhile(/[\d]/) && stream.eat(";");
104
+ }
105
+ } else {
106
+ ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
107
+ }
108
+ return ok ? "atom" : "error";
109
+ } else {
110
+ stream.eatWhile(/[^&<]/);
111
+ return null;
112
+ }
113
+ }
114
+ inText.isInText = true;
115
+
116
+ function inTag(stream, state) {
117
+ var ch = stream.next();
118
+ if (ch == ">" || (ch == "/" && stream.eat(">"))) {
119
+ state.tokenize = inText;
120
+ type = ch == ">" ? "endTag" : "selfcloseTag";
121
+ return "tag bracket";
122
+ } else if (ch == "=") {
123
+ type = "equals";
124
+ return null;
125
+ } else if (ch == "<") {
126
+ state.tokenize = inText;
127
+ state.state = baseState;
128
+ state.tagName = state.tagStart = null;
129
+ var next = state.tokenize(stream, state);
130
+ return next ? next + " tag error" : "tag error";
131
+ } else if (/[\'\"]/.test(ch)) {
132
+ state.tokenize = inAttribute(ch);
133
+ state.stringStartCol = stream.column();
134
+ return state.tokenize(stream, state);
135
+ } else {
136
+ stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
137
+ return "word";
138
+ }
139
+ }
140
+
141
+ function inAttribute(quote) {
142
+ var closure = function(stream, state) {
143
+ while (!stream.eol()) {
144
+ if (stream.next() == quote) {
145
+ state.tokenize = inTag;
146
+ break;
147
+ }
148
+ }
149
+ return "string";
150
+ };
151
+ closure.isInAttribute = true;
152
+ return closure;
153
+ }
154
+
155
+ function inBlock(style, terminator) {
156
+ return function(stream, state) {
157
+ while (!stream.eol()) {
158
+ if (stream.match(terminator)) {
159
+ state.tokenize = inText;
160
+ break;
161
+ }
162
+ stream.next();
163
+ }
164
+ return style;
165
+ };
166
+ }
167
+ function doctype(depth) {
168
+ return function(stream, state) {
169
+ var ch;
170
+ while ((ch = stream.next()) != null) {
171
+ if (ch == "<") {
172
+ state.tokenize = doctype(depth + 1);
173
+ return state.tokenize(stream, state);
174
+ } else if (ch == ">") {
175
+ if (depth == 1) {
176
+ state.tokenize = inText;
177
+ break;
178
+ } else {
179
+ state.tokenize = doctype(depth - 1);
180
+ return state.tokenize(stream, state);
181
+ }
182
+ }
183
+ }
184
+ return "meta";
185
+ };
186
+ }
187
+
188
+ function Context(state, tagName, startOfLine) {
189
+ this.prev = state.context;
190
+ this.tagName = tagName;
191
+ this.indent = state.indented;
192
+ this.startOfLine = startOfLine;
193
+ if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
194
+ this.noIndent = true;
195
+ }
196
+ function popContext(state) {
197
+ if (state.context) state.context = state.context.prev;
198
+ }
199
+ function maybePopContext(state, nextTagName) {
200
+ var parentTagName;
201
+ while (true) {
202
+ if (!state.context) {
203
+ return;
204
+ }
205
+ parentTagName = state.context.tagName;
206
+ if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
207
+ !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
208
+ return;
209
+ }
210
+ popContext(state);
211
+ }
212
+ }
213
+
214
+ function baseState(type, stream, state) {
215
+ if (type == "openTag") {
216
+ state.tagStart = stream.column();
217
+ return tagNameState;
218
+ } else if (type == "closeTag") {
219
+ return closeTagNameState;
220
+ } else {
221
+ return baseState;
222
+ }
223
+ }
224
+ function tagNameState(type, stream, state) {
225
+ if (type == "word") {
226
+ state.tagName = stream.current();
227
+ setStyle = "tag";
228
+ return attrState;
229
+ } else {
230
+ setStyle = "error";
231
+ return tagNameState;
232
+ }
233
+ }
234
+ function closeTagNameState(type, stream, state) {
235
+ if (type == "word") {
236
+ var tagName = stream.current();
237
+ if (state.context && state.context.tagName != tagName &&
238
+ config.implicitlyClosed.hasOwnProperty(state.context.tagName))
239
+ popContext(state);
240
+ if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
241
+ setStyle = "tag";
242
+ return closeState;
243
+ } else {
244
+ setStyle = "tag error";
245
+ return closeStateErr;
246
+ }
247
+ } else {
248
+ setStyle = "error";
249
+ return closeStateErr;
250
+ }
251
+ }
252
+
253
+ function closeState(type, _stream, state) {
254
+ if (type != "endTag") {
255
+ setStyle = "error";
256
+ return closeState;
257
+ }
258
+ popContext(state);
259
+ return baseState;
260
+ }
261
+ function closeStateErr(type, stream, state) {
262
+ setStyle = "error";
263
+ return closeState(type, stream, state);
264
+ }
265
+
266
+ function attrState(type, _stream, state) {
267
+ if (type == "word") {
268
+ setStyle = "attribute";
269
+ return attrEqState;
270
+ } else if (type == "endTag" || type == "selfcloseTag") {
271
+ var tagName = state.tagName, tagStart = state.tagStart;
272
+ state.tagName = state.tagStart = null;
273
+ if (type == "selfcloseTag" ||
274
+ config.autoSelfClosers.hasOwnProperty(tagName)) {
275
+ maybePopContext(state, tagName);
276
+ } else {
277
+ maybePopContext(state, tagName);
278
+ state.context = new Context(state, tagName, tagStart == state.indented);
279
+ }
280
+ return baseState;
281
+ }
282
+ setStyle = "error";
283
+ return attrState;
284
+ }
285
+ function attrEqState(type, stream, state) {
286
+ if (type == "equals") return attrValueState;
287
+ if (!config.allowMissing) setStyle = "error";
288
+ return attrState(type, stream, state);
289
+ }
290
+ function attrValueState(type, stream, state) {
291
+ if (type == "string") return attrContinuedState;
292
+ if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
293
+ setStyle = "error";
294
+ return attrState(type, stream, state);
295
+ }
296
+ function attrContinuedState(type, stream, state) {
297
+ if (type == "string") return attrContinuedState;
298
+ return attrState(type, stream, state);
299
+ }
300
+
301
+ return {
302
+ startState: function(baseIndent) {
303
+ var state = {tokenize: inText,
304
+ state: baseState,
305
+ indented: baseIndent || 0,
306
+ tagName: null, tagStart: null,
307
+ context: null}
308
+ if (baseIndent != null) state.baseIndent = baseIndent
309
+ return state
310
+ },
311
+
312
+ token: function(stream, state) {
313
+ if (!state.tagName && stream.sol())
314
+ state.indented = stream.indentation();
315
+
316
+ if (stream.eatSpace()) return null;
317
+ type = null;
318
+ var style = state.tokenize(stream, state);
319
+ if ((style || type) && style != "comment") {
320
+ setStyle = null;
321
+ state.state = state.state(type || style, stream, state);
322
+ if (setStyle)
323
+ style = setStyle == "error" ? style + " error" : setStyle;
324
+ }
325
+ return style;
326
+ },
327
+
328
+ indent: function(state, textAfter, fullLine) {
329
+ var context = state.context;
330
+ // Indent multi-line strings (e.g. css).
331
+ if (state.tokenize.isInAttribute) {
332
+ if (state.tagStart == state.indented)
333
+ return state.stringStartCol + 1;
334
+ else
335
+ return state.indented + indentUnit;
336
+ }
337
+ if (context && context.noIndent) return CodeMirror.Pass;
338
+ if (state.tokenize != inTag && state.tokenize != inText)
339
+ return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
340
+ // Indent the starts of attribute names.
341
+ if (state.tagName) {
342
+ if (config.multilineTagIndentPastTag !== false)
343
+ return state.tagStart + state.tagName.length + 2;
344
+ else
345
+ return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
346
+ }
347
+ if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
348
+ var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
349
+ if (tagAfter && tagAfter[1]) { // Closing tag spotted
350
+ while (context) {
351
+ if (context.tagName == tagAfter[2]) {
352
+ context = context.prev;
353
+ break;
354
+ } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
355
+ context = context.prev;
356
+ } else {
357
+ break;
358
+ }
359
+ }
360
+ } else if (tagAfter) { // Opening tag spotted
361
+ while (context) {
362
+ var grabbers = config.contextGrabbers[context.tagName];
363
+ if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
364
+ context = context.prev;
365
+ else
366
+ break;
367
+ }
368
+ }
369
+ while (context && context.prev && !context.startOfLine)
370
+ context = context.prev;
371
+ if (context) return context.indent + indentUnit;
372
+ else return state.baseIndent || 0;
373
+ },
374
+
375
+ electricInput: /<\/[\s\w:]+>$/,
376
+ blockCommentStart: "<!--",
377
+ blockCommentEnd: "-->",
378
+
379
+ configuration: config.htmlMode ? "html" : "xml",
380
+ helperType: config.htmlMode ? "html" : "xml",
381
+
382
+ skipAttribute: function(state) {
383
+ if (state.state == attrValueState)
384
+ state.state = attrState
385
+ }
386
+ };
387
+ });
388
+
389
+ CodeMirror.defineMIME("text/xml", "xml");
390
+ CodeMirror.defineMIME("application/xml", "xml");
391
+ if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
392
+ CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
393
+
394
+ });