PixelForce_ETS 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (467) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +4 -0
  3. data/.gitattributes +2 -0
  4. data/.github/issue_template.md +22 -0
  5. data/.github/pull_request_template.md +6 -0
  6. data/.gitignore +21 -0
  7. data/.rubocop.yml +100 -0
  8. data/.travis.yml +43 -0
  9. data/CONTRIBUTING.md +35 -0
  10. data/Gemfile +29 -0
  11. data/LICENSE +20 -0
  12. data/README.md +116 -0
  13. data/Rakefile +5 -0
  14. data/app/assets/fonts/comfy/admin/cms/lib/redactor-font.eot +0 -0
  15. data/app/assets/javascripts/comfy/admin/cms/application.js +39 -0
  16. data/app/assets/javascripts/comfy/admin/cms/base.js +46 -0
  17. data/app/assets/javascripts/comfy/admin/cms/categories.js +17 -0
  18. data/app/assets/javascripts/comfy/admin/cms/codemirror.js +31 -0
  19. data/app/assets/javascripts/comfy/admin/cms/custom.js +1 -0
  20. data/app/assets/javascripts/comfy/admin/cms/diff.js +10 -0
  21. data/app/assets/javascripts/comfy/admin/cms/file_link.js +67 -0
  22. data/app/assets/javascripts/comfy/admin/cms/file_upload.js +194 -0
  23. data/app/assets/javascripts/comfy/admin/cms/files_modal.js +40 -0
  24. data/app/assets/javascripts/comfy/admin/cms/page_fragments.js +22 -0
  25. data/app/assets/javascripts/comfy/admin/cms/slugify.js +34 -0
  26. data/app/assets/javascripts/comfy/admin/cms/sortable_list.js +40 -0
  27. data/app/assets/javascripts/comfy/admin/cms/timepicker.js +30 -0
  28. data/app/assets/javascripts/comfy/admin/cms/wysiwyg.js +65 -0
  29. data/app/assets/javascripts/comfy/vendor/Moxie.swf +0 -0
  30. data/app/assets/javascripts/comfy/vendor/Moxie.xap +0 -0
  31. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js +7 -0
  32. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js.map +1 -0
  33. data/app/assets/javascripts/comfy/vendor/codemirror.js +9653 -0
  34. data/app/assets/javascripts/comfy/vendor/codemirror/addon/edit/closetag.js +169 -0
  35. data/app/assets/javascripts/comfy/vendor/codemirror/mode/css/css.js +832 -0
  36. data/app/assets/javascripts/comfy/vendor/codemirror/mode/htmlmixed/htmlmixed.js +152 -0
  37. data/app/assets/javascripts/comfy/vendor/codemirror/mode/javascript/javascript.js +875 -0
  38. data/app/assets/javascripts/comfy/vendor/codemirror/mode/markdown/markdown.js +861 -0
  39. data/app/assets/javascripts/comfy/vendor/codemirror/mode/xml/xml.js +394 -0
  40. data/app/assets/javascripts/comfy/vendor/diff/diff_match_patch.min.js +49 -0
  41. data/app/assets/javascripts/comfy/vendor/diff/pretty_text_diff.js +76 -0
  42. data/app/assets/javascripts/comfy/vendor/flatpickr.min.js +2 -0
  43. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ar.js +52 -0
  44. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bg.js +65 -0
  45. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/bn.js +65 -0
  46. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ca.js +83 -0
  47. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cs.js +70 -0
  48. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/cy.js +92 -0
  49. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/da.js +71 -0
  50. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/de.js +70 -0
  51. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/default.js +80 -0
  52. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/eo.js +73 -0
  53. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/es.js +69 -0
  54. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/et.js +73 -0
  55. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fa.js +68 -0
  56. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fi.js +69 -0
  57. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/fr.js +75 -0
  58. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/gr.js +74 -0
  59. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/he.js +57 -0
  60. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hi.js +65 -0
  61. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hr.js +66 -0
  62. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/hu.js +72 -0
  63. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/id.js +61 -0
  64. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/it.js +70 -0
  65. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ja.js +57 -0
  66. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ko.js +60 -0
  67. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lt.js +72 -0
  68. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/lv.js +67 -0
  69. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mk.js +69 -0
  70. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/mn.js +67 -0
  71. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ms.js +68 -0
  72. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/my.js +69 -0
  73. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/nl.js +75 -0
  74. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/no.js +73 -0
  75. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pa.js +65 -0
  76. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pl.js +68 -0
  77. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt-BR.js +66 -0
  78. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/pt.js +66 -0
  79. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ro.js +69 -0
  80. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/ru.js +66 -0
  81. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/si.js +65 -0
  82. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sk.js +70 -0
  83. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sl.js +70 -0
  84. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sq.js +65 -0
  85. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sr.js +69 -0
  86. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/sv.js +70 -0
  87. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/th.js +72 -0
  88. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/tr.js +66 -0
  89. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/uk.js +66 -0
  90. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/vn.js +66 -0
  91. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-CN.js +61 -0
  92. data/app/assets/javascripts/comfy/vendor/flatpickr/i18n/zh-TW.js +61 -0
  93. data/app/assets/javascripts/comfy/vendor/fontawesome.js +5 -0
  94. data/app/assets/javascripts/comfy/vendor/moxie.min.js +16 -0
  95. data/app/assets/javascripts/comfy/vendor/plupload.dev.js +2497 -0
  96. data/app/assets/javascripts/comfy/vendor/redactor.js +9561 -0
  97. data/app/assets/javascripts/comfy/vendor/redactor/definedlinks.js +53 -0
  98. data/app/assets/javascripts/comfy/vendor/redactor/filemanager.js +64 -0
  99. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ar.js +76 -0
  100. data/app/assets/javascripts/comfy/vendor/redactor/i18n/az.js +75 -0
  101. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ba.js +79 -0
  102. data/app/assets/javascripts/comfy/vendor/redactor/i18n/bg.js +77 -0
  103. data/app/assets/javascripts/comfy/vendor/redactor/i18n/by.js +77 -0
  104. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ca.js +75 -0
  105. data/app/assets/javascripts/comfy/vendor/redactor/i18n/cs.js +87 -0
  106. data/app/assets/javascripts/comfy/vendor/redactor/i18n/da.js +75 -0
  107. data/app/assets/javascripts/comfy/vendor/redactor/i18n/de.js +80 -0
  108. data/app/assets/javascripts/comfy/vendor/redactor/i18n/el.js +76 -0
  109. data/app/assets/javascripts/comfy/vendor/redactor/i18n/en.js +75 -0
  110. data/app/assets/javascripts/comfy/vendor/redactor/i18n/eo.js +76 -0
  111. data/app/assets/javascripts/comfy/vendor/redactor/i18n/es.js +75 -0
  112. data/app/assets/javascripts/comfy/vendor/redactor/i18n/es_AR.js +76 -0
  113. data/app/assets/javascripts/comfy/vendor/redactor/i18n/fa.js +76 -0
  114. data/app/assets/javascripts/comfy/vendor/redactor/i18n/fi.js +75 -0
  115. data/app/assets/javascripts/comfy/vendor/redactor/i18n/fr.js +75 -0
  116. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ge.js +75 -0
  117. data/app/assets/javascripts/comfy/vendor/redactor/i18n/gr.js +75 -0
  118. data/app/assets/javascripts/comfy/vendor/redactor/i18n/he.js +75 -0
  119. data/app/assets/javascripts/comfy/vendor/redactor/i18n/hr.js +76 -0
  120. data/app/assets/javascripts/comfy/vendor/redactor/i18n/hu.js +77 -0
  121. data/app/assets/javascripts/comfy/vendor/redactor/i18n/id.js +76 -0
  122. data/app/assets/javascripts/comfy/vendor/redactor/i18n/it.js +78 -0
  123. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ja.js +76 -0
  124. data/app/assets/javascripts/comfy/vendor/redactor/i18n/kn.js +75 -0
  125. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ko.js +76 -0
  126. data/app/assets/javascripts/comfy/vendor/redactor/i18n/lt.js +75 -0
  127. data/app/assets/javascripts/comfy/vendor/redactor/i18n/lv.js +75 -0
  128. data/app/assets/javascripts/comfy/vendor/redactor/i18n/mk.js +75 -0
  129. data/app/assets/javascripts/comfy/vendor/redactor/i18n/nb.js +75 -0
  130. data/app/assets/javascripts/comfy/vendor/redactor/i18n/nl.js +80 -0
  131. data/app/assets/javascripts/comfy/vendor/redactor/i18n/pl.js +76 -0
  132. data/app/assets/javascripts/comfy/vendor/redactor/i18n/pt-BR.js +75 -0
  133. data/app/assets/javascripts/comfy/vendor/redactor/i18n/pt.js +75 -0
  134. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ro.js +76 -0
  135. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ru.js +76 -0
  136. data/app/assets/javascripts/comfy/vendor/redactor/i18n/sk.js +76 -0
  137. data/app/assets/javascripts/comfy/vendor/redactor/i18n/sl.js +79 -0
  138. data/app/assets/javascripts/comfy/vendor/redactor/i18n/sq.js +79 -0
  139. data/app/assets/javascripts/comfy/vendor/redactor/i18n/sr-CIR.js +79 -0
  140. data/app/assets/javascripts/comfy/vendor/redactor/i18n/sr-LAT.js +79 -0
  141. data/app/assets/javascripts/comfy/vendor/redactor/i18n/sv.js +74 -0
  142. data/app/assets/javascripts/comfy/vendor/redactor/i18n/th.js +74 -0
  143. data/app/assets/javascripts/comfy/vendor/redactor/i18n/tr.js +75 -0
  144. data/app/assets/javascripts/comfy/vendor/redactor/i18n/ua.js +77 -0
  145. data/app/assets/javascripts/comfy/vendor/redactor/i18n/uk.js +77 -0
  146. data/app/assets/javascripts/comfy/vendor/redactor/i18n/vi.js +74 -0
  147. data/app/assets/javascripts/comfy/vendor/redactor/i18n/zh-CN.js +75 -0
  148. data/app/assets/javascripts/comfy/vendor/redactor/i18n/zh-TW.js +75 -0
  149. data/app/assets/javascripts/comfy/vendor/redactor/imagemanager.js +57 -0
  150. data/app/assets/javascripts/comfy/vendor/redactor/table.js +337 -0
  151. data/app/assets/javascripts/comfy/vendor/redactor/video.js +77 -0
  152. data/app/assets/javascripts/comfy/vendor/sortable.min.js +5 -0
  153. data/app/assets/stylesheets/comfy/admin/cms/application.sass +11 -0
  154. data/app/assets/stylesheets/comfy/admin/cms/base.sass +256 -0
  155. data/app/assets/stylesheets/comfy/admin/cms/codemirror_overrides.sass +19 -0
  156. data/app/assets/stylesheets/comfy/admin/cms/custom.sass +1 -0
  157. data/app/assets/stylesheets/comfy/admin/cms/redactor_overrides.sass +22 -0
  158. data/app/assets/stylesheets/comfy/vendor/bootstrap/_alert.scss +51 -0
  159. data/app/assets/stylesheets/comfy/vendor/bootstrap/_badge.scss +54 -0
  160. data/app/assets/stylesheets/comfy/vendor/bootstrap/_breadcrumb.scss +41 -0
  161. data/app/assets/stylesheets/comfy/vendor/bootstrap/_button-group.scss +163 -0
  162. data/app/assets/stylesheets/comfy/vendor/bootstrap/_buttons.scss +137 -0
  163. data/app/assets/stylesheets/comfy/vendor/bootstrap/_card.scss +289 -0
  164. data/app/assets/stylesheets/comfy/vendor/bootstrap/_carousel.scss +197 -0
  165. data/app/assets/stylesheets/comfy/vendor/bootstrap/_close.scss +41 -0
  166. data/app/assets/stylesheets/comfy/vendor/bootstrap/_code.scss +48 -0
  167. data/app/assets/stylesheets/comfy/vendor/bootstrap/_custom-forms.scss +507 -0
  168. data/app/assets/stylesheets/comfy/vendor/bootstrap/_dropdown.scss +191 -0
  169. data/app/assets/stylesheets/comfy/vendor/bootstrap/_forms.scss +330 -0
  170. data/app/assets/stylesheets/comfy/vendor/bootstrap/_functions.scss +86 -0
  171. data/app/assets/stylesheets/comfy/vendor/bootstrap/_grid.scss +52 -0
  172. data/app/assets/stylesheets/comfy/vendor/bootstrap/_images.scss +42 -0
  173. data/app/assets/stylesheets/comfy/vendor/bootstrap/_input-group.scss +193 -0
  174. data/app/assets/stylesheets/comfy/vendor/bootstrap/_jumbotron.scss +17 -0
  175. data/app/assets/stylesheets/comfy/vendor/bootstrap/_list-group.scss +149 -0
  176. data/app/assets/stylesheets/comfy/vendor/bootstrap/_media.scss +8 -0
  177. data/app/assets/stylesheets/comfy/vendor/bootstrap/_mixins.scss +47 -0
  178. data/app/assets/stylesheets/comfy/vendor/bootstrap/_modal.scss +229 -0
  179. data/app/assets/stylesheets/comfy/vendor/bootstrap/_nav.scss +120 -0
  180. data/app/assets/stylesheets/comfy/vendor/bootstrap/_navbar.scss +294 -0
  181. data/app/assets/stylesheets/comfy/vendor/bootstrap/_pagination.scss +73 -0
  182. data/app/assets/stylesheets/comfy/vendor/bootstrap/_popover.scss +171 -0
  183. data/app/assets/stylesheets/comfy/vendor/bootstrap/_print.scss +141 -0
  184. data/app/assets/stylesheets/comfy/vendor/bootstrap/_progress.scss +43 -0
  185. data/app/assets/stylesheets/comfy/vendor/bootstrap/_reboot.scss +483 -0
  186. data/app/assets/stylesheets/comfy/vendor/bootstrap/_root.scss +19 -0
  187. data/app/assets/stylesheets/comfy/vendor/bootstrap/_spinners.scss +55 -0
  188. data/app/assets/stylesheets/comfy/vendor/bootstrap/_tables.scss +185 -0
  189. data/app/assets/stylesheets/comfy/vendor/bootstrap/_toasts.scss +44 -0
  190. data/app/assets/stylesheets/comfy/vendor/bootstrap/_tooltip.scss +115 -0
  191. data/app/assets/stylesheets/comfy/vendor/bootstrap/_transitions.scss +20 -0
  192. data/app/assets/stylesheets/comfy/vendor/bootstrap/_type.scss +125 -0
  193. data/app/assets/stylesheets/comfy/vendor/bootstrap/_utilities.scss +17 -0
  194. data/app/assets/stylesheets/comfy/vendor/bootstrap/_variables.scss +1123 -0
  195. data/app/assets/stylesheets/comfy/vendor/bootstrap/bootstrap-grid.scss +29 -0
  196. data/app/assets/stylesheets/comfy/vendor/bootstrap/bootstrap-reboot.scss +12 -0
  197. data/app/assets/stylesheets/comfy/vendor/bootstrap/bootstrap.scss +44 -0
  198. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_alert.scss +13 -0
  199. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_background-variant.scss +21 -0
  200. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_badge.scss +17 -0
  201. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_border-radius.scss +63 -0
  202. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_box-shadow.scss +20 -0
  203. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_breakpoints.scss +123 -0
  204. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_buttons.scss +107 -0
  205. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_caret.scss +62 -0
  206. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_clearfix.scss +7 -0
  207. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_deprecate.scss +10 -0
  208. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_float.scss +14 -0
  209. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_forms.scss +192 -0
  210. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_gradients.scss +45 -0
  211. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_grid-framework.scss +66 -0
  212. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_grid.scss +51 -0
  213. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_hover.scss +37 -0
  214. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_image.scss +36 -0
  215. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_list-group.scss +21 -0
  216. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_lists.scss +7 -0
  217. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_nav-divider.scss +10 -0
  218. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_pagination.scss +22 -0
  219. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_reset-text.scss +17 -0
  220. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_resize.scss +6 -0
  221. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_screen-reader.scss +33 -0
  222. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_size.scss +7 -0
  223. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_table-row.scss +39 -0
  224. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_text-emphasis.scss +16 -0
  225. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_text-hide.scss +11 -0
  226. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_text-truncate.scss +8 -0
  227. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_transition.scss +16 -0
  228. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_visibility.scss +8 -0
  229. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_align.scss +8 -0
  230. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_background.scss +19 -0
  231. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_borders.scss +75 -0
  232. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_clearfix.scss +3 -0
  233. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_display.scss +26 -0
  234. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_embed.scss +39 -0
  235. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_flex.scss +51 -0
  236. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_float.scss +11 -0
  237. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_overflow.scss +5 -0
  238. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_position.scss +32 -0
  239. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_screenreaders.scss +11 -0
  240. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_shadows.scss +6 -0
  241. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_sizing.scss +20 -0
  242. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_spacing.scss +73 -0
  243. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_stretched-link.scss +19 -0
  244. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_text.scss +72 -0
  245. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_visibility.scss +13 -0
  246. data/app/assets/stylesheets/comfy/vendor/bootstrap/vendor/_rfs.scss +204 -0
  247. data/app/assets/stylesheets/comfy/vendor/codemirror.css +346 -0
  248. data/app/assets/stylesheets/comfy/vendor/flatpickr.min.css +13 -0
  249. data/app/assets/stylesheets/comfy/vendor/fontawesome.css +343 -0
  250. data/app/assets/stylesheets/comfy/vendor/redactor.css +948 -0
  251. data/app/controllers/application_controller.rb +7 -0
  252. data/app/controllers/comfy/admin/base_controller.rb +22 -0
  253. data/app/controllers/comfy/admin/cms/base_controller.rb +55 -0
  254. data/app/controllers/comfy/admin/cms/categories_controller.rb +40 -0
  255. data/app/controllers/comfy/admin/cms/files_controller.rb +142 -0
  256. data/app/controllers/comfy/admin/cms/layouts_controller.rb +69 -0
  257. data/app/controllers/comfy/admin/cms/pages_controller.rb +156 -0
  258. data/app/controllers/comfy/admin/cms/revisions/base_controller.rb +50 -0
  259. data/app/controllers/comfy/admin/cms/revisions/layout_controller.rb +18 -0
  260. data/app/controllers/comfy/admin/cms/revisions/page_controller.rb +30 -0
  261. data/app/controllers/comfy/admin/cms/revisions/snippet_controller.rb +18 -0
  262. data/app/controllers/comfy/admin/cms/revisions/translation_controller.rb +31 -0
  263. data/app/controllers/comfy/admin/cms/sites_controller.rb +69 -0
  264. data/app/controllers/comfy/admin/cms/snippets_controller.rb +66 -0
  265. data/app/controllers/comfy/admin/cms/translations_controller.rb +107 -0
  266. data/app/controllers/comfy/cms/assets_controller.rb +40 -0
  267. data/app/controllers/comfy/cms/base_controller.rb +33 -0
  268. data/app/controllers/comfy/cms/content_controller.rb +87 -0
  269. data/app/controllers/concerns/comfy/paginate.rb +16 -0
  270. data/app/controllers/concerns/comfy/reorder_action.rb +19 -0
  271. data/app/helpers/comfy/admin/cms_helper.rb +49 -0
  272. data/app/helpers/comfy/cms_helper.rb +73 -0
  273. data/app/models/comfy/cms/categorization.rb +16 -0
  274. data/app/models/comfy/cms/category.rb +24 -0
  275. data/app/models/comfy/cms/file.rb +57 -0
  276. data/app/models/comfy/cms/fragment.rb +59 -0
  277. data/app/models/comfy/cms/layout.rb +113 -0
  278. data/app/models/comfy/cms/page.rb +169 -0
  279. data/app/models/comfy/cms/revision.rb +12 -0
  280. data/app/models/comfy/cms/site.rb +94 -0
  281. data/app/models/comfy/cms/snippet.rb +45 -0
  282. data/app/models/comfy/cms/translation.rb +43 -0
  283. data/app/models/concerns/comfy/cms/with_categories.rb +53 -0
  284. data/app/models/concerns/comfy/cms/with_fragments.rb +125 -0
  285. data/app/views/comfy/admin/cms/categories/_categories.html.haml +4 -0
  286. data/app/views/comfy/admin/cms/categories/_edit.html.haml +7 -0
  287. data/app/views/comfy/admin/cms/categories/_form.html.haml +5 -0
  288. data/app/views/comfy/admin/cms/categories/_index.html.haml +28 -0
  289. data/app/views/comfy/admin/cms/categories/_show.html.haml +15 -0
  290. data/app/views/comfy/admin/cms/categories/create.js.erb +7 -0
  291. data/app/views/comfy/admin/cms/categories/destroy.js.erb +8 -0
  292. data/app/views/comfy/admin/cms/categories/edit.js.erb +3 -0
  293. data/app/views/comfy/admin/cms/categories/update.js.erb +6 -0
  294. data/app/views/comfy/admin/cms/files/_file.html.haml +31 -0
  295. data/app/views/comfy/admin/cms/files/_form.html.haml +26 -0
  296. data/app/views/comfy/admin/cms/files/_modal.html.haml +3 -0
  297. data/app/views/comfy/admin/cms/files/destroy.js.erb +4 -0
  298. data/app/views/comfy/admin/cms/files/edit.html.haml +5 -0
  299. data/app/views/comfy/admin/cms/files/index.html.haml +29 -0
  300. data/app/views/comfy/admin/cms/files/new.html.haml +5 -0
  301. data/app/views/comfy/admin/cms/fragments/_form_fragment_attachments.html.haml +23 -0
  302. data/app/views/comfy/admin/cms/fragments/_form_fragments.html.haml +38 -0
  303. data/app/views/comfy/admin/cms/layouts/_form.html.haml +20 -0
  304. data/app/views/comfy/admin/cms/layouts/_index_branch.html.haml +26 -0
  305. data/app/views/comfy/admin/cms/layouts/edit.html.haml +9 -0
  306. data/app/views/comfy/admin/cms/layouts/index.html.haml +10 -0
  307. data/app/views/comfy/admin/cms/layouts/new.html.haml +5 -0
  308. data/app/views/comfy/admin/cms/pages/_form.html.haml +31 -0
  309. data/app/views/comfy/admin/cms/pages/_index_branch.html.haml +44 -0
  310. data/app/views/comfy/admin/cms/pages/edit.html.haml +10 -0
  311. data/app/views/comfy/admin/cms/pages/index.html.haml +13 -0
  312. data/app/views/comfy/admin/cms/pages/new.html.haml +5 -0
  313. data/app/views/comfy/admin/cms/pages/toggle_branch.js.erb +13 -0
  314. data/app/views/comfy/admin/cms/revisions/_sidebar.html.haml +2 -0
  315. data/app/views/comfy/admin/cms/revisions/show.html.haml +36 -0
  316. data/app/views/comfy/admin/cms/sites/_form.html.haml +15 -0
  317. data/app/views/comfy/admin/cms/sites/edit.html.haml +5 -0
  318. data/app/views/comfy/admin/cms/sites/index.html.haml +28 -0
  319. data/app/views/comfy/admin/cms/sites/new.html.haml +5 -0
  320. data/app/views/comfy/admin/cms/snippets/_form.html.haml +13 -0
  321. data/app/views/comfy/admin/cms/snippets/edit.html.haml +9 -0
  322. data/app/views/comfy/admin/cms/snippets/index.html.haml +33 -0
  323. data/app/views/comfy/admin/cms/snippets/new.html.haml +5 -0
  324. data/app/views/comfy/admin/cms/translations/_form.html.haml +20 -0
  325. data/app/views/comfy/admin/cms/translations/_sidebar.html.haml +19 -0
  326. data/app/views/comfy/admin/cms/translations/edit.html.haml +10 -0
  327. data/app/views/comfy/admin/cms/translations/new.html.haml +5 -0
  328. data/app/views/kaminari/comfy/_first_page.html.haml +3 -0
  329. data/app/views/kaminari/comfy/_gap.html.haml +2 -0
  330. data/app/views/kaminari/comfy/_last_page.html.haml +3 -0
  331. data/app/views/kaminari/comfy/_next_page.html.haml +2 -0
  332. data/app/views/kaminari/comfy/_page.html.haml +2 -0
  333. data/app/views/kaminari/comfy/_paginator.html.haml +11 -0
  334. data/app/views/kaminari/comfy/_prev_page.html.haml +2 -0
  335. data/app/views/layouts/comfy/admin/cms.html.haml +4 -0
  336. data/app/views/layouts/comfy/admin/cms/_body.html.haml +14 -0
  337. data/app/views/layouts/comfy/admin/cms/_flash.html.haml +4 -0
  338. data/app/views/layouts/comfy/admin/cms/_footer_js.html.haml +6 -0
  339. data/app/views/layouts/comfy/admin/cms/_head.html.haml +19 -0
  340. data/app/views/layouts/comfy/admin/cms/_left.html.haml +39 -0
  341. data/app/views/layouts/comfy/admin/cms/_right.html.haml +5 -0
  342. data/bin/bundle +3 -0
  343. data/bin/rails +4 -0
  344. data/bin/rake +4 -0
  345. data/bin/setup +36 -0
  346. data/bin/update +31 -0
  347. data/bin/yarn +11 -0
  348. data/comfortable_mexican_sofa.gemspec +34 -0
  349. data/config.ru +6 -0
  350. data/config/application.rb +39 -0
  351. data/config/boot.rb +7 -0
  352. data/config/cms_routes.rb +8 -0
  353. data/config/database.yml +11 -0
  354. data/config/environment.rb +7 -0
  355. data/config/environments/development.rb +64 -0
  356. data/config/environments/test.rb +55 -0
  357. data/config/initializers/comfortable_mexican_sofa.rb +122 -0
  358. data/config/locales/ca.yml +263 -0
  359. data/config/locales/cs.yml +263 -0
  360. data/config/locales/da.yml +263 -0
  361. data/config/locales/de.yml +263 -0
  362. data/config/locales/en.yml +263 -0
  363. data/config/locales/es.yml +263 -0
  364. data/config/locales/fi.yml +263 -0
  365. data/config/locales/fr.yml +263 -0
  366. data/config/locales/gr.yml +263 -0
  367. data/config/locales/hr.yml +263 -0
  368. data/config/locales/it.yml +263 -0
  369. data/config/locales/ja.yml +263 -0
  370. data/config/locales/nb.yml +263 -0
  371. data/config/locales/nl.yml +263 -0
  372. data/config/locales/pl.yml +263 -0
  373. data/config/locales/pt-BR.yml +263 -0
  374. data/config/locales/ru.yml +263 -0
  375. data/config/locales/sk.yml +263 -0
  376. data/config/locales/sv.yml +263 -0
  377. data/config/locales/tr.yml +263 -0
  378. data/config/locales/uk.yml +263 -0
  379. data/config/locales/zh-CN.yml +263 -0
  380. data/config/locales/zh-TW.yml +263 -0
  381. data/config/storage.yml +35 -0
  382. data/db/cms_seeds/sample-site/files/_default.jpg.yml +5 -0
  383. data/db/cms_seeds/sample-site/files/default.jpg +0 -0
  384. data/db/cms_seeds/sample-site/layouts/default/content.html +16 -0
  385. data/db/cms_seeds/sample-site/layouts/default/nested/content.html +14 -0
  386. data/db/cms_seeds/sample-site/pages/index/child_a/content.html +7 -0
  387. data/db/cms_seeds/sample-site/pages/index/child_b/content.html +6 -0
  388. data/db/cms_seeds/sample-site/pages/index/cms logo.png +0 -0
  389. data/db/cms_seeds/sample-site/pages/index/content.es.html +6 -0
  390. data/db/cms_seeds/sample-site/pages/index/content.fr.html +6 -0
  391. data/db/cms_seeds/sample-site/pages/index/content.html +25 -0
  392. data/db/cms_seeds/sample-site/pages/index/footer.png +0 -0
  393. data/db/cms_seeds/sample-site/pages/index/header.png +0 -0
  394. data/db/cms_seeds/sample-site/snippets/default.html +8 -0
  395. data/db/migrate/00_create_active_storage_tables.active_storage.rb +26 -0
  396. data/db/migrate/01_create_cms.rb +142 -0
  397. data/lib/comfortable_mexican_sofa.rb +60 -0
  398. data/lib/comfortable_mexican_sofa/access_control/admin_authentication.rb +24 -0
  399. data/lib/comfortable_mexican_sofa/access_control/admin_authorization.rb +12 -0
  400. data/lib/comfortable_mexican_sofa/access_control/public_authentication.rb +12 -0
  401. data/lib/comfortable_mexican_sofa/access_control/public_authorization.rb +12 -0
  402. data/lib/comfortable_mexican_sofa/configuration.rb +139 -0
  403. data/lib/comfortable_mexican_sofa/content.rb +31 -0
  404. data/lib/comfortable_mexican_sofa/content/block.rb +14 -0
  405. data/lib/comfortable_mexican_sofa/content/params_parser.rb +149 -0
  406. data/lib/comfortable_mexican_sofa/content/renderer.rb +149 -0
  407. data/lib/comfortable_mexican_sofa/content/tag.rb +50 -0
  408. data/lib/comfortable_mexican_sofa/content/tags/asset.rb +59 -0
  409. data/lib/comfortable_mexican_sofa/content/tags/checkbox.rb +29 -0
  410. data/lib/comfortable_mexican_sofa/content/tags/date.rb +21 -0
  411. data/lib/comfortable_mexican_sofa/content/tags/datetime.rb +44 -0
  412. data/lib/comfortable_mexican_sofa/content/tags/file.rb +72 -0
  413. data/lib/comfortable_mexican_sofa/content/tags/file_link.rb +63 -0
  414. data/lib/comfortable_mexican_sofa/content/tags/files.rb +43 -0
  415. data/lib/comfortable_mexican_sofa/content/tags/fragment.rb +66 -0
  416. data/lib/comfortable_mexican_sofa/content/tags/helper.rb +55 -0
  417. data/lib/comfortable_mexican_sofa/content/tags/markdown.rb +24 -0
  418. data/lib/comfortable_mexican_sofa/content/tags/mixins/file_content.rb +43 -0
  419. data/lib/comfortable_mexican_sofa/content/tags/number.rb +20 -0
  420. data/lib/comfortable_mexican_sofa/content/tags/page_file_link.rb +84 -0
  421. data/lib/comfortable_mexican_sofa/content/tags/partial.rb +49 -0
  422. data/lib/comfortable_mexican_sofa/content/tags/snippet.rb +34 -0
  423. data/lib/comfortable_mexican_sofa/content/tags/template.rb +44 -0
  424. data/lib/comfortable_mexican_sofa/content/tags/text.rb +20 -0
  425. data/lib/comfortable_mexican_sofa/content/tags/textarea.rb +20 -0
  426. data/lib/comfortable_mexican_sofa/content/tags/wysiwyg.rb +21 -0
  427. data/lib/comfortable_mexican_sofa/engine.rb +31 -0
  428. data/lib/comfortable_mexican_sofa/error.rb +32 -0
  429. data/lib/comfortable_mexican_sofa/extensions/acts_as_tree.rb +120 -0
  430. data/lib/comfortable_mexican_sofa/extensions/has_revisions.rb +72 -0
  431. data/lib/comfortable_mexican_sofa/form_builder.rb +47 -0
  432. data/lib/comfortable_mexican_sofa/render_methods.rb +112 -0
  433. data/lib/comfortable_mexican_sofa/routes/cms.rb +18 -0
  434. data/lib/comfortable_mexican_sofa/routes/cms_admin.rb +58 -0
  435. data/lib/comfortable_mexican_sofa/routing.rb +12 -0
  436. data/lib/comfortable_mexican_sofa/seeds.rb +114 -0
  437. data/lib/comfortable_mexican_sofa/seeds/file/exporter.rb +43 -0
  438. data/lib/comfortable_mexican_sofa/seeds/file/importer.rb +63 -0
  439. data/lib/comfortable_mexican_sofa/seeds/layout/exporter.rb +40 -0
  440. data/lib/comfortable_mexican_sofa/seeds/layout/importer.rb +62 -0
  441. data/lib/comfortable_mexican_sofa/seeds/page/exporter.rb +92 -0
  442. data/lib/comfortable_mexican_sofa/seeds/page/importer.rb +219 -0
  443. data/lib/comfortable_mexican_sofa/seeds/snippet/exporter.rb +34 -0
  444. data/lib/comfortable_mexican_sofa/seeds/snippet/importer.rb +51 -0
  445. data/lib/comfortable_mexican_sofa/version.rb +9 -0
  446. data/lib/comfortable_mexican_sofa/view_hooks.rb +35 -0
  447. data/lib/generators/comfy/cms/README +17 -0
  448. data/lib/generators/comfy/cms/assets_generator.rb +18 -0
  449. data/lib/generators/comfy/cms/cms_generator.rb +69 -0
  450. data/lib/generators/comfy/cms/controllers_generator.rb +17 -0
  451. data/lib/generators/comfy/cms/models_generator.rb +17 -0
  452. data/lib/generators/comfy/cms/views_generator.rb +17 -0
  453. data/lib/generators/comfy/scaffold/scaffold_generator.rb +80 -0
  454. data/lib/generators/comfy/scaffold/templates/controller.rb.tt +62 -0
  455. data/lib/generators/comfy/scaffold/templates/migration.rb.tt +11 -0
  456. data/lib/generators/comfy/scaffold/templates/model.rb.tt +21 -0
  457. data/lib/generators/comfy/scaffold/templates/tests/controller.rb.tt +115 -0
  458. data/lib/generators/comfy/scaffold/templates/tests/fixture.yml.tt +4 -0
  459. data/lib/generators/comfy/scaffold/templates/tests/model.rb.tt +26 -0
  460. data/lib/generators/comfy/scaffold/templates/views/_form.haml.tt +7 -0
  461. data/lib/generators/comfy/scaffold/templates/views/edit.haml.tt +5 -0
  462. data/lib/generators/comfy/scaffold/templates/views/index.haml.tt +21 -0
  463. data/lib/generators/comfy/scaffold/templates/views/new.haml.tt +5 -0
  464. data/lib/generators/comfy/scaffold/templates/views/show.haml.tt +4 -0
  465. data/lib/tasks/cms_seeds.rake +40 -0
  466. data/public/favicon.ico +0 -0
  467. metadata +648 -0
