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,72 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: JSON-LD 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="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="../../addon/comment/continuecomment.js"></script>
11
+ <script src="../../addon/comment/comment.js"></script>
12
+ <script src="javascript.js"></script>
13
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
14
+ <div id="nav">
15
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
16
+
17
+ <ul>
18
+ <li><a href="../../index.html">Home</a>
19
+ <li><a href="../../doc/manual.html">Manual</a>
20
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
21
+ </ul>
22
+ <ul>
23
+ <li><a href="../index.html">Language modes</a>
24
+ <li><a class=active href="#">JSON-LD</a>
25
+ </ul>
26
+ </div>
27
+
28
+ <article>
29
+ <h2>JSON-LD mode</h2>
30
+
31
+
32
+ <div><textarea id="code" name="code">
33
+ {
34
+ "@context": {
35
+ "name": "http://schema.org/name",
36
+ "description": "http://schema.org/description",
37
+ "image": {
38
+ "@id": "http://schema.org/image",
39
+ "@type": "@id"
40
+ },
41
+ "geo": "http://schema.org/geo",
42
+ "latitude": {
43
+ "@id": "http://schema.org/latitude",
44
+ "@type": "xsd:float"
45
+ },
46
+ "longitude": {
47
+ "@id": "http://schema.org/longitude",
48
+ "@type": "xsd:float"
49
+ },
50
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
51
+ },
52
+ "name": "The Empire State Building",
53
+ "description": "The Empire State Building is a 102-story landmark in New York City.",
54
+ "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
55
+ "geo": {
56
+ "latitude": "40.75",
57
+ "longitude": "73.98"
58
+ }
59
+ }
60
+ </textarea></div>
61
+
62
+ <script>
63
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
64
+ matchBrackets: true,
65
+ autoCloseBrackets: true,
66
+ mode: "application/ld+json",
67
+ lineWrapping: true
68
+ });
69
+ </script>
70
+
71
+ <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
72
+ </article>
@@ -0,0 +1,247 @@
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}, "javascript");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
7
+
8
+ MT("locals",
9
+ "[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
10
+
11
+ MT("comma-and-binop",
12
+ "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");
13
+
14
+ MT("destructuring",
15
+ "([keyword function]([def a], [[[def b], [def c] ]]) {",
16
+ " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);",
17
+ " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",
18
+ "})();");
19
+
20
+ MT("destructure_trailing_comma",
21
+ "[keyword let] {[def a], [def b],} [operator =] [variable foo];",
22
+ "[keyword let] [def c];"); // Parser still in good state?
23
+
24
+ MT("class_body",
25
+ "[keyword class] [def Foo] {",
26
+ " [property constructor]() {}",
27
+ " [property sayName]() {",
28
+ " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
29
+ " }",
30
+ "}");
31
+
32
+ MT("class",
33
+ "[keyword class] [def Point] [keyword extends] [variable SuperThing] {",
34
+ " [keyword get] [property prop]() { [keyword return] [number 24]; }",
35
+ " [property constructor]([def x], [def y]) {",
36
+ " [keyword super]([string 'something']);",
37
+ " [keyword this].[property x] [operator =] [variable-2 x];",
38
+ " }",
39
+ "}");
40
+
41
+ MT("anonymous_class_expression",
42
+ "[keyword const] [def Adder] [operator =] [keyword class] [keyword extends] [variable Arithmetic] {",
43
+ " [property add]([def a], [def b]) {}",
44
+ "};");
45
+
46
+ MT("named_class_expression",
47
+ "[keyword const] [def Subber] [operator =] [keyword class] [def Subtract] {",
48
+ " [property sub]([def a], [def b]) {}",
49
+ "};");
50
+
51
+ MT("import",
52
+ "[keyword function] [def foo]() {",
53
+ " [keyword import] [def $] [keyword from] [string 'jquery'];",
54
+ " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",
55
+ "}");
56
+
57
+ MT("import_trailing_comma",
58
+ "[keyword import] {[def foo], [def bar],} [keyword from] [string 'baz']")
59
+
60
+ MT("const",
61
+ "[keyword function] [def f]() {",
62
+ " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
63
+ "}");
64
+
65
+ MT("for/of",
66
+ "[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}");
67
+
68
+ MT("generator",
69
+ "[keyword function*] [def repeat]([def n]) {",
70
+ " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
71
+ " [keyword yield] [variable-2 i];",
72
+ "}");
73
+
74
+ MT("quotedStringAddition",
75
+ "[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
76
+
77
+ MT("quotedFatArrow",
78
+ "[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
79
+
80
+ MT("fatArrow",
81
+ "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",
82
+ "[variable a];", // No longer in scope
83
+ "[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
84
+ "[variable c];");
85
+
86
+ MT("spread",
87
+ "[keyword function] [def f]([def a], [meta ...][def b]) {",
88
+ " [variable something]([variable-2 a], [meta ...][variable-2 b]);",
89
+ "}");
90
+
91
+ MT("quasi",
92
+ "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
93
+
94
+ MT("quasi_no_function",
95
+ "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
96
+
97
+ MT("indent_statement",
98
+ "[keyword var] [def x] [operator =] [number 10]",
99
+ "[variable x] [operator +=] [variable y] [operator +]",
100
+ " [atom Infinity]",
101
+ "[keyword debugger];");
102
+
103
+ MT("indent_if",
104
+ "[keyword if] ([number 1])",
105
+ " [keyword break];",
106
+ "[keyword else] [keyword if] ([number 2])",
107
+ " [keyword continue];",
108
+ "[keyword else]",
109
+ " [number 10];",
110
+ "[keyword if] ([number 1]) {",
111
+ " [keyword break];",
112
+ "} [keyword else] [keyword if] ([number 2]) {",
113
+ " [keyword continue];",
114
+ "} [keyword else] {",
115
+ " [number 10];",
116
+ "}");
117
+
118
+ MT("indent_for",
119
+ "[keyword for] ([keyword var] [def i] [operator =] [number 0];",
120
+ " [variable i] [operator <] [number 100];",
121
+ " [variable i][operator ++])",
122
+ " [variable doSomething]([variable i]);",
123
+ "[keyword debugger];");
124
+
125
+ MT("indent_c_style",
126
+ "[keyword function] [def foo]()",
127
+ "{",
128
+ " [keyword debugger];",
129
+ "}");
130
+
131
+ MT("indent_else",
132
+ "[keyword for] (;;)",
133
+ " [keyword if] ([variable foo])",
134
+ " [keyword if] ([variable bar])",
135
+ " [number 1];",
136
+ " [keyword else]",
137
+ " [number 2];",
138
+ " [keyword else]",
139
+ " [number 3];");
140
+
141
+ MT("indent_funarg",
142
+ "[variable foo]([number 10000],",
143
+ " [keyword function]([def a]) {",
144
+ " [keyword debugger];",
145
+ "};");
146
+
147
+ MT("indent_below_if",
148
+ "[keyword for] (;;)",
149
+ " [keyword if] ([variable foo])",
150
+ " [number 1];",
151
+ "[number 2];");
152
+
153
+ MT("indent_semicolonless_if",
154
+ "[keyword function] [def foo]() {",
155
+ " [keyword if] ([variable x])",
156
+ " [variable foo]()",
157
+ "}")
158
+
159
+ MT("indent_semicolonless_if_with_statement",
160
+ "[keyword function] [def foo]() {",
161
+ " [keyword if] ([variable x])",
162
+ " [variable foo]()",
163
+ " [variable bar]()",
164
+ "}")
165
+
166
+ MT("multilinestring",
167
+ "[keyword var] [def x] [operator =] [string 'foo\\]",
168
+ "[string bar'];");
169
+
170
+ MT("scary_regexp",
171
+ "[string-2 /foo[[/]]bar/];");
172
+
173
+ MT("indent_strange_array",
174
+ "[keyword var] [def x] [operator =] [[",
175
+ " [number 1],,",
176
+ " [number 2],",
177
+ "]];",
178
+ "[number 10];");
179
+
180
+ MT("param_default",
181
+ "[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
182
+ " [keyword return] [variable-2 x];",
183
+ "}");
184
+
185
+ MT("new_target",
186
+ "[keyword function] [def F]([def target]) {",
187
+ " [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
188
+ " [keyword return] [keyword new]",
189
+ " .[keyword target];",
190
+ " }",
191
+ "}");
192
+
193
+ var ts_mode = CodeMirror.getMode({indentUnit: 2}, "application/typescript")
194
+ function TS(name) {
195
+ test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1))
196
+ }
197
+
198
+ TS("extend_type",
199
+ "[keyword class] [def Foo] [keyword extends] [variable-3 Some][operator <][variable-3 Type][operator >] {}")
200
+
201
+ TS("arrow_type",
202
+ "[keyword let] [def x]: ([variable arg]: [variable-3 Type]) [operator =>] [variable-3 ReturnType]")
203
+
204
+ TS("typescript_class",
205
+ "[keyword class] [def Foo] {",
206
+ " [keyword public] [keyword static] [property main]() {}",
207
+ " [keyword private] [property _foo]: [variable-3 string];",
208
+ "}")
209
+
210
+ var jsonld_mode = CodeMirror.getMode(
211
+ {indentUnit: 2},
212
+ {name: "javascript", jsonld: true}
213
+ );
214
+ function LD(name) {
215
+ test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1));
216
+ }
217
+
218
+ LD("json_ld_keywords",
219
+ '{',
220
+ ' [meta "@context"]: {',
221
+ ' [meta "@base"]: [string "http://example.com"],',
222
+ ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',
223
+ ' [property "likesFlavor"]: {',
224
+ ' [meta "@container"]: [meta "@list"]',
225
+ ' [meta "@reverse"]: [string "@beFavoriteOf"]',
226
+ ' },',
227
+ ' [property "nick"]: { [meta "@container"]: [meta "@set"] },',
228
+ ' [property "nick"]: { [meta "@container"]: [meta "@index"] }',
229
+ ' },',
230
+ ' [meta "@graph"]: [[ {',
231
+ ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',
232
+ ' [property "name"]: [string "John Lennon"],',
233
+ ' [property "modified"]: {',
234
+ ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',
235
+ ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]',
236
+ ' }',
237
+ ' } ]]',
238
+ '}');
239
+
240
+ LD("json_ld_fake",
241
+ '{',
242
+ ' [property "@fake"]: [string "@fake"],',
243
+ ' [property "@contextual"]: [string "@identifier"],',
244
+ ' [property "user@domain.com"]: [string "@graphical"],',
245
+ ' [property "@ID"]: [string "@@ID"]',
246
+ '}');
247
+ })();
@@ -0,0 +1,61 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: TypeScript 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="javascript.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="#">TypeScript</a>
22
+ </ul>
23
+ </div>
24
+
25
+ <article>
26
+ <h2>TypeScript mode</h2>
27
+
28
+
29
+ <div><textarea id="code" name="code">
30
+ class Greeter {
31
+ greeting: string;
32
+ constructor (message: string) {
33
+ this.greeting = message;
34
+ }
35
+ greet() {
36
+ return "Hello, " + this.greeting;
37
+ }
38
+ }
39
+
40
+ var greeter = new Greeter("world");
41
+
42
+ var button = document.createElement('button')
43
+ button.innerText = "Say Hello"
44
+ button.onclick = function() {
45
+ alert(greeter.greet())
46
+ }
47
+
48
+ document.body.appendChild(button)
49
+
50
+ </textarea></div>
51
+
52
+ <script>
53
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
54
+ lineNumbers: true,
55
+ matchBrackets: true,
56
+ mode: "text/typescript"
57
+ });
58
+ </script>
59
+
60
+ <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
61
+ </article>
@@ -0,0 +1,64 @@
1
+ <!doctype html>
2
+
3
+ <title>CodeMirror: PHP 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="../../addon/edit/matchbrackets.js"></script>
10
+ <script src="../htmlmixed/htmlmixed.js"></script>
11
+ <script src="../xml/xml.js"></script>
12
+ <script src="../javascript/javascript.js"></script>
13
+ <script src="../css/css.js"></script>
14
+ <script src="../clike/clike.js"></script>
15
+ <script src="php.js"></script>
16
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
17
+ <div id=nav>
18
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
19
+
20
+ <ul>
21
+ <li><a href="../../index.html">Home</a>
22
+ <li><a href="../../doc/manual.html">Manual</a>
23
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
24
+ </ul>
25
+ <ul>
26
+ <li><a href="../index.html">Language modes</a>
27
+ <li><a class=active href="#">PHP</a>
28
+ </ul>
29
+ </div>
30
+
31
+ <article>
32
+ <h2>PHP mode</h2>
33
+ <form><textarea id="code" name="code">
34
+ <?php
35
+ $a = array('a' => 1, 'b' => 2, 3 => 'c');
36
+
37
+ echo "$a[a] ${a[3] /* } comment */} {$a[b]} \$a[a]";
38
+
39
+ function hello($who) {
40
+ return "Hello $who!";
41
+ }
42
+ ?>
43
+ <p>The program says <?= hello("World") ?>.</p>
44
+ <script>
45
+ alert("And here is some JS code"); // also colored
46
+ </script>
47
+ </textarea></form>
48
+
49
+ <script>
50
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
51
+ lineNumbers: true,
52
+ matchBrackets: true,
53
+ mode: "application/x-httpd-php",
54
+ indentUnit: 4,
55
+ indentWithTabs: true
56
+ });
57
+ </script>
58
+
59
+ <p>Simple HTML/PHP mode based on
60
+ the <a href="../clike/">C-like</a> mode. Depends on XML,
61
+ JavaScript, CSS, HTMLMixed, and C-like modes.</p>
62
+
63
+ <p><strong>MIME types defined:</strong> <code>application/x-httpd-php</code> (HTML with PHP code), <code>text/x-php</code> (plain, non-wrapped PHP code).</p>
64
+ </article>
@@ -0,0 +1,234 @@
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"), require("../htmlmixed/htmlmixed"), require("../clike/clike"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ function keywords(str) {
15
+ var obj = {}, words = str.split(" ");
16
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
17
+ return obj;
18
+ }
19
+
20
+ // Helper for phpString
21
+ function matchSequence(list, end, escapes) {
22
+ if (list.length == 0) return phpString(end);
23
+ return function (stream, state) {
24
+ var patterns = list[0];
25
+ for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) {
26
+ state.tokenize = matchSequence(list.slice(1), end);
27
+ return patterns[i][1];
28
+ }
29
+ state.tokenize = phpString(end, escapes);
30
+ return "string";
31
+ };
32
+ }
33
+ function phpString(closing, escapes) {
34
+ return function(stream, state) { return phpString_(stream, state, closing, escapes); };
35
+ }
36
+ function phpString_(stream, state, closing, escapes) {
37
+ // "Complex" syntax
38
+ if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) {
39
+ state.tokenize = null;
40
+ return "string";
41
+ }
42
+
43
+ // Simple syntax
44
+ if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
45
+ // After the variable name there may appear array or object operator.
46
+ if (stream.match("[", false)) {
47
+ // Match array operator
48
+ state.tokenize = matchSequence([
49
+ [["[", null]],
50
+ [[/\d[\w\.]*/, "number"],
51
+ [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
52
+ [/[\w\$]+/, "variable"]],
53
+ [["]", null]]
54
+ ], closing, escapes);
55
+ }
56
+ if (stream.match(/\-\>\w/, false)) {
57
+ // Match object operator
58
+ state.tokenize = matchSequence([
59
+ [["->", null]],
60
+ [[/[\w]+/, "variable"]]
61
+ ], closing, escapes);
62
+ }
63
+ return "variable-2";
64
+ }
65
+
66
+ var escaped = false;
67
+ // Normal string
68
+ while (!stream.eol() &&
69
+ (escaped || escapes === false ||
70
+ (!stream.match("{$", false) &&
71
+ !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) {
72
+ if (!escaped && stream.match(closing)) {
73
+ state.tokenize = null;
74
+ state.tokStack.pop(); state.tokStack.pop();
75
+ break;
76
+ }
77
+ escaped = stream.next() == "\\" && !escaped;
78
+ }
79
+ return "string";
80
+ }
81
+
82
+ var phpKeywords = "abstract and array as break case catch class clone const continue declare default " +
83
+ "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " +
84
+ "for foreach function global goto if implements interface instanceof namespace " +
85
+ "new or private protected public static switch throw trait try use var while xor " +
86
+ "die echo empty exit eval include include_once isset list require require_once return " +
87
+ "print unset __halt_compiler self static parent yield insteadof finally";
88
+ var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";
89
+ var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
90
+ CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" "));
91
+ CodeMirror.registerHelper("wordChars", "php", /[\w$]/);
92
+
93
+ var phpConfig = {
94
+ name: "clike",
95
+ helperType: "php",
96
+ keywords: keywords(phpKeywords),
97
+ blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
98
+ defKeywords: keywords("class function interface namespace trait"),
99
+ atoms: keywords(phpAtoms),
100
+ builtin: keywords(phpBuiltin),
101
+ multiLineStrings: true,
102
+ hooks: {
103
+ "$": function(stream) {
104
+ stream.eatWhile(/[\w\$_]/);
105
+ return "variable-2";
106
+ },
107
+ "<": function(stream, state) {
108
+ var before;
109
+ if (before = stream.match(/<<\s*/)) {
110
+ var quoted = stream.eat(/['"]/);
111
+ stream.eatWhile(/[\w\.]/);
112
+ var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));
113
+ if (quoted) stream.eat(quoted);
114
+ if (delim) {
115
+ (state.tokStack || (state.tokStack = [])).push(delim, 0);
116
+ state.tokenize = phpString(delim, quoted != "'");
117
+ return "string";
118
+ }
119
+ }
120
+ return false;
121
+ },
122
+ "#": function(stream) {
123
+ while (!stream.eol() && !stream.match("?>", false)) stream.next();
124
+ return "comment";
125
+ },
126
+ "/": function(stream) {
127
+ if (stream.eat("/")) {
128
+ while (!stream.eol() && !stream.match("?>", false)) stream.next();
129
+ return "comment";
130
+ }
131
+ return false;
132
+ },
133
+ '"': function(_stream, state) {
134
+ (state.tokStack || (state.tokStack = [])).push('"', 0);
135
+ state.tokenize = phpString('"');
136
+ return "string";
137
+ },
138
+ "{": function(_stream, state) {
139
+ if (state.tokStack && state.tokStack.length)
140
+ state.tokStack[state.tokStack.length - 1]++;
141
+ return false;
142
+ },
143
+ "}": function(_stream, state) {
144
+ if (state.tokStack && state.tokStack.length > 0 &&
145
+ !--state.tokStack[state.tokStack.length - 1]) {
146
+ state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]);
147
+ }
148
+ return false;
149
+ }
150
+ }
151
+ };
152
+
153
+ CodeMirror.defineMode("php", function(config, parserConfig) {
154
+ var htmlMode = CodeMirror.getMode(config, "text/html");
155
+ var phpMode = CodeMirror.getMode(config, phpConfig);
156
+
157
+ function dispatch(stream, state) {
158
+ var isPHP = state.curMode == phpMode;
159
+ if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null;
160
+ if (!isPHP) {
161
+ if (stream.match(/^<\?\w*/)) {
162
+ state.curMode = phpMode;
163
+ if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, ""))
164
+ state.curState = state.php;
165
+ return "meta";
166
+ }
167
+ if (state.pending == '"' || state.pending == "'") {
168
+ while (!stream.eol() && stream.next() != state.pending) {}
169
+ var style = "string";
170
+ } else if (state.pending && stream.pos < state.pending.end) {
171
+ stream.pos = state.pending.end;
172
+ var style = state.pending.style;
173
+ } else {
174
+ var style = htmlMode.token(stream, state.curState);
175
+ }
176
+ if (state.pending) state.pending = null;
177
+ var cur = stream.current(), openPHP = cur.search(/<\?/), m;
178
+ if (openPHP != -1) {
179
+ if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0];
180
+ else state.pending = {end: stream.pos, style: style};
181
+ stream.backUp(cur.length - openPHP);
182
+ }
183
+ return style;
184
+ } else if (isPHP && state.php.tokenize == null && stream.match("?>")) {
185
+ state.curMode = htmlMode;
186
+ state.curState = state.html;
187
+ if (!state.php.context.prev) state.php = null;
188
+ return "meta";
189
+ } else {
190
+ return phpMode.token(stream, state.curState);
191
+ }
192
+ }
193
+
194
+ return {
195
+ startState: function() {
196
+ var html = CodeMirror.startState(htmlMode)
197
+ var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null
198
+ return {html: html,
199
+ php: php,
200
+ curMode: parserConfig.startOpen ? phpMode : htmlMode,
201
+ curState: parserConfig.startOpen ? php : html,
202
+ pending: null};
203
+ },
204
+
205
+ copyState: function(state) {
206
+ var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html),
207
+ php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur;
208
+ if (state.curMode == htmlMode) cur = htmlNew;
209
+ else cur = phpNew;
210
+ return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur,
211
+ pending: state.pending};
212
+ },
213
+
214
+ token: dispatch,
215
+
216
+ indent: function(state, textAfter) {
217
+ if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) ||
218
+ (state.curMode == phpMode && /^\?>/.test(textAfter)))
219
+ return htmlMode.indent(state.html, textAfter);
220
+ return state.curMode.indent(state.curState, textAfter);
221
+ },
222
+
223
+ blockCommentStart: "/*",
224
+ blockCommentEnd: "*/",
225
+ lineComment: "//",
226
+
227
+ innerMode: function(state) { return {state: state.curState, mode: state.curMode}; }
228
+ };
229
+ }, "htmlmixed", "clike");
230
+
231
+ CodeMirror.defineMIME("application/x-httpd-php", "php");
232
+ CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true});
233
+ CodeMirror.defineMIME("text/x-php", phpConfig);
234
+ });