elabs 4.0.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +9 -0
  3. data/.node-version +1 -1
  4. data/.rubocop.yml +4 -0
  5. data/.stylelintrc.yml +12 -2
  6. data/CHANGELOG.md +81 -12
  7. data/Gemfile +1 -1
  8. data/Gemfile.lock +96 -94
  9. data/README.md +2 -0
  10. data/ROADMAP.md +4 -2
  11. data/app/assets/config/elabs_manifest.js +2 -1
  12. data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.eot +0 -0
  13. data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.svg +1148 -0
  14. data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.ttf +0 -0
  15. data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.woff +0 -0
  16. data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.woff2 +0 -0
  17. data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.eot +0 -0
  18. data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.svg +467 -0
  19. data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.ttf +0 -0
  20. data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.woff +0 -0
  21. data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.woff2 +0 -0
  22. data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.eot +0 -0
  23. data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.svg +2231 -0
  24. data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.ttf +0 -0
  25. data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.woff +0 -0
  26. data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.woff2 +0 -0
  27. data/app/assets/fonts/elabs/OpenSans/Apache License.txt +201 -0
  28. data/app/assets/fonts/elabs/OpenSans/OpenSans-Bold.ttf +0 -0
  29. data/app/assets/fonts/elabs/OpenSans/OpenSans-Light.ttf +0 -0
  30. data/app/assets/fonts/elabs/OpenSans/OpenSans-Regular.ttf +0 -0
  31. data/app/assets/fonts/elabs/OpenSans/OpenSans-Semibold.ttf +0 -0
  32. data/app/assets/fonts/elabs/license-icons/license-icons.eot +0 -0
  33. data/app/assets/fonts/elabs/license-icons/license-icons.svg +51 -0
  34. data/app/assets/fonts/elabs/license-icons/license-icons.ttf +0 -0
  35. data/app/assets/fonts/elabs/license-icons/license-icons.woff +0 -0
  36. data/app/assets/fonts/elabs/license-icons/license-icons.woff2 +0 -0
  37. data/app/assets/images/elabs/preview_placeholder.png +0 -0
  38. data/app/assets/images/elabs/preview_placeholder_nsfw.png +0 -0
  39. data/app/assets/javascripts/elabs/announcements.js +33 -0
  40. data/app/assets/javascripts/elabs/application.js.erb +17 -14
  41. data/app/assets/javascripts/elabs/forms.js +0 -1
  42. data/app/assets/javascripts/elabs/helpers-markdown.js +2 -2
  43. data/app/assets/javascripts/elabs/helpers.js +17 -0
  44. data/app/assets/javascripts/elabs/menu.js +5 -0
  45. data/app/assets/stylesheets/elabs/_fonts.scss +32 -0
  46. data/app/assets/stylesheets/elabs/_variables.scss +286 -5
  47. data/app/assets/stylesheets/elabs/app/components/_act.scss +83 -0
  48. data/app/assets/stylesheets/elabs/app/components/_announcement.scss +41 -0
  49. data/app/assets/stylesheets/elabs/app/components/_classifier_types.scss +43 -0
  50. data/app/assets/stylesheets/elabs/app/components/_comment.scss +29 -0
  51. data/app/assets/stylesheets/elabs/app/components/_content_relations.scss +53 -0
  52. data/app/assets/stylesheets/elabs/app/components/_content_statuses.scss +39 -0
  53. data/app/assets/stylesheets/elabs/app/components/_content_types.scss +41 -0
  54. data/app/assets/stylesheets/elabs/app/components/_git_cards.scss +122 -0
  55. data/app/assets/stylesheets/elabs/app/elements/_alerts.scss +3 -0
  56. data/app/assets/stylesheets/elabs/app/elements/_badges.scss +17 -0
  57. data/app/assets/stylesheets/elabs/app/elements/_buttons.scss +34 -0
  58. data/app/assets/stylesheets/elabs/app/elements/_dropdowns.scss +78 -0
  59. data/app/assets/stylesheets/elabs/app/elements/_empty.scss +31 -0
  60. data/app/assets/stylesheets/elabs/app/elements/_errors.scss +15 -0
  61. data/app/assets/stylesheets/elabs/app/elements/_filter_link.scss +23 -0
  62. data/app/assets/stylesheets/elabs/app/elements/_fixed_links.scss +19 -0
  63. data/app/assets/stylesheets/elabs/app/elements/_forms.scss +123 -0
  64. data/app/assets/stylesheets/elabs/app/elements/_icons.scss +74 -0
  65. data/app/assets/stylesheets/elabs/app/{_medias.scss → elements/_medias.scss} +2 -0
  66. data/app/assets/stylesheets/elabs/app/{_modals.scss → elements/_modals.scss} +8 -4
  67. data/app/assets/stylesheets/elabs/app/elements/_nsfw.scss +41 -0
  68. data/app/assets/stylesheets/elabs/app/{_pagination.scss → elements/_pagination.scss} +0 -0
  69. data/app/assets/stylesheets/elabs/app/{_tables.scss → elements/_tables.scss} +2 -2
  70. data/app/assets/stylesheets/elabs/app/elements/_tabs.scss +73 -0
  71. data/app/assets/stylesheets/elabs/app/helpers/_cards.scss +80 -0
  72. data/app/assets/stylesheets/elabs/app/helpers/_containers.scss +7 -0
  73. data/app/assets/stylesheets/elabs/app/helpers/_states.scss +3 -0
  74. data/app/assets/stylesheets/elabs/app/{_helpers.scss → helpers/_typo.scss} +6 -4
  75. data/app/assets/stylesheets/elabs/app/layouts/_acts.scss +25 -0
  76. data/app/assets/stylesheets/elabs/app/layouts/_classifiers.scss +32 -0
  77. data/app/assets/stylesheets/elabs/app/{_comments.scss → layouts/_comments.scss} +0 -2
  78. data/app/assets/stylesheets/elabs/app/layouts/_devise.scss +65 -0
  79. data/app/assets/stylesheets/elabs/app/layouts/_layout.scss +40 -0
  80. data/app/assets/stylesheets/elabs/app/layouts/_page.scss +14 -0
  81. data/app/assets/stylesheets/elabs/app/layouts/_page_content.scss +13 -0
  82. data/app/assets/stylesheets/elabs/app/layouts/_page_footer.scss +20 -0
  83. data/app/assets/stylesheets/elabs/app/layouts/_page_header.scss +146 -0
  84. data/app/assets/stylesheets/elabs/app/layouts/_page_menu.scss +232 -0
  85. data/app/assets/stylesheets/elabs/app/layouts/_page_messages.scss +4 -0
  86. data/app/assets/stylesheets/elabs/app/layouts/_private_layout.scss +78 -0
  87. data/app/assets/stylesheets/elabs/app/{_typo.scss → layouts/_typo.scss} +3 -0
  88. data/app/assets/stylesheets/elabs/app/mixins/_classifier_card.scss +43 -0
  89. data/app/assets/stylesheets/elabs/app/mixins/_content_card.scss +103 -0
  90. data/app/assets/stylesheets/elabs/app/mixins/_content_full.scss +158 -0
  91. data/app/assets/stylesheets/elabs/app/mixins/{_content-inline.scss → _content_inline.scss} +0 -0
  92. data/app/assets/stylesheets/elabs/lib/_codemirror.scss +2 -2
  93. data/app/assets/stylesheets/elabs/{_colors.scss → lib/_colors_reference.scss} +0 -52
  94. data/app/assets/stylesheets/elabs/lib/_license_icons.scss +121 -0
  95. data/app/assets/stylesheets/elabs/lib/fontawesome/_fontawesome.scss +1 -1
  96. data/app/assets/stylesheets/elabs/lib/fontawesome/_fonts.scss +18 -18
  97. data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +1 -1
  98. data/app/assets/stylesheets/elabs/lib/knacss/_knacss_variables.scss +227 -0
  99. data/app/assets/stylesheets/elabs/style.scss +62 -57
  100. data/app/controllers/elabs/admin/admin_application_controller.rb +1 -1
  101. data/app/controllers/elabs/admin/announcements_controller.rb +71 -0
  102. data/app/controllers/elabs/concerns/elabs_controller.rb +3 -0
  103. data/app/controllers/elabs/content_application_controller.rb +4 -0
  104. data/app/controllers/elabs/elabs_public_controller.rb +15 -0
  105. data/app/controllers/elabs/languages_controller.rb +1 -5
  106. data/app/controllers/elabs/member/comments_controller.rb +42 -0
  107. data/app/controllers/elabs/member/member_application_controller.rb +1 -1
  108. data/app/controllers/elabs/reports_controller.rb +2 -0
  109. data/app/helpers/elabs/acts_helper.rb +7 -2
  110. data/app/helpers/elabs/application_helper.rb +8 -50
  111. data/app/helpers/elabs/content_filters_helper.rb +17 -24
  112. data/app/helpers/elabs/content_helper.rb +8 -35
  113. data/app/helpers/elabs/content_renderer_helper.rb +4 -112
  114. data/app/helpers/elabs/form_helper.rb +11 -11
  115. data/app/helpers/elabs/icons_helper.rb +63 -0
  116. data/app/helpers/elabs/{admin_content_helper.rb → links_admin_helper.rb} +1 -1
  117. data/app/helpers/elabs/links_helper.rb +58 -0
  118. data/app/helpers/elabs/{member_content_helper.rb → links_member_helper.rb} +2 -2
  119. data/app/helpers/elabs/notification_helper.rb +17 -3
  120. data/app/helpers/elabs/shortcodes_helper.rb +108 -0
  121. data/app/helpers/elabs/thumbnails_helper.rb +1 -1
  122. data/app/models/elabs/album.rb +14 -0
  123. data/app/models/elabs/announcement.rb +33 -0
  124. data/app/models/elabs/article.rb +14 -0
  125. data/app/models/elabs/comment.rb +10 -4
  126. data/app/models/elabs/note.rb +14 -0
  127. data/app/models/elabs/project.rb +12 -0
  128. data/app/models/elabs/report.rb +1 -0
  129. data/app/models/elabs/upload.rb +16 -0
  130. data/app/models/elabs/user.rb +2 -1
  131. data/app/views/elabs/acts/_filters.html.haml +3 -2
  132. data/app/views/elabs/acts/index.html.haml +2 -13
  133. data/app/views/elabs/admin/announcements/_announcement.json.jbuilder +10 -0
  134. data/app/views/elabs/admin/announcements/_form.html.haml +52 -0
  135. data/app/views/elabs/admin/announcements/edit.html.haml +3 -0
  136. data/app/views/elabs/admin/announcements/index.html.haml +28 -0
  137. data/app/views/elabs/admin/announcements/index.json.jbuilder +1 -0
  138. data/app/views/elabs/admin/announcements/new.html.haml +3 -0
  139. data/app/views/elabs/admin/licenses/index.html.haml +2 -2
  140. data/app/views/elabs/admin/uploads/_upload.json.jbuilder +3 -3
  141. data/app/views/elabs/albums/_card_content.html.haml +8 -0
  142. data/app/views/elabs/albums/_filters.html.haml +5 -3
  143. data/app/views/elabs/albums/index.html.haml +1 -1
  144. data/app/views/elabs/albums/show.html.haml +38 -29
  145. data/app/views/elabs/articles/_filters.html.haml +5 -3
  146. data/app/views/elabs/articles/index.html.haml +1 -1
  147. data/app/views/elabs/articles/show.html.haml +33 -25
  148. data/app/views/elabs/auth/confirmations/new.html.haml +1 -1
  149. data/app/views/elabs/auth/passwords/edit.html.haml +1 -1
  150. data/app/views/elabs/auth/passwords/new.html.haml +1 -1
  151. data/app/views/elabs/auth/registrations/new.html.haml +7 -2
  152. data/app/views/elabs/auth/sessions/_new.html.haml +1 -1
  153. data/app/views/elabs/auth/unlocks/new.html.haml +1 -1
  154. data/app/views/elabs/comments/_comments.html.haml +29 -20
  155. data/app/views/elabs/comments/_form.html.haml +40 -36
  156. data/app/views/elabs/languages/_filters.html.haml +3 -5
  157. data/app/views/elabs/languages/index.html.haml +12 -13
  158. data/app/views/elabs/languages/show.html.haml +36 -31
  159. data/app/views/elabs/layouts/_announcements.html.haml +9 -0
  160. data/app/views/elabs/layouts/_content_associations.html.haml +89 -0
  161. data/app/views/elabs/layouts/_content_card.html.haml +41 -0
  162. data/app/views/elabs/layouts/_flash_messages.html.haml +4 -0
  163. data/app/views/elabs/layouts/_footer.html.haml +18 -10
  164. data/app/views/elabs/layouts/_form_honeypot.html.haml +12 -0
  165. data/app/views/elabs/layouts/_hidden_entry.html.haml +1 -1
  166. data/app/views/elabs/layouts/_hidden_entry_full.html.haml +4 -2
  167. data/app/views/elabs/layouts/_hidden_entry_inline.html.haml +1 -1
  168. data/app/views/elabs/layouts/_language_menu.html.haml +2 -2
  169. data/app/views/elabs/layouts/_menu.html.haml +58 -75
  170. data/app/views/elabs/layouts/_menu_admin.html.haml +40 -0
  171. data/app/views/elabs/layouts/_menu_member.html.haml +57 -0
  172. data/app/views/elabs/layouts/application.html.haml +24 -13
  173. data/app/views/elabs/layouts/application_admin.html.haml +33 -0
  174. data/app/views/elabs/layouts/application_member.html.haml +36 -0
  175. data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_albums.html.haml +0 -0
  176. data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_projects.html.haml +0 -0
  177. data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_tags.html.haml +0 -0
  178. data/app/views/elabs/layouts/{_shortcode_infinite_loop.html.haml → shortcodes/_infinite_loop.html.haml} +1 -1
  179. data/app/views/elabs/layouts/{_shortcode_infinite_loop_inline.html.haml → shortcodes/_infinite_loop_inline.html.haml} +0 -0
  180. data/app/views/elabs/layouts/{_shortcode_missing_content.html.haml → shortcodes/_missing_content.html.haml} +1 -1
  181. data/app/views/elabs/layouts/{_shortcode_missing_content_inline.html.haml → shortcodes/_missing_content_inline.html.haml} +0 -0
  182. data/app/views/elabs/layouts/shortcodes/_open_to_see.html.haml +2 -0
  183. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_repo_card.html.haml +1 -1
  184. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_repo_inline.html.haml +0 -0
  185. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_user_card.html.haml +0 -0
  186. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_group_card.html.haml +1 -1
  187. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_repo_card.html.haml +1 -1
  188. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_repo_inline.html.haml +0 -0
  189. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_user_card.html.haml +1 -1
  190. data/app/views/elabs/layouts/shortcodes/widgets/vue/_all_widgets.html.haml +5 -0
  191. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_github_repo_card_vue.html.haml +8 -8
  192. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_github_user_card_vue.html.haml +5 -5
  193. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_group_card_vue.html.haml +5 -5
  194. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_repo_card_vue.html.haml +8 -8
  195. data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_user_card_vue.html.haml +4 -4
  196. data/app/views/elabs/licenses/_filters.html.haml +3 -2
  197. data/app/views/elabs/licenses/index.html.haml +14 -12
  198. data/app/views/elabs/licenses/show.html.haml +40 -34
  199. data/app/views/elabs/member/albums/_form.html.haml +1 -43
  200. data/app/views/elabs/member/articles/_form.html.haml +1 -39
  201. data/app/views/elabs/member/layouts/_form_commons.html.haml +55 -0
  202. data/app/views/elabs/member/notes/_form.html.haml +1 -39
  203. data/app/views/elabs/member/preferences/edit.html.haml +1 -2
  204. data/app/views/elabs/member/projects/_form.html.haml +3 -38
  205. data/app/views/elabs/member/uploads/_form.html.haml +1 -42
  206. data/app/views/elabs/member/uploads/_upload.json.jbuilder +3 -3
  207. data/app/views/elabs/member/users/edit.html.haml +3 -4
  208. data/app/views/elabs/notes/_filters.html.haml +5 -3
  209. data/app/views/elabs/notes/index.html.haml +1 -1
  210. data/app/views/elabs/notes/show.html.haml +33 -25
  211. data/app/views/elabs/projects/_filters.html.haml +5 -3
  212. data/app/views/elabs/projects/index.html.haml +1 -1
  213. data/app/views/elabs/projects/show.html.haml +68 -62
  214. data/app/views/elabs/reports/_form.html.haml +2 -0
  215. data/app/views/elabs/tags/_filters.html.haml +3 -2
  216. data/app/views/elabs/tags/index.html.haml +11 -11
  217. data/app/views/elabs/tags/show.html.haml +31 -28
  218. data/app/views/elabs/uploads/_filters.html.haml +5 -3
  219. data/app/views/elabs/uploads/_preview.html.haml +5 -4
  220. data/app/views/elabs/uploads/_thumbnail.html.haml +9 -0
  221. data/app/views/elabs/uploads/_upload.json.jbuilder +3 -3
  222. data/app/views/elabs/uploads/index.html.haml +1 -1
  223. data/app/views/elabs/uploads/show.html.haml +45 -39
  224. data/app/views/elabs/users/_filters.html.haml +3 -2
  225. data/app/views/elabs/users/_user.html.haml +3 -3
  226. data/app/views/elabs/users/show.html.haml +48 -43
  227. data/config/routes.rb +13 -8
  228. data/db/migrate/20181025084232_add_archived_field_to_comments.rb +5 -0
  229. data/db/migrate/20181026071743_delete_comment_notifications.rb +5 -0
  230. data/db/migrate/20181030063505_create_announcements.rb +14 -0
  231. data/docs/CODEOWNERS +10 -0
  232. data/docs/migrating.md +16 -1
  233. data/docs/shortcodes_guide.md +51 -0
  234. data/lib/assets/javascripts/README-highlight.js.md +5 -5
  235. data/lib/assets/javascripts/highlight.js-9.13.1/highlight.pack.js +2 -0
  236. data/lib/assets/stylesheets/{highlight.js-9.12.0 → highlight.js-9.13.1}/styles/atelier-sulphurpool-light.css +0 -0
  237. data/lib/elabs.rb +8 -0
  238. data/lib/elabs/version.rb +1 -1
  239. data/lib/generators/elabs/{devise_views_generator.rb → devise_mailer_views_generator.rb} +2 -2
  240. data/lib/generators/elabs/images_generator.rb +24 -0
  241. data/lib/generators/elabs/required_assets_generator.rb +0 -2
  242. data/lib/generators/templates/elabs.rb +3 -0
  243. data/locale/app.pot +132 -19
  244. data/locale/en/app.edit.po +130 -17
  245. data/locale/en/app.po +130 -17
  246. data/locale/fr/app.edit.po +145 -28
  247. data/locale/fr/app.po +141 -27
  248. data/package.json +10 -12
  249. data/yarn.lock +885 -668
  250. metadata +136 -97
  251. data/app/assets/stylesheets/elabs/_icons.scss +0 -17
  252. data/app/assets/stylesheets/elabs/app/_acts.scss +0 -69
  253. data/app/assets/stylesheets/elabs/app/_alerts.scss +0 -3
  254. data/app/assets/stylesheets/elabs/app/_badges.scss +0 -11
  255. data/app/assets/stylesheets/elabs/app/_buttons.scss +0 -29
  256. data/app/assets/stylesheets/elabs/app/_content.scss +0 -25
  257. data/app/assets/stylesheets/elabs/app/_content_statuses.scss +0 -32
  258. data/app/assets/stylesheets/elabs/app/_content_uploads.scss +0 -39
  259. data/app/assets/stylesheets/elabs/app/_empty.scss +0 -19
  260. data/app/assets/stylesheets/elabs/app/_errors.scss +0 -9
  261. data/app/assets/stylesheets/elabs/app/_filter_links.scss +0 -27
  262. data/app/assets/stylesheets/elabs/app/_forms.scss +0 -74
  263. data/app/assets/stylesheets/elabs/app/_languages.scss +0 -6
  264. data/app/assets/stylesheets/elabs/app/_layout.scss +0 -206
  265. data/app/assets/stylesheets/elabs/app/_licenses.scss +0 -6
  266. data/app/assets/stylesheets/elabs/app/_link-to-top.scss +0 -8
  267. data/app/assets/stylesheets/elabs/app/_tabs.scss +0 -54
  268. data/app/assets/stylesheets/elabs/app/_tags.scss +0 -6
  269. data/app/assets/stylesheets/elabs/app/_toolbars.scss +0 -3
  270. data/app/assets/stylesheets/elabs/app/_users.scss +0 -21
  271. data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +0 -13
  272. data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +0 -46
  273. data/app/assets/stylesheets/elabs/app/admin-members/_layout.scss +0 -17
  274. data/app/assets/stylesheets/elabs/app/areas/_devise.scss +0 -31
  275. data/app/assets/stylesheets/elabs/app/components/_cards.scss +0 -16
  276. data/app/assets/stylesheets/elabs/app/components/_container.scss +0 -4
  277. data/app/assets/stylesheets/elabs/app/mixins/_classifier-card.scss +0 -16
  278. data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +0 -72
  279. data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +0 -77
  280. data/app/assets/stylesheets/elabs/app/widgets/_git-cards.scss +0 -88
  281. data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +0 -1118
  282. data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +0 -239
  283. data/app/views/elabs/albums/_album.html.haml +0 -38
  284. data/app/views/elabs/articles/_article.html.haml +0 -30
  285. data/app/views/elabs/languages/_associations.html.haml +0 -61
  286. data/app/views/elabs/layouts/_shortcode_open_to_see.html.haml +0 -2
  287. data/app/views/elabs/layouts/admin_application.html.haml +0 -21
  288. data/app/views/elabs/layouts/member_application.html.haml +0 -24
  289. data/app/views/elabs/layouts/widgets/vue/_all_widgets.html.haml +0 -5
  290. data/app/views/elabs/licenses/_associations.html.haml +0 -61
  291. data/app/views/elabs/notes/_note.html.haml +0 -31
  292. data/app/views/elabs/projects/_associations.html.haml +0 -54
  293. data/app/views/elabs/projects/_project.html.haml +0 -29
  294. data/app/views/elabs/tags/_associations.html.haml +0 -61
  295. data/app/views/elabs/uploads/_upload.html.haml +0 -41
  296. data/app/views/elabs/users/_associations.html.haml +0 -61
  297. data/db/seeds.rb +0 -10
  298. data/db/seeds_development.rb +0 -21
  299. data/db/seeds_production.rb +0 -0
  300. data/lib/assets/javascripts/codemirror-5.39.2/addon/mode/overlay.js +0 -90
  301. data/lib/assets/javascripts/codemirror-5.39.2/lib/codemirror.js +0 -9684
  302. data/lib/assets/javascripts/codemirror-5.39.2/mode/clike/clike.js +0 -834
  303. data/lib/assets/javascripts/codemirror-5.39.2/mode/css/css.js +0 -832
  304. data/lib/assets/javascripts/codemirror-5.39.2/mode/gfm/gfm.js +0 -129
  305. data/lib/assets/javascripts/codemirror-5.39.2/mode/htmlmixed/htmlmixed.js +0 -152
  306. data/lib/assets/javascripts/codemirror-5.39.2/mode/javascript/javascript.js +0 -896
  307. data/lib/assets/javascripts/codemirror-5.39.2/mode/markdown/markdown.js +0 -882
  308. data/lib/assets/javascripts/codemirror-5.39.2/mode/meta.js +0 -217
  309. data/lib/assets/javascripts/codemirror-5.39.2/mode/xml/xml.js +0 -402
  310. data/lib/assets/javascripts/highlight.js-9.12.0/highlight.pack.js +0 -2
  311. data/lib/assets/stylesheets/codemirror-5.39.2/lib/codemirror.css +0 -346
  312. data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-dark.css +0 -38
  313. data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-light.css +0 -38