@@ -0,0 +1,169 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ /**
5
+ * Tag-closer extension for CodeMirror.
6
+ *
7
+ * This extension adds an "autoCloseTags" option that can be set to
8
+ * either true to get the default behavior, or an object to further
9
+ * configure its behavior.
10
+ *
11
+ * These are supported options:
12
+ *
13
+ * `whenClosing` (default true)
14
+ * Whether to autoclose when the '/' of a closing tag is typed.
15
+ * `whenOpening` (default true)
16
+ * Whether to autoclose the tag when the final '>' of an opening
17
+ * tag is typed.
18
+ * `dontCloseTags` (default is empty tags for HTML, none for XML)
19
+ * An array of tag names that should not be autoclosed.
20
+ * `indentTags` (default is block tags for HTML, none for XML)
21
+ * An array of tag names that should, when opened, cause a
22
+ * blank line to be added inside the tag, and the blank line and
23
+ * closing line to be indented.
24
+ *
25
+ * See demos/closetag.html for a usage example.
26
+ */
27
+
28
+ (function(mod) {
29
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
30
+ mod(require("../../lib/codemirror"), require("../fold/xml-fold"));
31
+ else if (typeof define == "function" && define.amd) // AMD
32
+ define(["../../lib/codemirror", "../fold/xml-fold"], mod);
33
+ else // Plain browser env
34
+ mod(CodeMirror);
35
+ })(function(CodeMirror) {
36
+ CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
37
+ if (old != CodeMirror.Init && old)
38
+ cm.removeKeyMap("autoCloseTags");
39
+ if (!val) return;
40
+ var map = {name: "autoCloseTags"};
41
+ if (typeof val != "object" || val.whenClosing)
42
+ map["'/'"] = function(cm) { return autoCloseSlash(cm); };
43
+ if (typeof val != "object" || val.whenOpening)
44
+ map["'>'"] = function(cm) { return autoCloseGT(cm); };
45
+ cm.addKeyMap(map);
46
+ });
47
+
48
+ var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
49
+ "source", "track", "wbr"];
50
+ var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
51
+ "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
52
+
53
+ function autoCloseGT(cm) {
54
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
55
+ var ranges = cm.listSelections(), replacements = [];
56
+ for (var i = 0; i < ranges.length; i++) {
57
+ if (!ranges[i].empty()) return CodeMirror.Pass;
58
+ var pos = ranges[i].head, tok = cm.getTokenAt(pos);
59
+ var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
60
+ if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
61
+
62
+ var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
63
+ var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
64
+ var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
65
+
66
+ var tagName = state.tagName;
67
+ if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
68
+ var lowerTagName = tagName.toLowerCase();
69
+ // Don't process the '>' at the end of an end-tag or self-closing tag
70
+ if (!tagName ||
71
+ tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
72
+ tok.type == "tag" && state.type == "closeTag" ||
73
+ tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
74
+ dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
75
+ closingTagExists(cm, tagName, pos, state, true))
76
+ return CodeMirror.Pass;
77
+
78
+ var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
79
+ replacements[i] = {indent: indent,
80
+ text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
81
+ newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
82
+ }
83
+
84
+ for (var i = ranges.length - 1; i >= 0; i--) {
85
+ var info = replacements[i];
86
+ cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
87
+ var sel = cm.listSelections().slice(0);
88
+ sel[i] = {head: info.newPos, anchor: info.newPos};
89
+ cm.setSelections(sel);
90
+ if (info.indent) {
91
+ cm.indentLine(info.newPos.line, null, true);
92
+ cm.indentLine(info.newPos.line + 1, null, true);
93
+ }
94
+ }
95
+ }
96
+
97
+ function autoCloseCurrent(cm, typingSlash) {
98
+ var ranges = cm.listSelections(), replacements = [];
99
+ var head = typingSlash ? "/" : "</";
100
+ for (var i = 0; i < ranges.length; i++) {
101
+ if (!ranges[i].empty()) return CodeMirror.Pass;
102
+ var pos = ranges[i].head, tok = cm.getTokenAt(pos);
103
+ var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
104
+ if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
105
+ tok.start != pos.ch - 1))
106
+ return CodeMirror.Pass;
107
+ // Kludge to get around the fact that we are not in XML mode
108
+ // when completing in JS/CSS snippet in htmlmixed mode. Does not
109
+ // work for other XML embedded languages (there is no general
110
+ // way to go from a mixed mode to its current XML state).
111
+ var replacement;
112
+ if (inner.mode.name != "xml") {
113
+ if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
114
+ replacement = head + "script";
115
+ else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
116
+ replacement = head + "style";
117
+ else
118
+ return CodeMirror.Pass;
119
+ } else {
120
+ if (!state.context || !state.context.tagName ||
121
+ closingTagExists(cm, state.context.tagName, pos, state))
122
+ return CodeMirror.Pass;
123
+ replacement = head + state.context.tagName;
124
+ }
125
+ if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
126
+ replacements[i] = replacement;
127
+ }
128
+ cm.replaceSelections(replacements);
129
+ ranges = cm.listSelections();
130
+ for (var i = 0; i < ranges.length; i++)
131
+ if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
132
+ cm.indentLine(ranges[i].head.line);
133
+ }
134
+
135
+ function autoCloseSlash(cm) {
136
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
137
+ return autoCloseCurrent(cm, true);
138
+ }
139
+
140
+ CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
141
+
142
+ function indexOf(collection, elt) {
143
+ if (collection.indexOf) return collection.indexOf(elt);
144
+ for (var i = 0, e = collection.length; i < e; ++i)
145
+ if (collection[i] == elt) return i;
146
+ return -1;
147
+ }
148
+
149
+ // If xml-fold is loaded, we use its functionality to try and verify
150
+ // whether a given tag is actually unclosed.
151
+ function closingTagExists(cm, tagName, pos, state, newTag) {
152
+ if (!CodeMirror.scanForClosingTag) return false;
153
+ var end = Math.min(cm.lastLine() + 1, pos.line + 500);
154
+ var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
155
+ if (!nextClose || nextClose.tag != tagName) return false;
156
+ var cx = state.context;
157
+ // If the immediate wrapping context contains onCx instances of
158
+ // the same tag, a closing tag only exists if there are at least
159
+ // that many closing tags of that type following.
160
+ for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx;
161
+ pos = nextClose.to;
162
+ for (var i = 1; i < onCx; i++) {
163
+ var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
164
+ if (!next || next.tag != tagName) return false;
165
+ pos = next.to;
166
+ }
167
+ return true;
168
+ }
169
+ });
@@ -0,0 +1,832 @@
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
+ CodeMirror.defineMode("css", function(config, parserConfig) {
15
+ var inline = parserConfig.inline
16
+ if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
17
+
18
+ var indentUnit = config.indentUnit,
19
+ tokenHooks = parserConfig.tokenHooks,
20
+ documentTypes = parserConfig.documentTypes || {},
21
+ mediaTypes = parserConfig.mediaTypes || {},
22
+ mediaFeatures = parserConfig.mediaFeatures || {},
23
+ mediaValueKeywords = parserConfig.mediaValueKeywords || {},
24
+ propertyKeywords = parserConfig.propertyKeywords || {},
25
+ nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
26
+ fontProperties = parserConfig.fontProperties || {},
27
+ counterDescriptors = parserConfig.counterDescriptors || {},
28
+ colorKeywords = parserConfig.colorKeywords || {},
29
+ valueKeywords = parserConfig.valueKeywords || {},
30
+ allowNested = parserConfig.allowNested,
31
+ lineComment = parserConfig.lineComment,
32
+ supportsAtComponent = parserConfig.supportsAtComponent === true;
33
+
34
+ var type, override;
35
+ function ret(style, tp) { type = tp; return style; }
36
+
37
+ // Tokenizers
38
+
39
+ function tokenBase(stream, state) {
40
+ var ch = stream.next();
41
+ if (tokenHooks[ch]) {
42
+ var result = tokenHooks[ch](stream, state);
43
+ if (result !== false) return result;
44
+ }
45
+ if (ch == "@") {
46
+ stream.eatWhile(/[\w\\\-]/);
47
+ return ret("def", stream.current());
48
+ } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
49
+ return ret(null, "compare");
50
+ } else if (ch == "\"" || ch == "'") {
51
+ state.tokenize = tokenString(ch);
52
+ return state.tokenize(stream, state);
53
+ } else if (ch == "#") {
54
+ stream.eatWhile(/[\w\\\-]/);
55
+ return ret("atom", "hash");
56
+ } else if (ch == "!") {
57
+ stream.match(/^\s*\w*/);
58
+ return ret("keyword", "important");
59
+ } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
60
+ stream.eatWhile(/[\w.%]/);
61
+ return ret("number", "unit");
62
+ } else if (ch === "-") {
63
+ if (/[\d.]/.test(stream.peek())) {
64
+ stream.eatWhile(/[\w.%]/);
65
+ return ret("number", "unit");
66
+ } else if (stream.match(/^-[\w\\\-]+/)) {
67
+ stream.eatWhile(/[\w\\\-]/);
68
+ if (stream.match(/^\s*:/, false))
69
+ return ret("variable-2", "variable-definition");
70
+ return ret("variable-2", "variable");
71
+ } else if (stream.match(/^\w+-/)) {
72
+ return ret("meta", "meta");
73
+ }
74
+ } else if (/[,+>*\/]/.test(ch)) {
75
+ return ret(null, "select-op");
76
+ } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
77
+ return ret("qualifier", "qualifier");
78
+ } else if (/[:;{}\[\]\(\)]/.test(ch)) {
79
+ return ret(null, ch);
80
+ } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) ||
81
+ (ch == "d" && stream.match("omain(")) ||
82
+ (ch == "r" && stream.match("egexp("))) {
83
+ stream.backUp(1);
84
+ state.tokenize = tokenParenthesized;
85
+ return ret("property", "word");
86
+ } else if (/[\w\\\-]/.test(ch)) {
87
+ stream.eatWhile(/[\w\\\-]/);
88
+ return ret("property", "word");
89
+ } else {
90
+ return ret(null, null);
91
+ }
92
+ }
93
+
94
+ function tokenString(quote) {
95
+ return function(stream, state) {
96
+ var escaped = false, ch;
97
+ while ((ch = stream.next()) != null) {
98
+ if (ch == quote && !escaped) {
99
+ if (quote == ")") stream.backUp(1);
100
+ break;
101
+ }
102
+ escaped = !escaped && ch == "\\";
103
+ }
104
+ if (ch == quote || !escaped && quote != ")") state.tokenize = null;
105
+ return ret("string", "string");
106
+ };
107
+ }
108
+
109
+ function tokenParenthesized(stream, state) {
110
+ stream.next(); // Must be '('
111
+ if (!stream.match(/\s*[\"\')]/, false))
112
+ state.tokenize = tokenString(")");
113
+ else
114
+ state.tokenize = null;
115
+ return ret(null, "(");
116
+ }
117
+
118
+ // Context management
119
+
120
+ function Context(type, indent, prev) {
121
+ this.type = type;
122
+ this.indent = indent;
123
+ this.prev = prev;
124
+ }
125
+
126
+ function pushContext(state, stream, type, indent) {
127
+ state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
128
+ return type;
129
+ }
130
+
131
+ function popContext(state) {
132
+ if (state.context.prev)
133
+ state.context = state.context.prev;
134
+ return state.context.type;
135
+ }
136
+
137
+ function pass(type, stream, state) {
138
+ return states[state.context.type](type, stream, state);
139
+ }
140
+ function popAndPass(type, stream, state, n) {
141
+ for (var i = n || 1; i > 0; i--)
142
+ state.context = state.context.prev;
143
+ return pass(type, stream, state);
144
+ }
145
+
146
+ // Parser
147
+
148
+ function wordAsValue(stream) {
149
+ var word = stream.current().toLowerCase();
150
+ if (valueKeywords.hasOwnProperty(word))
151
+ override = "atom";
152
+ else if (colorKeywords.hasOwnProperty(word))
153
+ override = "keyword";
154
+ else
155
+ override = "variable";
156
+ }
157
+
158
+ var states = {};
159
+
160
+ states.top = function(type, stream, state) {
161
+ if (type == "{") {
162
+ return pushContext(state, stream, "block");
163
+ } else if (type == "}" && state.context.prev) {
164
+ return popContext(state);
165
+ } else if (supportsAtComponent && /@component/.test(type)) {
166
+ return pushContext(state, stream, "atComponentBlock");
167
+ } else if (/^@(-moz-)?document$/.test(type)) {
168
+ return pushContext(state, stream, "documentTypes");
169
+ } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {
170
+ return pushContext(state, stream, "atBlock");
171
+ } else if (/^@(font-face|counter-style)/.test(type)) {
172
+ state.stateArg = type;
173
+ return "restricted_atBlock_before";
174
+ } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
175
+ return "keyframes";
176
+ } else if (type && type.charAt(0) == "@") {
177
+ return pushContext(state, stream, "at");
178
+ } else if (type == "hash") {
179
+ override = "builtin";
180
+ } else if (type == "word") {
181
+ override = "tag";
182
+ } else if (type == "variable-definition") {
183
+ return "maybeprop";
184
+ } else if (type == "interpolation") {
185
+ return pushContext(state, stream, "interpolation");
186
+ } else if (type == ":") {
187
+ return "pseudo";
188
+ } else if (allowNested && type == "(") {
189
+ return pushContext(state, stream, "parens");
190
+ }
191
+ return state.context.type;
192
+ };
193
+
194
+ states.block = function(type, stream, state) {
195
+ if (type == "word") {
196
+ var word = stream.current().toLowerCase();
197
+ if (propertyKeywords.hasOwnProperty(word)) {
198
+ override = "property";
199
+ return "maybeprop";
200
+ } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
201
+ override = "string-2";
202
+ return "maybeprop";
203
+ } else if (allowNested) {
204
+ override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
205
+ return "block";
206
+ } else {
207
+ override += " error";
208
+ return "maybeprop";
209
+ }
210
+ } else if (type == "meta") {
211
+ return "block";
212
+ } else if (!allowNested && (type == "hash" || type == "qualifier")) {
213
+ override = "error";
214
+ return "block";
215
+ } else {
216
+ return states.top(type, stream, state);
217
+ }
218
+ };
219
+
220
+ states.maybeprop = function(type, stream, state) {
221
+ if (type == ":") return pushContext(state, stream, "prop");
222
+ return pass(type, stream, state);
223
+ };
224
+
225
+ states.prop = function(type, stream, state) {
226
+ if (type == ";") return popContext(state);
227
+ if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
228
+ if (type == "}" || type == "{") return popAndPass(type, stream, state);
229
+ if (type == "(") return pushContext(state, stream, "parens");
230
+
231
+ if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
232
+ override += " error";
233
+ } else if (type == "word") {
234
+ wordAsValue(stream);
235
+ } else if (type == "interpolation") {
236
+ return pushContext(state, stream, "interpolation");
237
+ }
238
+ return "prop";
239
+ };
240
+
241
+ states.propBlock = function(type, _stream, state) {
242
+ if (type == "}") return popContext(state);
243
+ if (type == "word") { override = "property"; return "maybeprop"; }
244
+ return state.context.type;
245
+ };
246
+
247
+ states.parens = function(type, stream, state) {
248
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
249
+ if (type == ")") return popContext(state);
250
+ if (type == "(") return pushContext(state, stream, "parens");
251
+ if (type == "interpolation") return pushContext(state, stream, "interpolation");
252
+ if (type == "word") wordAsValue(stream);
253
+ return "parens";
254
+ };
255
+
256
+ states.pseudo = function(type, stream, state) {
257
+ if (type == "meta") return "pseudo";
258
+
259
+ if (type == "word") {
260
+ override = "variable-3";
261
+ return state.context.type;
262
+ }
263
+ return pass(type, stream, state);
264
+ };
265
+
266
+ states.documentTypes = function(type, stream, state) {
267
+ if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
268
+ override = "tag";
269
+ return state.context.type;
270
+ } else {
271
+ return states.atBlock(type, stream, state);
272
+ }
273
+ };
274
+
275
+ states.atBlock = function(type, stream, state) {
276
+ if (type == "(") return pushContext(state, stream, "atBlock_parens");
277
+ if (type == "}" || type == ";") return popAndPass(type, stream, state);
278
+ if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
279
+
280
+ if (type == "interpolation") return pushContext(state, stream, "interpolation");
281
+
282
+ if (type == "word") {
283
+ var word = stream.current().toLowerCase();
284
+ if (word == "only" || word == "not" || word == "and" || word == "or")
285
+ override = "keyword";
286
+ else if (mediaTypes.hasOwnProperty(word))
287
+ override = "attribute";
288
+ else if (mediaFeatures.hasOwnProperty(word))
289
+ override = "property";
290
+ else if (mediaValueKeywords.hasOwnProperty(word))
291
+ override = "keyword";
292
+ else if (propertyKeywords.hasOwnProperty(word))
293
+ override = "property";
294
+ else if (nonStandardPropertyKeywords.hasOwnProperty(word))
295
+ override = "string-2";
296
+ else if (valueKeywords.hasOwnProperty(word))
297
+ override = "atom";
298
+ else if (colorKeywords.hasOwnProperty(word))
299
+ override = "keyword";
300
+ else
301
+ override = "error";
302
+ }
303
+ return state.context.type;
304
+ };
305
+
306
+ states.atComponentBlock = function(type, stream, state) {
307
+ if (type == "}")
308
+ return popAndPass(type, stream, state);
309
+ if (type == "{")
310
+ return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
311
+ if (type == "word")
312
+ override = "error";
313
+ return state.context.type;
314
+ };
315
+
316
+ states.atBlock_parens = function(type, stream, state) {
317
+ if (type == ")") return popContext(state);
318
+ if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
319
+ return states.atBlock(type, stream, state);
320
+ };
321
+
322
+ states.restricted_atBlock_before = function(type, stream, state) {
323
+ if (type == "{")
324
+ return pushContext(state, stream, "restricted_atBlock");
325
+ if (type == "word" && state.stateArg == "@counter-style") {
326
+ override = "variable";
327
+ return "restricted_atBlock_before";
328
+ }
329
+ return pass(type, stream, state);
330
+ };
331
+
332
+ states.restricted_atBlock = function(type, stream, state) {
333
+ if (type == "}") {
334
+ state.stateArg = null;
335
+ return popContext(state);
336
+ }
337
+ if (type == "word") {
338
+ if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
339
+ (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
340
+ override = "error";
341
+ else
342
+ override = "property";
343
+ return "maybeprop";
344
+ }
345
+ return "restricted_atBlock";
346
+ };
347
+
348
+ states.keyframes = function(type, stream, state) {
349
+ if (type == "word") { override = "variable"; return "keyframes"; }
350
+ if (type == "{") return pushContext(state, stream, "top");
351
+ return pass(type, stream, state);
352
+ };
353
+
354
+ states.at = function(type, stream, state) {
355
+ if (type == ";") return popContext(state);
356
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
357
+ if (type == "word") override = "tag";
358
+ else if (type == "hash") override = "builtin";
359
+ return "at";
360
+ };
361
+
362
+ states.interpolation = function(type, stream, state) {
363
+ if (type == "}") return popContext(state);
364
+ if (type == "{" || type == ";") return popAndPass(type, stream, state);
365
+ if (type == "word") override = "variable";
366
+ else if (type != "variable" && type != "(" && type != ")") override = "error";
367
+ return "interpolation";
368
+ };
369
+
370
+ return {
371
+ startState: function(base) {
372
+ return {tokenize: null,
373
+ state: inline ? "block" : "top",
374
+ stateArg: null,
375
+ context: new Context(inline ? "block" : "top", base || 0, null)};
376
+ },
377
+
378
+ token: function(stream, state) {
379
+ if (!state.tokenize && stream.eatSpace()) return null;
380
+ var style = (state.tokenize || tokenBase)(stream, state);
381
+ if (style && typeof style == "object") {
382
+ type = style[1];
383
+ style = style[0];
384
+ }
385
+ override = style;
386
+ if (type != "comment")
387
+ state.state = states[state.state](type, stream, state);
388
+ return override;
389
+ },
390
+
391
+ indent: function(state, textAfter) {
392
+ var cx = state.context, ch = textAfter && textAfter.charAt(0);
393
+ var indent = cx.indent;
394
+ if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
395
+ if (cx.prev) {
396
+ if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
397
+ cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
398
+ // Resume indentation from parent context.
399
+ cx = cx.prev;
400
+ indent = cx.indent;
401
+ } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
402
+ ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
403
+ // Dedent relative to current context.
404
+ indent = Math.max(0, cx.indent - indentUnit);
405
+ }
406
+ }
407
+ return indent;
408
+ },
409
+
410
+ electricChars: "}",
411
+ blockCommentStart: "/*",
412
+ blockCommentEnd: "*/",
413
+ blockCommentContinue: " * ",
414
+ lineComment: lineComment,
415
+ fold: "brace"
416
+ };
417
+ });
418
+
419
+ function keySet(array) {
420
+ var keys = {};
421
+ for (var i = 0; i < array.length; ++i) {
422
+ keys[array[i].toLowerCase()] = true;
423
+ }
424
+ return keys;
425
+ }
426
+
427
+ var documentTypes_ = [
428
+ "domain", "regexp", "url", "url-prefix"
429
+ ], documentTypes = keySet(documentTypes_);
430
+
431
+ var mediaTypes_ = [
432
+ "all", "aural", "braille", "handheld", "print", "projection", "screen",
433
+ "tty", "tv", "embossed"
434
+ ], mediaTypes = keySet(mediaTypes_);
435
+
436
+ var mediaFeatures_ = [
437
+ "width", "min-width", "max-width", "height", "min-height", "max-height",
438
+ "device-width", "min-device-width", "max-device-width", "device-height",
439
+ "min-device-height", "max-device-height", "aspect-ratio",
440
+ "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
441
+ "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
442
+ "max-color", "color-index", "min-color-index", "max-color-index",
443
+ "monochrome", "min-monochrome", "max-monochrome", "resolution",
444
+ "min-resolution", "max-resolution", "scan", "grid", "orientation",
445
+ "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
446
+ "pointer", "any-pointer", "hover", "any-hover"
447
+ ], mediaFeatures = keySet(mediaFeatures_);
448
+
449
+ var mediaValueKeywords_ = [
450
+ "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
451
+ "interlace", "progressive"
452
+ ], mediaValueKeywords = keySet(mediaValueKeywords_);
453
+
454
+ var propertyKeywords_ = [
455
+ "align-content", "align-items", "align-self", "alignment-adjust",
456
+ "alignment-baseline", "anchor-point", "animation", "animation-delay",
457
+ "animation-direction", "animation-duration", "animation-fill-mode",
458
+ "animation-iteration-count", "animation-name", "animation-play-state",
459
+ "animation-timing-function", "appearance", "azimuth", "backface-visibility",
460
+ "background", "background-attachment", "background-blend-mode", "background-clip",
461
+ "background-color", "background-image", "background-origin", "background-position",
462
+ "background-repeat", "background-size", "baseline-shift", "binding",
463
+ "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
464
+ "bookmark-target", "border", "border-bottom", "border-bottom-color",
465
+ "border-bottom-left-radius", "border-bottom-right-radius",
466
+ "border-bottom-style", "border-bottom-width", "border-collapse",
467
+ "border-color", "border-image", "border-image-outset",
468
+ "border-image-repeat", "border-image-slice", "border-image-source",
469
+ "border-image-width", "border-left", "border-left-color",
470
+ "border-left-style", "border-left-width", "border-radius", "border-right",
471
+ "border-right-color", "border-right-style", "border-right-width",
472
+ "border-spacing", "border-style", "border-top", "border-top-color",
473
+ "border-top-left-radius", "border-top-right-radius", "border-top-style",
474
+ "border-top-width", "border-width", "bottom", "box-decoration-break",
475
+ "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
476
+ "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
477
+ "column-fill", "column-gap", "column-rule", "column-rule-color",
478
+ "column-rule-style", "column-rule-width", "column-span", "column-width",
479
+ "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
480
+ "cue-after", "cue-before", "cursor", "direction", "display",
481
+ "dominant-baseline", "drop-initial-after-adjust",
482
+ "drop-initial-after-align", "drop-initial-before-adjust",
483
+ "drop-initial-before-align", "drop-initial-size", "drop-initial-value",
484
+ "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
485
+ "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
486
+ "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
487
+ "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
488
+ "font-stretch", "font-style", "font-synthesis", "font-variant",
489
+ "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
490
+ "font-variant-ligatures", "font-variant-numeric", "font-variant-position",
491
+ "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
492
+ "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
493
+ "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
494
+ "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
495
+ "grid-template-rows", "hanging-punctuation", "height", "hyphens",
496
+ "icon", "image-orientation", "image-rendering", "image-resolution",
497
+ "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
498
+ "line-break", "line-height", "line-stacking", "line-stacking-ruby",
499
+ "line-stacking-shift", "line-stacking-strategy", "list-style",
500
+ "list-style-image", "list-style-position", "list-style-type", "margin",
501
+ "margin-bottom", "margin-left", "margin-right", "margin-top",
502
+ "marks", "marquee-direction", "marquee-loop",
503
+ "marquee-play-count", "marquee-speed", "marquee-style", "max-height",
504
+ "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
505
+ "nav-left", "nav-right", "nav-up", "object-fit", "object-position",
506
+ "opacity", "order", "orphans", "outline",
507
+ "outline-color", "outline-offset", "outline-style", "outline-width",
508
+ "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
509
+ "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
510
+ "page", "page-break-after", "page-break-before", "page-break-inside",
511
+ "page-policy", "pause", "pause-after", "pause-before", "perspective",
512
+ "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
513
+ "presentation-level", "punctuation-trim", "quotes", "region-break-after",
514
+ "region-break-before", "region-break-inside", "region-fragment",
515
+ "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
516
+ "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
517
+ "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
518
+ "shape-outside", "size", "speak", "speak-as", "speak-header",
519
+ "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
520
+ "tab-size", "table-layout", "target", "target-name", "target-new",
521
+ "target-position", "text-align", "text-align-last", "text-decoration",
522
+ "text-decoration-color", "text-decoration-line", "text-decoration-skip",
523
+ "text-decoration-style", "text-emphasis", "text-emphasis-color",
524
+ "text-emphasis-position", "text-emphasis-style", "text-height",
525
+ "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
526
+ "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
527
+ "text-wrap", "top", "transform", "transform-origin", "transform-style",
528
+ "transition", "transition-delay", "transition-duration",
529
+ "transition-property", "transition-timing-function", "unicode-bidi",
530
+ "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
531
+ "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
532
+ "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break",
533
+ "word-spacing", "word-wrap", "z-index",
534
+ // SVG-specific
535
+ "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
536
+ "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
537
+ "color-interpolation", "color-interpolation-filters",
538
+ "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
539
+ "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
540
+ "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
541
+ "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
542
+ "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
543
+ "glyph-orientation-vertical", "text-anchor", "writing-mode"
544
+ ], propertyKeywords = keySet(propertyKeywords_);
545
+
546
+ var nonStandardPropertyKeywords_ = [
547
+ "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
548
+ "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
549
+ "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
550
+ "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
551
+ "searchfield-results-decoration", "zoom"
552
+ ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
553
+
554
+ var fontProperties_ = [
555
+ "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
556
+ "font-stretch", "font-weight", "font-style"
557
+ ], fontProperties = keySet(fontProperties_);
558
+
559
+ var counterDescriptors_ = [
560
+ "additive-symbols", "fallback", "negative", "pad", "prefix", "range",
561
+ "speak-as", "suffix", "symbols", "system"
562
+ ], counterDescriptors = keySet(counterDescriptors_);
563
+
564
+ var colorKeywords_ = [
565
+ "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
566
+ "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
567
+ "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
568
+ "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
569
+ "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
570
+ "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
571
+ "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
572
+ "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
573
+ "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
574
+ "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
575
+ "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
576
+ "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
577
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
578
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
579
+ "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
580
+ "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
581
+ "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
582
+ "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
583
+ "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
584
+ "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
585
+ "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
586
+ "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
587
+ "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
588
+ "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
589
+ "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
590
+ "whitesmoke", "yellow", "yellowgreen"
591
+ ], colorKeywords = keySet(colorKeywords_);
592
+
593
+ var valueKeywords_ = [
594
+ "above", "absolute", "activeborder", "additive", "activecaption", "afar",
595
+ "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
596
+ "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
597
+ "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
598
+ "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
599
+ "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
600
+ "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
601
+ "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
602
+ "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
603
+ "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
604
+ "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
605
+ "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
606
+ "compact", "condensed", "contain", "content", "contents",
607
+ "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
608
+ "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
609
+ "decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
610
+ "destination-in", "destination-out", "destination-over", "devanagari", "difference",
611
+ "disc", "discard", "disclosure-closed", "disclosure-open", "document",
612
+ "dot-dash", "dot-dot-dash",
613
+ "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
614
+ "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
615
+ "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
616
+ "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
617
+ "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
618
+ "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
619
+ "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
620
+ "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
621
+ "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
622
+ "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
623
+ "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
624
+ "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
625
+ "help", "hidden", "hide", "higher", "highlight", "highlighttext",
626
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
627
+ "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
628
+ "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
629
+ "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
630
+ "italic", "japanese-formal", "japanese-informal", "justify", "kannada",
631
+ "katakana", "katakana-iroha", "keep-all", "khmer",
632
+ "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
633
+ "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
634
+ "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
635
+ "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
636
+ "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
637
+ "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
638
+ "media-controls-background", "media-current-time-display",
639
+ "media-fullscreen-button", "media-mute-button", "media-play-button",
640
+ "media-return-to-realtime-button", "media-rewind-button",
641
+ "media-seek-back-button", "media-seek-forward-button", "media-slider",
642
+ "media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
643
+ "media-volume-slider-container", "media-volume-sliderthumb", "medium",
644
+ "menu", "menulist", "menulist-button", "menulist-text",
645
+ "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
646
+ "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
647
+ "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
648
+ "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
649
+ "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
650
+ "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
651
+ "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
652
+ "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
653
+ "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
654
+ "progress", "push-button", "radial-gradient", "radio", "read-only",
655
+ "read-write", "read-write-plaintext-only", "rectangle", "region",
656
+ "relative", "repeat", "repeating-linear-gradient",
657
+ "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
658
+ "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
659
+ "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
660
+ "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
661
+ "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
662
+ "searchfield-cancel-button", "searchfield-decoration",
663
+ "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
664
+ "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
665
+ "simp-chinese-formal", "simp-chinese-informal", "single",
666
+ "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
667
+ "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
668
+ "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
669
+ "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
670
+ "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
671
+ "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
672
+ "table-caption", "table-cell", "table-column", "table-column-group",
673
+ "table-footer-group", "table-header-group", "table-row", "table-row-group",
674
+ "tamil",
675
+ "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
676
+ "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
677
+ "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
678
+ "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
679
+ "trad-chinese-formal", "trad-chinese-informal", "transform",
680
+ "translate", "translate3d", "translateX", "translateY", "translateZ",
681
+ "transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up",
682
+ "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
683
+ "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
684
+ "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
685
+ "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
686
+ "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
687
+ "xx-large", "xx-small"
688
+ ], valueKeywords = keySet(valueKeywords_);
689
+
690
+ var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
691
+ .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
692
+ .concat(valueKeywords_);
693
+ CodeMirror.registerHelper("hintWords", "css", allWords);
694
+
695
+ function tokenCComment(stream, state) {
696
+ var maybeEnd = false, ch;
697
+ while ((ch = stream.next()) != null) {
698
+ if (maybeEnd && ch == "/") {
699
+ state.tokenize = null;
700
+ break;
701
+ }
702
+ maybeEnd = (ch == "*");
703
+ }
704
+ return ["comment", "comment"];
705
+ }
706
+
707
+ CodeMirror.defineMIME("text/css", {
708
+ documentTypes: documentTypes,
709
+ mediaTypes: mediaTypes,
710
+ mediaFeatures: mediaFeatures,
711
+ mediaValueKeywords: mediaValueKeywords,
712
+ propertyKeywords: propertyKeywords,
713
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
714
+ fontProperties: fontProperties,
715
+ counterDescriptors: counterDescriptors,
716
+ colorKeywords: colorKeywords,
717
+ valueKeywords: valueKeywords,
718
+ tokenHooks: {
719
+ "/": function(stream, state) {
720
+ if (!stream.eat("*")) return false;
721
+ state.tokenize = tokenCComment;
722
+ return tokenCComment(stream, state);
723
+ }
724
+ },
725
+ name: "css"
726
+ });
727
+
728
+ CodeMirror.defineMIME("text/x-scss", {
729
+ mediaTypes: mediaTypes,
730
+ mediaFeatures: mediaFeatures,
731
+ mediaValueKeywords: mediaValueKeywords,
732
+ propertyKeywords: propertyKeywords,
733
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
734
+ colorKeywords: colorKeywords,
735
+ valueKeywords: valueKeywords,
736
+ fontProperties: fontProperties,
737
+ allowNested: true,
738
+ lineComment: "//",
739
+ tokenHooks: {
740
+ "/": function(stream, state) {
741
+ if (stream.eat("/")) {
742
+ stream.skipToEnd();
743
+ return ["comment", "comment"];
744
+ } else if (stream.eat("*")) {
745
+ state.tokenize = tokenCComment;
746
+ return tokenCComment(stream, state);
747
+ } else {
748
+ return ["operator", "operator"];
749
+ }
750
+ },
751
+ ":": function(stream) {
752
+ if (stream.match(/\s*\{/, false))
753
+ return [null, null]
754
+ return false;
755
+ },
756
+ "$": function(stream) {
757
+ stream.match(/^[\w-]+/);
758
+ if (stream.match(/^\s*:/, false))
759
+ return ["variable-2", "variable-definition"];
760
+ return ["variable-2", "variable"];
761
+ },
762
+ "#": function(stream) {
763
+ if (!stream.eat("{")) return false;
764
+ return [null, "interpolation"];
765
+ }
766
+ },
767
+ name: "css",
768
+ helperType: "scss"
769
+ });
770
+
771
+ CodeMirror.defineMIME("text/x-less", {
772
+ mediaTypes: mediaTypes,
773
+ mediaFeatures: mediaFeatures,
774
+ mediaValueKeywords: mediaValueKeywords,
775
+ propertyKeywords: propertyKeywords,
776
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
777
+ colorKeywords: colorKeywords,
778
+ valueKeywords: valueKeywords,
779
+ fontProperties: fontProperties,
780
+ allowNested: true,
781
+ lineComment: "//",
782
+ tokenHooks: {
783
+ "/": function(stream, state) {
784
+ if (stream.eat("/")) {
785
+ stream.skipToEnd();
786
+ return ["comment", "comment"];
787
+ } else if (stream.eat("*")) {
788
+ state.tokenize = tokenCComment;
789
+ return tokenCComment(stream, state);
790
+ } else {
791
+ return ["operator", "operator"];
792
+ }
793
+ },
794
+ "@": function(stream) {
795
+ if (stream.eat("{")) return [null, "interpolation"];
796
+ if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
797
+ stream.eatWhile(/[\w\\\-]/);
798
+ if (stream.match(/^\s*:/, false))
799
+ return ["variable-2", "variable-definition"];
800
+ return ["variable-2", "variable"];
801
+ },
802
+ "&": function() {
803
+ return ["atom", "atom"];
804
+ }
805
+ },
806
+ name: "css",
807
+ helperType: "less"
808
+ });
809
+
810
+ CodeMirror.defineMIME("text/x-gss", {
811
+ documentTypes: documentTypes,
812
+ mediaTypes: mediaTypes,
813
+ mediaFeatures: mediaFeatures,
814
+ propertyKeywords: propertyKeywords,
815
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
816
+ fontProperties: fontProperties,
817
+ counterDescriptors: counterDescriptors,
818
+ colorKeywords: colorKeywords,
819
+ valueKeywords: valueKeywords,
820
+ supportsAtComponent: true,
821
+ tokenHooks: {
822
+ "/": function(stream, state) {
823
+ if (!stream.eat("*")) return false;
824
+ state.tokenize = tokenCComment;
825
+ return tokenCComment(stream, state);
826
+ }
827
+ },
828
+ name: "css",
829
+ helperType: "gss"
830
+ });
831
+
832
+ });