@@ -1,834 +0,0 @@
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
- function Context(indented, column, type, info, align, prev) {
15
- this.indented = indented;
16
- this.column = column;
17
- this.type = type;
18
- this.info = info;
19
- this.align = align;
20
- this.prev = prev;
21
- }
22
- function pushContext(state, col, type, info) {
23
- var indent = state.indented;
24
- if (state.context && state.context.type == "statement" && type != "statement")
25
- indent = state.context.indented;
26
- return state.context = new Context(indent, col, type, info, null, state.context);
27
- }
28
- function popContext(state) {
29
- var t = state.context.type;
30
- if (t == ")" || t == "]" || t == "}")
31
- state.indented = state.context.indented;
32
- return state.context = state.context.prev;
33
- }
34
-
35
- function typeBefore(stream, state, pos) {
36
- if (state.prevToken == "variable" || state.prevToken == "type") return true;
37
- if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
38
- if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
39
- }
40
-
41
- function isTopScope(context) {
42
- for (;;) {
43
- if (!context || context.type == "top") return true;
44
- if (context.type == "}" && context.prev.info != "namespace") return false;
45
- context = context.prev;
46
- }
47
- }
48
-
49
- CodeMirror.defineMode("clike", function(config, parserConfig) {
50
- var indentUnit = config.indentUnit,
51
- statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
52
- dontAlignCalls = parserConfig.dontAlignCalls,
53
- keywords = parserConfig.keywords || {},
54
- types = parserConfig.types || {},
55
- builtin = parserConfig.builtin || {},
56
- blockKeywords = parserConfig.blockKeywords || {},
57
- defKeywords = parserConfig.defKeywords || {},
58
- atoms = parserConfig.atoms || {},
59
- hooks = parserConfig.hooks || {},
60
- multiLineStrings = parserConfig.multiLineStrings,
61
- indentStatements = parserConfig.indentStatements !== false,
62
- indentSwitch = parserConfig.indentSwitch !== false,
63
- namespaceSeparator = parserConfig.namespaceSeparator,
64
- isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
65
- numberStart = parserConfig.numberStart || /[\d\.]/,
66
- number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
67
- isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
68
- isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/;
69
-
70
- var curPunc, isDefKeyword;
71
-
72
- function tokenBase(stream, state) {
73
- var ch = stream.next();
74
- if (hooks[ch]) {
75
- var result = hooks[ch](stream, state);
76
- if (result !== false) return result;
77
- }
78
- if (ch == '"' || ch == "'") {
79
- state.tokenize = tokenString(ch);
80
- return state.tokenize(stream, state);
81
- }
82
- if (isPunctuationChar.test(ch)) {
83
- curPunc = ch;
84
- return null;
85
- }
86
- if (numberStart.test(ch)) {
87
- stream.backUp(1)
88
- if (stream.match(number)) return "number"
89
- stream.next()
90
- }
91
- if (ch == "/") {
92
- if (stream.eat("*")) {
93
- state.tokenize = tokenComment;
94
- return tokenComment(stream, state);
95
- }
96
- if (stream.eat("/")) {
97
- stream.skipToEnd();
98
- return "comment";
99
- }
100
- }
101
- if (isOperatorChar.test(ch)) {
102
- while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
103
- return "operator";
104
- }
105
- stream.eatWhile(isIdentifierChar);
106
- if (namespaceSeparator) while (stream.match(namespaceSeparator))
107
- stream.eatWhile(isIdentifierChar);
108
-
109
- var cur = stream.current();
110
- if (contains(keywords, cur)) {
111
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
112
- if (contains(defKeywords, cur)) isDefKeyword = true;
113
- return "keyword";
114
- }
115
- if (contains(types, cur)) return "type";
116
- if (contains(builtin, cur)) {
117
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
118
- return "builtin";
119
- }
120
- if (contains(atoms, cur)) return "atom";
121
- return "variable";
122
- }
123
-
124
- function tokenString(quote) {
125
- return function(stream, state) {
126
- var escaped = false, next, end = false;
127
- while ((next = stream.next()) != null) {
128
- if (next == quote && !escaped) {end = true; break;}
129
- escaped = !escaped && next == "\\";
130
- }
131
- if (end || !(escaped || multiLineStrings))
132
- state.tokenize = null;
133
- return "string";
134
- };
135
- }
136
-
137
- function tokenComment(stream, state) {
138
- var maybeEnd = false, ch;
139
- while (ch = stream.next()) {
140
- if (ch == "/" && maybeEnd) {
141
- state.tokenize = null;
142
- break;
143
- }
144
- maybeEnd = (ch == "*");
145
- }
146
- return "comment";
147
- }
148
-
149
- function maybeEOL(stream, state) {
150
- if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
151
- state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)
152
- }
153
-
154
- // Interface
155
-
156
- return {
157
- startState: function(basecolumn) {
158
- return {
159
- tokenize: null,
160
- context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
161
- indented: 0,
162
- startOfLine: true,
163
- prevToken: null
164
- };
165
- },
166
-
167
- token: function(stream, state) {
168
- var ctx = state.context;
169
- if (stream.sol()) {
170
- if (ctx.align == null) ctx.align = false;
171
- state.indented = stream.indentation();
172
- state.startOfLine = true;
173
- }
174
- if (stream.eatSpace()) { maybeEOL(stream, state); return null; }
175
- curPunc = isDefKeyword = null;
176
- var style = (state.tokenize || tokenBase)(stream, state);
177
- if (style == "comment" || style == "meta") return style;
178
- if (ctx.align == null) ctx.align = true;
179
-
180
- if (curPunc == ";" || curPunc == ":" || (curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)))
181
- while (state.context.type == "statement") popContext(state);
182
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
183
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
184
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
185
- else if (curPunc == "}") {
186
- while (ctx.type == "statement") ctx = popContext(state);
187
- if (ctx.type == "}") ctx = popContext(state);
188
- while (ctx.type == "statement") ctx = popContext(state);
189
- }
190
- else if (curPunc == ctx.type) popContext(state);
191
- else if (indentStatements &&
192
- (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
193
- (ctx.type == "statement" && curPunc == "newstatement"))) {
194
- pushContext(state, stream.column(), "statement", stream.current());
195
- }
196
-
197
- if (style == "variable" &&
198
- ((state.prevToken == "def" ||
199
- (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&
200
- isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
201
- style = "def";
202
-
203
- if (hooks.token) {
204
- var result = hooks.token(stream, state, style);
205
- if (result !== undefined) style = result;
206
- }
207
-
208
- if (style == "def" && parserConfig.styleDefs === false) style = "variable";
209
-
210
- state.startOfLine = false;
211
- state.prevToken = isDefKeyword ? "def" : style || curPunc;
212
- maybeEOL(stream, state);
213
- return style;
214
- },
215
-
216
- indent: function(state, textAfter) {
217
- if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
218
- var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
219
- var closing = firstChar == ctx.type;
220
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
221
- if (parserConfig.dontIndentStatements)
222
- while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
223
- ctx = ctx.prev
224
- if (hooks.indent) {
225
- var hook = hooks.indent(state, ctx, textAfter, indentUnit);
226
- if (typeof hook == "number") return hook
227
- }
228
- var switchBlock = ctx.prev && ctx.prev.info == "switch";
229
- if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
230
- while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
231
- return ctx.indented
232
- }
233
- if (ctx.type == "statement")
234
- return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
235
- if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
236
- return ctx.column + (closing ? 0 : 1);
237
- if (ctx.type == ")" && !closing)
238
- return ctx.indented + statementIndentUnit;
239
-
240
- return ctx.indented + (closing ? 0 : indentUnit) +
241
- (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
242
- },
243
-
244
- electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
245
- blockCommentStart: "/*",
246
- blockCommentEnd: "*/",
247
- blockCommentContinue: " * ",
248
- lineComment: "//",
249
- fold: "brace"
250
- };
251
- });
252
-
253
- function words(str) {
254
- var obj = {}, words = str.split(" ");
255
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
256
- return obj;
257
- }
258
- function contains(words, word) {
259
- if (typeof words === "function") {
260
- return words(word);
261
- } else {
262
- return words.propertyIsEnumerable(word);
263
- }
264
- }
265
- var cKeywords = "auto if break case register continue return default do sizeof " +
266
- "static else struct switch extern typedef union for goto while enum const volatile";
267
- var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
268
-
269
- function cppHook(stream, state) {
270
- if (!state.startOfLine) return false
271
- for (var ch, next = null; ch = stream.peek();) {
272
- if (ch == "\\" && stream.match(/^.$/)) {
273
- next = cppHook
274
- break
275
- } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
276
- break
277
- }
278
- stream.next()
279
- }
280
- state.tokenize = next
281
- return "meta"
282
- }
283
-
284
- function pointerHook(_stream, state) {
285
- if (state.prevToken == "type") return "type";
286
- return false;
287
- }
288
-
289
- function cpp14Literal(stream) {
290
- stream.eatWhile(/[\w\.']/);
291
- return "number";
292
- }
293
-
294
- function cpp11StringHook(stream, state) {
295
- stream.backUp(1);
296
- // Raw strings.
297
- if (stream.match(/(R|u8R|uR|UR|LR)/)) {
298
- var match = stream.match(/"([^\s\\()]{0,16})\(/);
299
- if (!match) {
300
- return false;
301
- }
302
- state.cpp11RawStringDelim = match[1];
303
- state.tokenize = tokenRawString;
304
- return tokenRawString(stream, state);
305
- }
306
- // Unicode strings/chars.
307
- if (stream.match(/(u8|u|U|L)/)) {
308
- if (stream.match(/["']/, /* eat */ false)) {
309
- return "string";
310
- }
311
- return false;
312
- }
313
- // Ignore this hook.
314
- stream.next();
315
- return false;
316
- }
317
-
318
- function cppLooksLikeConstructor(word) {
319
- var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
320
- return lastTwo && lastTwo[1] == lastTwo[2];
321
- }
322
-
323
- // C#-style strings where "" escapes a quote.
324
- function tokenAtString(stream, state) {
325
- var next;
326
- while ((next = stream.next()) != null) {
327
- if (next == '"' && !stream.eat('"')) {
328
- state.tokenize = null;
329
- break;
330
- }
331
- }
332
- return "string";
333
- }
334
-
335
- // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
336
- // <delim> can be a string up to 16 characters long.
337
- function tokenRawString(stream, state) {
338
- // Escape characters that have special regex meanings.
339
- var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
340
- var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
341
- if (match)
342
- state.tokenize = null;
343
- else
344
- stream.skipToEnd();
345
- return "string";
346
- }
347
-
348
- function def(mimes, mode) {
349
- if (typeof mimes == "string") mimes = [mimes];
350
- var words = [];
351
- function add(obj) {
352
- if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
353
- words.push(prop);
354
- }
355
- add(mode.keywords);
356
- add(mode.types);
357
- add(mode.builtin);
358
- add(mode.atoms);
359
- if (words.length) {
360
- mode.helperType = mimes[0];
361
- CodeMirror.registerHelper("hintWords", mimes[0], words);
362
- }
363
-
364
- for (var i = 0; i < mimes.length; ++i)
365
- CodeMirror.defineMIME(mimes[i], mode);
366
- }
367
-
368
- def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
369
- name: "clike",
370
- keywords: words(cKeywords),
371
- types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
372
- "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
373
- "uint32_t uint64_t"),
374
- blockKeywords: words("case do else for if switch while struct"),
375
- defKeywords: words("struct"),
376
- typeFirstDefinitions: true,
377
- atoms: words("NULL true false"),
378
- hooks: {"#": cppHook, "*": pointerHook},
379
- modeProps: {fold: ["brace", "include"]}
380
- });
381
-
382
- def(["text/x-c++src", "text/x-c++hdr"], {
383
- name: "clike",
384
- keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
385
- "static_cast typeid catch operator template typename class friend private " +
386
- "this using const_cast inline public throw virtual delete mutable protected " +
387
- "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
388
- "static_assert override"),
389
- types: words(cTypes + " bool wchar_t"),
390
- blockKeywords: words("catch class do else finally for if struct switch try while"),
391
- defKeywords: words("class namespace struct enum union"),
392
- typeFirstDefinitions: true,
393
- atoms: words("true false NULL"),
394
- dontIndentStatements: /^template$/,
395
- isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
396
- hooks: {
397
- "#": cppHook,
398
- "*": pointerHook,
399
- "u": cpp11StringHook,
400
- "U": cpp11StringHook,
401
- "L": cpp11StringHook,
402
- "R": cpp11StringHook,
403
- "0": cpp14Literal,
404
- "1": cpp14Literal,
405
- "2": cpp14Literal,
406
- "3": cpp14Literal,
407
- "4": cpp14Literal,
408
- "5": cpp14Literal,
409
- "6": cpp14Literal,
410
- "7": cpp14Literal,
411
- "8": cpp14Literal,
412
- "9": cpp14Literal,
413
- token: function(stream, state, style) {
414
- if (style == "variable" && stream.peek() == "(" &&
415
- (state.prevToken == ";" || state.prevToken == null ||
416
- state.prevToken == "}") &&
417
- cppLooksLikeConstructor(stream.current()))
418
- return "def";
419
- }
420
- },
421
- namespaceSeparator: "::",
422
- modeProps: {fold: ["brace", "include"]}
423
- });
424
-
425
- def("text/x-java", {
426
- name: "clike",
427
- keywords: words("abstract assert break case catch class const continue default " +
428
- "do else enum extends final finally float for goto if implements import " +
429
- "instanceof interface native new package private protected public " +
430
- "return static strictfp super switch synchronized this throw throws transient " +
431
- "try volatile while @interface"),
432
- types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
433
- "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
434
- blockKeywords: words("catch class do else finally for if switch try while"),
435
- defKeywords: words("class interface enum @interface"),
436
- typeFirstDefinitions: true,
437
- atoms: words("true false null"),
438
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
439
- hooks: {
440
- "@": function(stream) {
441
- // Don't match the @interface keyword.
442
- if (stream.match('interface', false)) return false;
443
-
444
- stream.eatWhile(/[\w\$_]/);
445
- return "meta";
446
- }
447
- },
448
- modeProps: {fold: ["brace", "import"]}
449
- });
450
-
451
- def("text/x-csharp", {
452
- name: "clike",
453
- keywords: words("abstract as async await base break case catch checked class const continue" +
454
- " default delegate do else enum event explicit extern finally fixed for" +
455
- " foreach goto if implicit in interface internal is lock namespace new" +
456
- " operator out override params private protected public readonly ref return sealed" +
457
- " sizeof stackalloc static struct switch this throw try typeof unchecked" +
458
- " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
459
- " global group into join let orderby partial remove select set value var yield"),
460
- types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
461
- " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
462
- " UInt64 bool byte char decimal double short int long object" +
463
- " sbyte float string ushort uint ulong"),
464
- blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
465
- defKeywords: words("class interface namespace struct var"),
466
- typeFirstDefinitions: true,
467
- atoms: words("true false null"),
468
- hooks: {
469
- "@": function(stream, state) {
470
- if (stream.eat('"')) {
471
- state.tokenize = tokenAtString;
472
- return tokenAtString(stream, state);
473
- }
474
- stream.eatWhile(/[\w\$_]/);
475
- return "meta";
476
- }
477
- }
478
- });
479
-
480
- function tokenTripleString(stream, state) {
481
- var escaped = false;
482
- while (!stream.eol()) {
483
- if (!escaped && stream.match('"""')) {
484
- state.tokenize = null;
485
- break;
486
- }
487
- escaped = stream.next() == "\\" && !escaped;
488
- }
489
- return "string";
490
- }
491
-
492
- function tokenNestedComment(depth) {
493
- return function (stream, state) {
494
- var ch
495
- while (ch = stream.next()) {
496
- if (ch == "*" && stream.eat("/")) {
497
- if (depth == 1) {
498
- state.tokenize = null
499
- break
500
- } else {
501
- state.tokenize = tokenNestedComment(depth - 1)
502
- return state.tokenize(stream, state)
503
- }
504
- } else if (ch == "/" && stream.eat("*")) {
505
- state.tokenize = tokenNestedComment(depth + 1)
506
- return state.tokenize(stream, state)
507
- }
508
- }
509
- return "comment"
510
- }
511
- }
512
-
513
- def("text/x-scala", {
514
- name: "clike",
515
- keywords: words(
516
-
517
- /* scala */
518
- "abstract case catch class def do else extends final finally for forSome if " +
519
- "implicit import lazy match new null object override package private protected return " +
520
- "sealed super this throw trait try type val var while with yield _ " +
521
-
522
- /* package scala */
523
- "assert assume require print println printf readLine readBoolean readByte readShort " +
524
- "readChar readInt readLong readFloat readDouble"
525
- ),
526
- types: words(
527
- "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
528
- "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
529
- "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
530
- "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
531
- "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
532
-
533
- /* package java.lang */
534
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
535
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
536
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
537
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
538
- ),
539
- multiLineStrings: true,
540
- blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
541
- defKeywords: words("class enum def object package trait type val var"),
542
- atoms: words("true false null"),
543
- indentStatements: false,
544
- indentSwitch: false,
545
- isOperatorChar: /[+\-*&%=<>!?|\/#:@]/,
546
- hooks: {
547
- "@": function(stream) {
548
- stream.eatWhile(/[\w\$_]/);
549
- return "meta";
550
- },
551
- '"': function(stream, state) {
552
- if (!stream.match('""')) return false;
553
- state.tokenize = tokenTripleString;
554
- return state.tokenize(stream, state);
555
- },
556
- "'": function(stream) {
557
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
558
- return "atom";
559
- },
560
- "=": function(stream, state) {
561
- var cx = state.context
562
- if (cx.type == "}" && cx.align && stream.eat(">")) {
563
- state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)
564
- return "operator"
565
- } else {
566
- return false
567
- }
568
- },
569
-
570
- "/": function(stream, state) {
571
- if (!stream.eat("*")) return false
572
- state.tokenize = tokenNestedComment(1)
573
- return state.tokenize(stream, state)
574
- }
575
- },
576
- modeProps: {closeBrackets: {triples: '"'}}
577
- });
578
-
579
- function tokenKotlinString(tripleString){
580
- return function (stream, state) {
581
- var escaped = false, next, end = false;
582
- while (!stream.eol()) {
583
- if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
584
- if (tripleString && stream.match('"""')) {end = true; break;}
585
- next = stream.next();
586
- if(!escaped && next == "$" && stream.match('{'))
587
- stream.skipTo("}");
588
- escaped = !escaped && next == "\\" && !tripleString;
589
- }
590
- if (end || !tripleString)
591
- state.tokenize = null;
592
- return "string";
593
- }
594
- }
595
-
596
- def("text/x-kotlin", {
597
- name: "clike",
598
- keywords: words(
599
- /*keywords*/
600
- "package as typealias class interface this super val operator " +
601
- "var fun for is in This throw return annotation " +
602
- "break continue object if else while do try when !in !is as? " +
603
-
604
- /*soft keywords*/
605
- "file import where by get set abstract enum open inner override private public internal " +
606
- "protected catch finally out final vararg reified dynamic companion constructor init " +
607
- "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
608
- "external annotation crossinline const operator infix suspend actual expect setparam"
609
- ),
610
- types: words(
611
- /* package java.lang */
612
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
613
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
614
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
615
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray " +
616
- "ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy " +
617
- "LazyThreadSafetyMode LongArray Nothing ShortArray Unit"
618
- ),
619
- intendSwitch: false,
620
- indentStatements: false,
621
- multiLineStrings: true,
622
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
623
- blockKeywords: words("catch class do else finally for if where try while enum"),
624
- defKeywords: words("class val var object interface fun"),
625
- atoms: words("true false null this"),
626
- hooks: {
627
- "@": function(stream) {
628
- stream.eatWhile(/[\w\$_]/);
629
- return "meta";
630
- },
631
- '"': function(stream, state) {
632
- state.tokenize = tokenKotlinString(stream.match('""'));
633
- return state.tokenize(stream, state);
634
- },
635
- indent: function(state, ctx, textAfter, indentUnit) {
636
- var firstChar = textAfter && textAfter.charAt(0);
637
- if ((state.prevToken == "}" || state.prevToken == ")") && textAfter == "")
638
- return state.indented;
639
- if (state.prevToken == "operator" && textAfter != "}" ||
640
- state.prevToken == "variable" && firstChar == "." ||
641
- (state.prevToken == "}" || state.prevToken == ")") && firstChar == ".")
642
- return indentUnit * 2 + ctx.indented;
643
- if (ctx.align && ctx.type == "}")
644
- return ctx.indented + (state.context.type == (textAfter || "").charAt(0) ? 0 : indentUnit);
645
- }
646
- },
647
- modeProps: {closeBrackets: {triples: '"'}}
648
- });
649
-
650
- def(["x-shader/x-vertex", "x-shader/x-fragment"], {
651
- name: "clike",
652
- keywords: words("sampler1D sampler2D sampler3D samplerCube " +
653
- "sampler1DShadow sampler2DShadow " +
654
- "const attribute uniform varying " +
655
- "break continue discard return " +
656
- "for while do if else struct " +
657
- "in out inout"),
658
- types: words("float int bool void " +
659
- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
660
- "mat2 mat3 mat4"),
661
- blockKeywords: words("for while do if else struct"),
662
- builtin: words("radians degrees sin cos tan asin acos atan " +
663
- "pow exp log exp2 sqrt inversesqrt " +
664
- "abs sign floor ceil fract mod min max clamp mix step smoothstep " +
665
- "length distance dot cross normalize ftransform faceforward " +
666
- "reflect refract matrixCompMult " +
667
- "lessThan lessThanEqual greaterThan greaterThanEqual " +
668
- "equal notEqual any all not " +
669
- "texture1D texture1DProj texture1DLod texture1DProjLod " +
670
- "texture2D texture2DProj texture2DLod texture2DProjLod " +
671
- "texture3D texture3DProj texture3DLod texture3DProjLod " +
672
- "textureCube textureCubeLod " +
673
- "shadow1D shadow2D shadow1DProj shadow2DProj " +
674
- "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
675
- "dFdx dFdy fwidth " +
676
- "noise1 noise2 noise3 noise4"),
677
- atoms: words("true false " +
678
- "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
679
- "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
680
- "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
681
- "gl_FogCoord gl_PointCoord " +
682
- "gl_Position gl_PointSize gl_ClipVertex " +
683
- "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
684
- "gl_TexCoord gl_FogFragCoord " +
685
- "gl_FragCoord gl_FrontFacing " +
686
- "gl_FragData gl_FragDepth " +
687
- "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
688
- "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
689
- "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
690
- "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
691
- "gl_ProjectionMatrixInverseTranspose " +
692
- "gl_ModelViewProjectionMatrixInverseTranspose " +
693
- "gl_TextureMatrixInverseTranspose " +
694
- "gl_NormalScale gl_DepthRange gl_ClipPlane " +
695
- "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
696
- "gl_FrontLightModelProduct gl_BackLightModelProduct " +
697
- "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
698
- "gl_FogParameters " +
699
- "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
700
- "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
701
- "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
702
- "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
703
- "gl_MaxDrawBuffers"),
704
- indentSwitch: false,
705
- hooks: {"#": cppHook},
706
- modeProps: {fold: ["brace", "include"]}
707
- });
708
-
709
- def("text/x-nesc", {
710
- name: "clike",
711
- keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
712
- "implementation includes interface module new norace nx_struct nx_union post provides " +
713
- "signal task uses abstract extends"),
714
- types: words(cTypes),
715
- blockKeywords: words("case do else for if switch while struct"),
716
- atoms: words("null true false"),
717
- hooks: {"#": cppHook},
718
- modeProps: {fold: ["brace", "include"]}
719
- });
720
-
721
- def("text/x-objectivec", {
722
- name: "clike",
723
- keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " +
724
- "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
725
- types: words(cTypes),
726
- atoms: words("YES NO NULL NILL ON OFF true false"),
727
- hooks: {
728
- "@": function(stream) {
729
- stream.eatWhile(/[\w\$]/);
730
- return "keyword";
731
- },
732
- "#": cppHook,
733
- indent: function(_state, ctx, textAfter) {
734
- if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
735
- }
736
- },
737
- modeProps: {fold: "brace"}
738
- });
739
-
740
- def("text/x-squirrel", {
741
- name: "clike",
742
- keywords: words("base break clone continue const default delete enum extends function in class" +
743
- " foreach local resume return this throw typeof yield constructor instanceof static"),
744
- types: words(cTypes),
745
- blockKeywords: words("case catch class else for foreach if switch try while"),
746
- defKeywords: words("function local class"),
747
- typeFirstDefinitions: true,
748
- atoms: words("true false null"),
749
- hooks: {"#": cppHook},
750
- modeProps: {fold: ["brace", "include"]}
751
- });
752
-
753
- // Ceylon Strings need to deal with interpolation
754
- var stringTokenizer = null;
755
- function tokenCeylonString(type) {
756
- return function(stream, state) {
757
- var escaped = false, next, end = false;
758
- while (!stream.eol()) {
759
- if (!escaped && stream.match('"') &&
760
- (type == "single" || stream.match('""'))) {
761
- end = true;
762
- break;
763
- }
764
- if (!escaped && stream.match('``')) {
765
- stringTokenizer = tokenCeylonString(type);
766
- end = true;
767
- break;
768
- }
769
- next = stream.next();
770
- escaped = type == "single" && !escaped && next == "\\";
771
- }
772
- if (end)
773
- state.tokenize = null;
774
- return "string";
775
- }
776
- }
777
-
778
- def("text/x-ceylon", {
779
- name: "clike",
780
- keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
781
- " exists extends finally for function given if import in interface is let module new" +
782
- " nonempty object of out outer package return satisfies super switch then this throw" +
783
- " try value void while"),
784
- types: function(word) {
785
- // In Ceylon all identifiers that start with an uppercase are types
786
- var first = word.charAt(0);
787
- return (first === first.toUpperCase() && first !== first.toLowerCase());
788
- },
789
- blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
790
- defKeywords: words("class dynamic function interface module object package value"),
791
- builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
792
- " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
793
- isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
794
- isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
795
- numberStart: /[\d#$]/,
796
- number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
797
- multiLineStrings: true,
798
- typeFirstDefinitions: true,
799
- atoms: words("true false null larger smaller equal empty finished"),
800
- indentSwitch: false,
801
- styleDefs: false,
802
- hooks: {
803
- "@": function(stream) {
804
- stream.eatWhile(/[\w\$_]/);
805
- return "meta";
806
- },
807
- '"': function(stream, state) {
808
- state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
809
- return state.tokenize(stream, state);
810
- },
811
- '`': function(stream, state) {
812
- if (!stringTokenizer || !stream.match('`')) return false;
813
- state.tokenize = stringTokenizer;
814
- stringTokenizer = null;
815
- return state.tokenize(stream, state);
816
- },
817
- "'": function(stream) {
818
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
819
- return "atom";
820
- },
821
- token: function(_stream, state, style) {
822
- if ((style == "variable" || style == "type") &&
823
- state.prevToken == ".") {
824
- return "variable-2";
825
- }
826
- }
827
- },
828
- modeProps: {
829
- fold: ["brace", "import"],
830
- closeBrackets: {triples: '"'}
831
- }
832
- });
833
-
834
- });