active_admin_pro 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +5 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/active_admin_pro.js +41 -0
  6. data/app/assets/javascripts/active_admin_pro/actions/new.js +8 -0
  7. data/app/assets/javascripts/active_admin_pro/actions/show.js +12 -0
  8. data/app/assets/javascripts/active_admin_pro/components/codemirror_input.js +92 -0
  9. data/app/assets/javascripts/active_admin_pro/components/flashes.js +9 -0
  10. data/app/assets/javascripts/active_admin_pro/components/link.js +23 -0
  11. data/app/assets/javascripts/active_admin_pro/components/phone_input.js +52 -0
  12. data/app/assets/javascripts/active_admin_pro/components/select_input.js +31 -0
  13. data/app/assets/javascripts/active_admin_pro/components/sortable_handle.js +8 -0
  14. data/app/assets/javascripts/active_admin_pro/components/summernote_input.js +132 -0
  15. data/app/assets/javascripts/active_admin_pro/components/text_input.js +47 -0
  16. data/app/assets/javascripts/active_admin_pro/components/time_zone_input.js +51 -0
  17. data/app/assets/javascripts/active_admin_pro/components/title_to_slug.js +16 -0
  18. data/app/assets/stylesheets/active_admin_pro.scss +20 -0
  19. data/app/assets/stylesheets/active_admin_pro/breakpoints.scss +3 -0
  20. data/app/assets/stylesheets/active_admin_pro/components/_input_variables.scss +9 -0
  21. data/app/assets/stylesheets/active_admin_pro/components/actions.scss +13 -0
  22. data/app/assets/stylesheets/active_admin_pro/components/boolean_input.scss +13 -0
  23. data/app/assets/stylesheets/active_admin_pro/components/button.scss +7 -0
  24. data/app/assets/stylesheets/active_admin_pro/components/check_boxes_input.scss +38 -0
  25. data/app/assets/stylesheets/active_admin_pro/components/codemirror_input.scss +53 -0
  26. data/app/assets/stylesheets/active_admin_pro/components/comments.scss +17 -0
  27. data/app/assets/stylesheets/active_admin_pro/components/datepicker.scss +108 -0
  28. data/app/assets/stylesheets/active_admin_pro/components/dialog.scss +66 -0
  29. data/app/assets/stylesheets/active_admin_pro/components/dropdown_menu_button.scss +40 -0
  30. data/app/assets/stylesheets/active_admin_pro/components/fieldset.scss +26 -0
  31. data/app/assets/stylesheets/active_admin_pro/components/file_input.scss +27 -0
  32. data/app/assets/stylesheets/active_admin_pro/components/has_many_fields.scss +4 -0
  33. data/app/assets/stylesheets/active_admin_pro/components/inline_errors.scss +7 -0
  34. data/app/assets/stylesheets/active_admin_pro/components/link.scss +16 -0
  35. data/app/assets/stylesheets/active_admin_pro/components/panel.scss +62 -0
  36. data/app/assets/stylesheets/active_admin_pro/components/phone_input.scss +31 -0
  37. data/app/assets/stylesheets/active_admin_pro/components/radio_input.scss +38 -0
  38. data/app/assets/stylesheets/active_admin_pro/components/segmented_control.scss +41 -0
  39. data/app/assets/stylesheets/active_admin_pro/components/select_input.scss +42 -0
  40. data/app/assets/stylesheets/active_admin_pro/components/sortable_handle.scss +21 -0
  41. data/app/assets/stylesheets/active_admin_pro/components/string_input.scss +85 -0
  42. data/app/assets/stylesheets/active_admin_pro/components/summernote_input.scss +190 -0
  43. data/app/assets/stylesheets/active_admin_pro/components/table.scss +100 -0
  44. data/app/assets/stylesheets/active_admin_pro/components/text_input.scss +55 -0
  45. data/app/assets/stylesheets/active_admin_pro/functions/color.scss +130 -0
  46. data/app/assets/stylesheets/active_admin_pro/functions/text-color.scss +35 -0
  47. data/app/assets/stylesheets/active_admin_pro/layout/actions/comments.scss +14 -0
  48. data/app/assets/stylesheets/active_admin_pro/layout/actions/index.scss +88 -0
  49. data/app/assets/stylesheets/active_admin_pro/layout/actions/show.scss +25 -0
  50. data/app/assets/stylesheets/active_admin_pro/layout/body.scss +60 -0
  51. data/app/assets/stylesheets/active_admin_pro/layout/desktop/action_items.scss +32 -0
  52. data/app/assets/stylesheets/active_admin_pro/layout/desktop/actions/comments.scss +10 -0
  53. data/app/assets/stylesheets/active_admin_pro/layout/desktop/active_admin_content.scss +22 -0
  54. data/app/assets/stylesheets/active_admin_pro/layout/desktop/breadcrumbs.scss +57 -0
  55. data/app/assets/stylesheets/active_admin_pro/layout/desktop/navigation.scss +197 -0
  56. data/app/assets/stylesheets/active_admin_pro/layout/desktop/sidebar.scss +5 -0
  57. data/app/assets/stylesheets/active_admin_pro/layout/desktop/title_bar.scss +24 -0
  58. data/app/assets/stylesheets/active_admin_pro/layout/desktop/wrapper.scss +5 -0
  59. data/app/assets/stylesheets/active_admin_pro/layout/filters.scss +41 -0
  60. data/app/assets/stylesheets/active_admin_pro/layout/flashes.scss +52 -0
  61. data/app/assets/stylesheets/active_admin_pro/layout/footer.scss +3 -0
  62. data/app/assets/stylesheets/active_admin_pro/layout/mobile/actions/index.scss +7 -0
  63. data/app/assets/stylesheets/active_admin_pro/layout/tablet/actions/dashboard.scss +105 -0
  64. data/app/assets/stylesheets/active_admin_pro/layout/tablet/actions/index.scss +20 -0
  65. data/app/assets/stylesheets/active_admin_pro/layout/tablet/actions/show.scss +78 -0
  66. data/app/assets/stylesheets/active_admin_pro/layout/tablet/active_admin_content.scss +9 -0
  67. data/app/assets/stylesheets/active_admin_pro/layout/tablet/flashes.scss +5 -0
  68. data/app/assets/stylesheets/active_admin_pro/layout/tablet/navigation.scss +48 -0
  69. data/app/assets/stylesheets/active_admin_pro/layout/tablet/title_bar.scss +53 -0
  70. data/app/assets/stylesheets/active_admin_pro/mixins/button.scss +48 -0
  71. data/app/assets/stylesheets/active_admin_pro/variables.scss +10 -0
  72. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon.scss +87 -0
  73. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
  74. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-color.scss +26 -0
  75. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-radius.scss +48 -0
  76. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-style.scss +25 -0
  77. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_border-width.scss +25 -0
  78. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_buttons.scss +64 -0
  79. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_clearfix.scss +25 -0
  80. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_ellipsis.scss +30 -0
  81. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_font-stacks.scss +31 -0
  82. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_hide-text.scss +27 -0
  83. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_margin.scss +26 -0
  84. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_padding.scss +26 -0
  85. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_position.scss +48 -0
  86. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_prefixer.scss +66 -0
  87. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_retina-image.scss +25 -0
  88. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_size.scss +51 -0
  89. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_text-inputs.scss +113 -0
  90. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_timing-functions.scss +34 -0
  91. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_triangle.scss +63 -0
  92. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/addons/_word-wrap.scss +29 -0
  93. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_animation.scss +43 -0
  94. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_appearance.scss +3 -0
  95. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_backface-visibility.scss +3 -0
  96. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_background-image.scss +42 -0
  97. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_background.scss +55 -0
  98. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_border-image.scss +59 -0
  99. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_calc.scss +4 -0
  100. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_columns.scss +47 -0
  101. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_filter.scss +4 -0
  102. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_flex-box.scss +287 -0
  103. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_font-face.scss +24 -0
  104. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_font-feature-settings.scss +4 -0
  105. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_hidpi-media-query.scss +10 -0
  106. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_hyphens.scss +4 -0
  107. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_image-rendering.scss +14 -0
  108. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_keyframes.scss +36 -0
  109. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_linear-gradient.scss +38 -0
  110. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_perspective.scss +8 -0
  111. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_placeholder.scss +8 -0
  112. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_radial-gradient.scss +39 -0
  113. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_selection.scss +42 -0
  114. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_text-decoration.scss +19 -0
  115. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_transform.scss +15 -0
  116. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_transition.scss +71 -0
  117. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/css3/_user-select.scss +3 -0
  118. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_assign-inputs.scss +11 -0
  119. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_contains-falsy.scss +20 -0
  120. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_contains.scss +26 -0
  121. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-length.scss +11 -0
  122. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-light.scss +21 -0
  123. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-number.scss +11 -0
  124. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_is-size.scss +13 -0
  125. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_modular-scale.scss +69 -0
  126. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_px-to-em.scss +13 -0
  127. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_px-to-rem.scss +15 -0
  128. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_shade.scss +24 -0
  129. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_strip-units.scss +17 -0
  130. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_tint.scss +24 -0
  131. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_transition-property-name.scss +22 -0
  132. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/functions/_unpack.scss +27 -0
  133. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_convert-units.scss +21 -0
  134. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_directional-values.scss +96 -0
  135. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_font-source-declaration.scss +43 -0
  136. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  137. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-angle-parser.scss +25 -0
  138. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-gradient-parser.scss +41 -0
  139. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-positions-parser.scss +61 -0
  140. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
  141. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_radial-arg-parser.scss +69 -0
  142. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_radial-gradient-parser.scss +50 -0
  143. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_radial-positions-parser.scss +18 -0
  144. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_render-gradients.scss +26 -0
  145. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_shape-size-stripper.scss +10 -0
  146. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/helpers/_str-to-num.scss +50 -0
  147. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/settings/_asset-pipeline.scss +7 -0
  148. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/settings/_prefixer.scss +9 -0
  149. data/app/assets/stylesheets/active_admin_pro/vendor/bourbon/settings/_px-to-em.scss +1 -0
  150. data/app/assets/stylesheets/active_admin_pro/vendor/neat.scss +22 -0
  151. data/app/assets/stylesheets/active_admin_pro/vendor/neat/_neat-helpers.scss +8 -0
  152. data/app/assets/stylesheets/active_admin_pro/vendor/neat/functions/_new-breakpoint.scss +49 -0
  153. data/app/assets/stylesheets/active_admin_pro/vendor/neat/functions/_private.scss +108 -0
  154. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_box-sizing.scss +11 -0
  155. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_direction-context.scss +31 -0
  156. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_display-context.scss +26 -0
  157. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_fill-parent.scss +22 -0
  158. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_media.scss +92 -0
  159. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_omega.scss +91 -0
  160. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_outer-container.scss +36 -0
  161. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_pad.scss +23 -0
  162. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_private.scss +35 -0
  163. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_row.scss +53 -0
  164. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_shift.scss +48 -0
  165. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_span-columns.scss +90 -0
  166. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_to-deprecate.scss +105 -0
  167. data/app/assets/stylesheets/active_admin_pro/vendor/neat/grid/_visual-grid.scss +40 -0
  168. data/app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_disable-warnings.scss +11 -0
  169. data/app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_grid.scss +53 -0
  170. data/app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_visual-grid.scss +25 -0
  171. data/app/assets/stylesheets/active_admin_pro/vendor/normalize.css +423 -0
  172. data/app/assets/stylesheets/codemirror/themes/activeadmin_pro.scss +117 -0
  173. data/app/inputs/codemirror_input.rb +27 -0
  174. data/app/inputs/datepicker_input.rb +16 -0
  175. data/app/inputs/phone_input.rb +5 -0
  176. data/app/inputs/summernote_input.rb +5 -0
  177. data/app/inputs/time_zone_input.rb +43 -0
  178. data/app/models/activeadmin_pro/summernote_image.rb +5 -0
  179. data/config/initializers/active_admin.rb +50 -0
  180. data/config/locales/en.yml +55 -0
  181. data/lib/active_admin_pro/admin_user/admin_user.rb +52 -0
  182. data/lib/active_admin_pro/engine.rb +8 -0
  183. data/lib/active_admin_pro/summernote_image/summernote_image.rb +61 -0
  184. data/lib/active_admin_pro/user/user.rb +53 -0
  185. data/lib/active_admin_pro/version.rb +3 -0
  186. data/lib/activeadmin_pro.rb +9 -0
  187. data/lib/generators/activeadmin_pro/install_generator.rb +14 -0
  188. data/lib/tasks/activeadmin_pro_tasks.rake +4 -0
  189. data/spec/spec_helper.rb +34 -0
  190. data/vendor/assets/javascripts/bootstrap.js +1243 -0
  191. data/vendor/assets/javascripts/codemirror.js +8887 -0
  192. data/vendor/assets/javascripts/codemirror/addons/comment/comment.js +183 -0
  193. data/vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js +85 -0
  194. data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.css +32 -0
  195. data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js +157 -0
  196. data/vendor/assets/javascripts/codemirror/addons/display/autorefresh.js +47 -0
  197. data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.css +6 -0
  198. data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.js +41 -0
  199. data/vendor/assets/javascripts/codemirror/addons/display/panel.js +112 -0
  200. data/vendor/assets/javascripts/codemirror/addons/display/placeholder.js +60 -0
  201. data/vendor/assets/javascripts/codemirror/addons/display/rulers.js +63 -0
  202. data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +195 -0
  203. data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +169 -0
  204. data/vendor/assets/javascripts/codemirror/addons/edit/continuelist.js +51 -0
  205. data/vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js +120 -0
  206. data/vendor/assets/javascripts/codemirror/addons/edit/matchtags.js +66 -0
  207. data/vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js +27 -0
  208. data/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js +105 -0
  209. data/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js +57 -0
  210. data/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js +149 -0
  211. data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.css +20 -0
  212. data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +146 -0
  213. data/vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js +44 -0
  214. data/vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js +49 -0
  215. data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +182 -0
  216. data/vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js +41 -0
  217. data/vendor/assets/javascripts/codemirror/addons/hint/css-hint.js +60 -0
  218. data/vendor/assets/javascripts/codemirror/addons/hint/html-hint.js +348 -0
  219. data/vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js +146 -0
  220. data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.css +38 -0
  221. data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +386 -0
  222. data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +254 -0
  223. data/vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js +110 -0
  224. data/vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js +41 -0
  225. data/vendor/assets/javascripts/codemirror/addons/lint/css-lint.js +35 -0
  226. data/vendor/assets/javascripts/codemirror/addons/lint/html-lint.js +46 -0
  227. data/vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js +136 -0
  228. data/vendor/assets/javascripts/codemirror/addons/lint/json-lint.js +31 -0
  229. data/vendor/assets/javascripts/codemirror/addons/lint/lint.css +73 -0
  230. data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +231 -0
  231. data/vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js +28 -0
  232. data/vendor/assets/javascripts/codemirror/addons/merge/merge.css +112 -0
  233. data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +775 -0
  234. data/vendor/assets/javascripts/codemirror/addons/mode/loadmode.js +64 -0
  235. data/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js +123 -0
  236. data/vendor/assets/javascripts/codemirror/addons/mode/multiplex_test.js +33 -0
  237. data/vendor/assets/javascripts/codemirror/addons/mode/overlay.js +85 -0
  238. data/vendor/assets/javascripts/codemirror/addons/mode/simple.js +213 -0
  239. data/vendor/assets/javascripts/codemirror/addons/runmode/colorize.js +40 -0
  240. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js +157 -0
  241. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js +72 -0
  242. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js +178 -0
  243. data/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js +115 -0
  244. data/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js +46 -0
  245. data/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.css +66 -0
  246. data/vendor/assets/javascripts/codemirror/addons/scroll/simplescrollbars.js +147 -0
  247. data/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js +128 -0
  248. data/vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.css +8 -0
  249. data/vendor/assets/javascripts/codemirror/addons/search/matchesonscrollbar.js +97 -0
  250. data/vendor/assets/javascripts/codemirror/addons/search/search.js +228 -0
  251. data/vendor/assets/javascripts/codemirror/addons/search/searchcursor.js +189 -0
  252. data/vendor/assets/javascripts/codemirror/addons/selection/active-line.js +71 -0
  253. data/vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js +118 -0
  254. data/vendor/assets/javascripts/codemirror/addons/selection/selection-pointer.js +98 -0
  255. data/vendor/assets/javascripts/codemirror/addons/tern/tern.css +87 -0
  256. data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +700 -0
  257. data/vendor/assets/javascripts/codemirror/addons/tern/worker.js +44 -0
  258. data/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js +139 -0
  259. data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +366 -0
  260. data/vendor/assets/javascripts/codemirror/modes/css.js +823 -0
  261. data/vendor/assets/javascripts/codemirror/modes/diff.js +47 -0
  262. data/vendor/assets/javascripts/codemirror/modes/dockerfile.js +79 -0
  263. data/vendor/assets/javascripts/codemirror/modes/gfm.js +130 -0
  264. data/vendor/assets/javascripts/codemirror/modes/go.js +185 -0
  265. data/vendor/assets/javascripts/codemirror/modes/haml.js +159 -0
  266. data/vendor/assets/javascripts/codemirror/modes/handlebars.js +53 -0
  267. data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +28 -0
  268. data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +150 -0
  269. data/vendor/assets/javascripts/codemirror/modes/javascript.js +708 -0
  270. data/vendor/assets/javascripts/codemirror/modes/markdown.js +792 -0
  271. data/vendor/assets/javascripts/codemirror/modes/nginx.js +178 -0
  272. data/vendor/assets/javascripts/codemirror/modes/php.js +234 -0
  273. data/vendor/assets/javascripts/codemirror/modes/python.js +358 -0
  274. data/vendor/assets/javascripts/codemirror/modes/ruby.js +285 -0
  275. data/vendor/assets/javascripts/codemirror/modes/rust.js +58 -0
  276. data/vendor/assets/javascripts/codemirror/modes/sass.js +414 -0
  277. data/vendor/assets/javascripts/codemirror/modes/shell.js +139 -0
  278. data/vendor/assets/javascripts/codemirror/modes/xml.js +385 -0
  279. data/vendor/assets/javascripts/codemirror/modes/yaml.js +117 -0
  280. data/vendor/assets/javascripts/intl-tel-input.js +963 -0
  281. data/vendor/assets/javascripts/intl-tel-utils.js +480 -0
  282. data/vendor/assets/javascripts/slug.js +212 -0
  283. data/vendor/assets/javascripts/summernote.js +6939 -0
  284. data/vendor/assets/stylesheets/codemirror.css +334 -0
  285. data/vendor/assets/stylesheets/codemirror/themes/base16-dark.css +38 -0
  286. data/vendor/assets/stylesheets/codemirror/themes/base16-light.css +38 -0
  287. data/vendor/assets/stylesheets/codemirror/themes/dracula.css +41 -0
  288. data/vendor/assets/stylesheets/codemirror/themes/material.css +53 -0
  289. data/vendor/assets/stylesheets/codemirror/themes/monokai.css +35 -0
  290. data/vendor/assets/stylesheets/codemirror/themes/solarized.css +163 -0
  291. data/vendor/assets/stylesheets/codemirror/themes/vibrant-ink.css +34 -0
  292. data/vendor/assets/stylesheets/intl-tel-input.scss +1054 -0
  293. data/vendor/assets/stylesheets/summernote-bs3.css +5425 -0
  294. data/vendor/assets/stylesheets/summernote.css +1 -0
  295. metadata +604 -0
@@ -0,0 +1,285 @@
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("ruby", function(config) {
15
+ function wordObj(words) {
16
+ var o = {};
17
+ for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
18
+ return o;
19
+ }
20
+ var keywords = wordObj([
21
+ "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
22
+ "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
23
+ "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
24
+ "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
25
+ "caller", "lambda", "proc", "public", "protected", "private", "require", "load",
26
+ "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
27
+ ]);
28
+ var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then",
29
+ "catch", "loop", "proc", "begin"]);
30
+ var dedentWords = wordObj(["end", "until"]);
31
+ var matching = {"[": "]", "{": "}", "(": ")"};
32
+ var curPunc;
33
+
34
+ function chain(newtok, stream, state) {
35
+ state.tokenize.push(newtok);
36
+ return newtok(stream, state);
37
+ }
38
+
39
+ function tokenBase(stream, state) {
40
+ if (stream.sol() && stream.match("=begin") && stream.eol()) {
41
+ state.tokenize.push(readBlockComment);
42
+ return "comment";
43
+ }
44
+ if (stream.eatSpace()) return null;
45
+ var ch = stream.next(), m;
46
+ if (ch == "`" || ch == "'" || ch == '"') {
47
+ return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
48
+ } else if (ch == "/") {
49
+ var currentIndex = stream.current().length;
50
+ if (stream.skipTo("/")) {
51
+ var search_till = stream.current().length;
52
+ stream.backUp(stream.current().length - currentIndex);
53
+ var balance = 0; // balance brackets
54
+ while (stream.current().length < search_till) {
55
+ var chchr = stream.next();
56
+ if (chchr == "(") balance += 1;
57
+ else if (chchr == ")") balance -= 1;
58
+ if (balance < 0) break;
59
+ }
60
+ stream.backUp(stream.current().length - currentIndex);
61
+ if (balance == 0)
62
+ return chain(readQuoted(ch, "string-2", true), stream, state);
63
+ }
64
+ return "operator";
65
+ } else if (ch == "%") {
66
+ var style = "string", embed = true;
67
+ if (stream.eat("s")) style = "atom";
68
+ else if (stream.eat(/[WQ]/)) style = "string";
69
+ else if (stream.eat(/[r]/)) style = "string-2";
70
+ else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
71
+ var delim = stream.eat(/[^\w\s=]/);
72
+ if (!delim) return "operator";
73
+ if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
74
+ return chain(readQuoted(delim, style, embed, true), stream, state);
75
+ } else if (ch == "#") {
76
+ stream.skipToEnd();
77
+ return "comment";
78
+ } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
79
+ return chain(readHereDoc(m[1]), stream, state);
80
+ } else if (ch == "0") {
81
+ if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
82
+ else if (stream.eat("b")) stream.eatWhile(/[01]/);
83
+ else stream.eatWhile(/[0-7]/);
84
+ return "number";
85
+ } else if (/\d/.test(ch)) {
86
+ stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
87
+ return "number";
88
+ } else if (ch == "?") {
89
+ while (stream.match(/^\\[CM]-/)) {}
90
+ if (stream.eat("\\")) stream.eatWhile(/\w/);
91
+ else stream.next();
92
+ return "string";
93
+ } else if (ch == ":") {
94
+ if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
95
+ if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
96
+
97
+ // :> :>> :< :<< are valid symbols
98
+ if (stream.eat(/[\<\>]/)) {
99
+ stream.eat(/[\<\>]/);
100
+ return "atom";
101
+ }
102
+
103
+ // :+ :- :/ :* :| :& :! are valid symbols
104
+ if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
105
+ return "atom";
106
+ }
107
+
108
+ // Symbols can't start by a digit
109
+ if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) {
110
+ stream.eatWhile(/[\w$\xa1-\uffff]/);
111
+ // Only one ? ! = is allowed and only as the last character
112
+ stream.eat(/[\?\!\=]/);
113
+ return "atom";
114
+ }
115
+ return "operator";
116
+ } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) {
117
+ stream.eat("@");
118
+ stream.eatWhile(/[\w\xa1-\uffff]/);
119
+ return "variable-2";
120
+ } else if (ch == "$") {
121
+ if (stream.eat(/[a-zA-Z_]/)) {
122
+ stream.eatWhile(/[\w]/);
123
+ } else if (stream.eat(/\d/)) {
124
+ stream.eat(/\d/);
125
+ } else {
126
+ stream.next(); // Must be a special global like $: or $!
127
+ }
128
+ return "variable-3";
129
+ } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) {
130
+ stream.eatWhile(/[\w\xa1-\uffff]/);
131
+ stream.eat(/[\?\!]/);
132
+ if (stream.eat(":")) return "atom";
133
+ return "ident";
134
+ } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
135
+ curPunc = "|";
136
+ return null;
137
+ } else if (/[\(\)\[\]{}\\;]/.test(ch)) {
138
+ curPunc = ch;
139
+ return null;
140
+ } else if (ch == "-" && stream.eat(">")) {
141
+ return "arrow";
142
+ } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
143
+ var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
144
+ if (ch == "." && !more) curPunc = ".";
145
+ return "operator";
146
+ } else {
147
+ return null;
148
+ }
149
+ }
150
+
151
+ function tokenBaseUntilBrace(depth) {
152
+ if (!depth) depth = 1;
153
+ return function(stream, state) {
154
+ if (stream.peek() == "}") {
155
+ if (depth == 1) {
156
+ state.tokenize.pop();
157
+ return state.tokenize[state.tokenize.length-1](stream, state);
158
+ } else {
159
+ state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1);
160
+ }
161
+ } else if (stream.peek() == "{") {
162
+ state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1);
163
+ }
164
+ return tokenBase(stream, state);
165
+ };
166
+ }
167
+ function tokenBaseOnce() {
168
+ var alreadyCalled = false;
169
+ return function(stream, state) {
170
+ if (alreadyCalled) {
171
+ state.tokenize.pop();
172
+ return state.tokenize[state.tokenize.length-1](stream, state);
173
+ }
174
+ alreadyCalled = true;
175
+ return tokenBase(stream, state);
176
+ };
177
+ }
178
+ function readQuoted(quote, style, embed, unescaped) {
179
+ return function(stream, state) {
180
+ var escaped = false, ch;
181
+
182
+ if (state.context.type === 'read-quoted-paused') {
183
+ state.context = state.context.prev;
184
+ stream.eat("}");
185
+ }
186
+
187
+ while ((ch = stream.next()) != null) {
188
+ if (ch == quote && (unescaped || !escaped)) {
189
+ state.tokenize.pop();
190
+ break;
191
+ }
192
+ if (embed && ch == "#" && !escaped) {
193
+ if (stream.eat("{")) {
194
+ if (quote == "}") {
195
+ state.context = {prev: state.context, type: 'read-quoted-paused'};
196
+ }
197
+ state.tokenize.push(tokenBaseUntilBrace());
198
+ break;
199
+ } else if (/[@\$]/.test(stream.peek())) {
200
+ state.tokenize.push(tokenBaseOnce());
201
+ break;
202
+ }
203
+ }
204
+ escaped = !escaped && ch == "\\";
205
+ }
206
+ return style;
207
+ };
208
+ }
209
+ function readHereDoc(phrase) {
210
+ return function(stream, state) {
211
+ if (stream.match(phrase)) state.tokenize.pop();
212
+ else stream.skipToEnd();
213
+ return "string";
214
+ };
215
+ }
216
+ function readBlockComment(stream, state) {
217
+ if (stream.sol() && stream.match("=end") && stream.eol())
218
+ state.tokenize.pop();
219
+ stream.skipToEnd();
220
+ return "comment";
221
+ }
222
+
223
+ return {
224
+ startState: function() {
225
+ return {tokenize: [tokenBase],
226
+ indented: 0,
227
+ context: {type: "top", indented: -config.indentUnit},
228
+ continuedLine: false,
229
+ lastTok: null,
230
+ varList: false};
231
+ },
232
+
233
+ token: function(stream, state) {
234
+ curPunc = null;
235
+ if (stream.sol()) state.indented = stream.indentation();
236
+ var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
237
+ var thisTok = curPunc;
238
+ if (style == "ident") {
239
+ var word = stream.current();
240
+ style = state.lastTok == "." ? "property"
241
+ : keywords.propertyIsEnumerable(stream.current()) ? "keyword"
242
+ : /^[A-Z]/.test(word) ? "tag"
243
+ : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
244
+ : "variable";
245
+ if (style == "keyword") {
246
+ thisTok = word;
247
+ if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
248
+ else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
249
+ else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
250
+ kwtype = "indent";
251
+ else if (word == "do" && state.context.indented < state.indented)
252
+ kwtype = "indent";
253
+ }
254
+ }
255
+ if (curPunc || (style && style != "comment")) state.lastTok = thisTok;
256
+ if (curPunc == "|") state.varList = !state.varList;
257
+
258
+ if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
259
+ state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
260
+ else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
261
+ state.context = state.context.prev;
262
+
263
+ if (stream.eol())
264
+ state.continuedLine = (curPunc == "\\" || style == "operator");
265
+ return style;
266
+ },
267
+
268
+ indent: function(state, textAfter) {
269
+ if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
270
+ var firstChar = textAfter && textAfter.charAt(0);
271
+ var ct = state.context;
272
+ var closing = ct.type == matching[firstChar] ||
273
+ ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
274
+ return ct.indented + (closing ? 0 : config.indentUnit) +
275
+ (state.continuedLine ? config.indentUnit : 0);
276
+ },
277
+
278
+ electricChars: "}de", // enD and rescuE
279
+ lineComment: "#"
280
+ };
281
+ });
282
+
283
+ CodeMirror.defineMIME("text/x-ruby", "ruby");
284
+
285
+ });
@@ -0,0 +1,58 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineSimpleMode("rust",{
15
+ start:[
16
+ // string and byte string
17
+ {regex: /b?"(?:[^\\]|\\.)*?"/, token: "string"},
18
+ // raw string and raw byte string
19
+ {regex: /(b?r)(#*)(".*?)("\2)/, token: ["string", "string", "string", "string"]},
20
+ // character
21
+ {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"},
22
+ // byte
23
+ {regex: /b'(?:[^']|\\(?:['\\nrt0]|x[\da-fA-F]{2}))'/, token: "string-2"},
24
+
25
+ {regex: /(?:(?:[0-9][0-9_]*)(?:(?:[Ee][+-]?[0-9_]+)|\.[0-9_]+(?:[Ee][+-]?[0-9_]+)?)(?:f32|f64)?)|(?:0(?:b[01_]+|(?:o[0-7_]+)|(?:x[0-9a-fA-F_]+))|(?:[0-9][0-9_]*))(?:u8|u16|u32|u64|i8|i16|i32|i64|isize|usize)?/,
26
+ token: "number"},
27
+ {regex: /(let(?:\s+mut)?|fn|enum|mod|struct|type)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, token: ["keyword", null, "def"]},
28
+ {regex: /(?:abstract|alignof|as|box|break|continue|const|crate|do|else|enum|extern|fn|for|final|if|impl|in|loop|macro|match|mod|move|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, token: "keyword"},
29
+ {regex: /\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|f16|f32|f64|i8|i16|i32|i64|str|Option)\b/, token: "atom"},
30
+ {regex: /\b(?:true|false|Some|None|Ok|Err)\b/, token: "builtin"},
31
+ {regex: /\b(fn)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/,
32
+ token: ["keyword", null ,"def"]},
33
+ {regex: /#!?\[.*\]/, token: "meta"},
34
+ {regex: /\/\/.*/, token: "comment"},
35
+ {regex: /\/\*/, token: "comment", next: "comment"},
36
+ {regex: /[-+\/*=<>!]+/, token: "operator"},
37
+ {regex: /[a-zA-Z_]\w*!/,token: "variable-3"},
38
+ {regex: /[a-zA-Z_]\w*/, token: "variable"},
39
+ {regex: /[\{\[\(]/, indent: true},
40
+ {regex: /[\}\]\)]/, dedent: true}
41
+ ],
42
+ comment: [
43
+ {regex: /.*?\*\//, token: "comment", next: "start"},
44
+ {regex: /.*/, token: "comment"}
45
+ ],
46
+ meta: {
47
+ dontIndentStates: ["comment"],
48
+ electricInput: /^\s*\}$/,
49
+ blockCommentStart: "/*",
50
+ blockCommentEnd: "*/",
51
+ lineComment: "//",
52
+ fold: "brace"
53
+ }
54
+ });
55
+
56
+
57
+ CodeMirror.defineMIME("text/x-rustsrc", "rust");
58
+ });
@@ -0,0 +1,414 @@
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("sass", function(config) {
15
+ function tokenRegexp(words) {
16
+ return new RegExp("^" + words.join("|"));
17
+ }
18
+
19
+ var keywords = ["true", "false", "null", "auto"];
20
+ var keywordsRegexp = new RegExp("^" + keywords.join("|"));
21
+
22
+ var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-",
23
+ "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"];
24
+ var opRegexp = tokenRegexp(operators);
25
+
26
+ var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/;
27
+
28
+ function urlTokens(stream, state) {
29
+ var ch = stream.peek();
30
+
31
+ if (ch === ")") {
32
+ stream.next();
33
+ state.tokenizer = tokenBase;
34
+ return "operator";
35
+ } else if (ch === "(") {
36
+ stream.next();
37
+ stream.eatSpace();
38
+
39
+ return "operator";
40
+ } else if (ch === "'" || ch === '"') {
41
+ state.tokenizer = buildStringTokenizer(stream.next());
42
+ return "string";
43
+ } else {
44
+ state.tokenizer = buildStringTokenizer(")", false);
45
+ return "string";
46
+ }
47
+ }
48
+ function comment(indentation, multiLine) {
49
+ return function(stream, state) {
50
+ if (stream.sol() && stream.indentation() <= indentation) {
51
+ state.tokenizer = tokenBase;
52
+ return tokenBase(stream, state);
53
+ }
54
+
55
+ if (multiLine && stream.skipTo("*/")) {
56
+ stream.next();
57
+ stream.next();
58
+ state.tokenizer = tokenBase;
59
+ } else {
60
+ stream.skipToEnd();
61
+ }
62
+
63
+ return "comment";
64
+ };
65
+ }
66
+
67
+ function buildStringTokenizer(quote, greedy) {
68
+ if (greedy == null) { greedy = true; }
69
+
70
+ function stringTokenizer(stream, state) {
71
+ var nextChar = stream.next();
72
+ var peekChar = stream.peek();
73
+ var previousChar = stream.string.charAt(stream.pos-2);
74
+
75
+ var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\"));
76
+
77
+ if (endingString) {
78
+ if (nextChar !== quote && greedy) { stream.next(); }
79
+ state.tokenizer = tokenBase;
80
+ return "string";
81
+ } else if (nextChar === "#" && peekChar === "{") {
82
+ state.tokenizer = buildInterpolationTokenizer(stringTokenizer);
83
+ stream.next();
84
+ return "operator";
85
+ } else {
86
+ return "string";
87
+ }
88
+ }
89
+
90
+ return stringTokenizer;
91
+ }
92
+
93
+ function buildInterpolationTokenizer(currentTokenizer) {
94
+ return function(stream, state) {
95
+ if (stream.peek() === "}") {
96
+ stream.next();
97
+ state.tokenizer = currentTokenizer;
98
+ return "operator";
99
+ } else {
100
+ return tokenBase(stream, state);
101
+ }
102
+ };
103
+ }
104
+
105
+ function indent(state) {
106
+ if (state.indentCount == 0) {
107
+ state.indentCount++;
108
+ var lastScopeOffset = state.scopes[0].offset;
109
+ var currentOffset = lastScopeOffset + config.indentUnit;
110
+ state.scopes.unshift({ offset:currentOffset });
111
+ }
112
+ }
113
+
114
+ function dedent(state) {
115
+ if (state.scopes.length == 1) return;
116
+
117
+ state.scopes.shift();
118
+ }
119
+
120
+ function tokenBase(stream, state) {
121
+ var ch = stream.peek();
122
+
123
+ // Comment
124
+ if (stream.match("/*")) {
125
+ state.tokenizer = comment(stream.indentation(), true);
126
+ return state.tokenizer(stream, state);
127
+ }
128
+ if (stream.match("//")) {
129
+ state.tokenizer = comment(stream.indentation(), false);
130
+ return state.tokenizer(stream, state);
131
+ }
132
+
133
+ // Interpolation
134
+ if (stream.match("#{")) {
135
+ state.tokenizer = buildInterpolationTokenizer(tokenBase);
136
+ return "operator";
137
+ }
138
+
139
+ // Strings
140
+ if (ch === '"' || ch === "'") {
141
+ stream.next();
142
+ state.tokenizer = buildStringTokenizer(ch);
143
+ return "string";
144
+ }
145
+
146
+ if(!state.cursorHalf){// state.cursorHalf === 0
147
+ // first half i.e. before : for key-value pairs
148
+ // including selectors
149
+
150
+ if (ch === ".") {
151
+ stream.next();
152
+ if (stream.match(/^[\w-]+/)) {
153
+ indent(state);
154
+ return "atom";
155
+ } else if (stream.peek() === "#") {
156
+ indent(state);
157
+ return "atom";
158
+ }
159
+ }
160
+
161
+ if (ch === "#") {
162
+ stream.next();
163
+ // ID selectors
164
+ if (stream.match(/^[\w-]+/)) {
165
+ indent(state);
166
+ return "atom";
167
+ }
168
+ if (stream.peek() === "#") {
169
+ indent(state);
170
+ return "atom";
171
+ }
172
+ }
173
+
174
+ // Variables
175
+ if (ch === "$") {
176
+ stream.next();
177
+ stream.eatWhile(/[\w-]/);
178
+ return "variable-2";
179
+ }
180
+
181
+ // Numbers
182
+ if (stream.match(/^-?[0-9\.]+/))
183
+ return "number";
184
+
185
+ // Units
186
+ if (stream.match(/^(px|em|in)\b/))
187
+ return "unit";
188
+
189
+ if (stream.match(keywordsRegexp))
190
+ return "keyword";
191
+
192
+ if (stream.match(/^url/) && stream.peek() === "(") {
193
+ state.tokenizer = urlTokens;
194
+ return "atom";
195
+ }
196
+
197
+ if (ch === "=") {
198
+ // Match shortcut mixin definition
199
+ if (stream.match(/^=[\w-]+/)) {
200
+ indent(state);
201
+ return "meta";
202
+ }
203
+ }
204
+
205
+ if (ch === "+") {
206
+ // Match shortcut mixin definition
207
+ if (stream.match(/^\+[\w-]+/)){
208
+ return "variable-3";
209
+ }
210
+ }
211
+
212
+ if(ch === "@"){
213
+ if(stream.match(/@extend/)){
214
+ if(!stream.match(/\s*[\w]/))
215
+ dedent(state);
216
+ }
217
+ }
218
+
219
+
220
+ // Indent Directives
221
+ if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) {
222
+ indent(state);
223
+ return "meta";
224
+ }
225
+
226
+ // Other Directives
227
+ if (ch === "@") {
228
+ stream.next();
229
+ stream.eatWhile(/[\w-]/);
230
+ return "meta";
231
+ }
232
+
233
+ if (stream.eatWhile(/[\w-]/)){
234
+ if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){
235
+ return "property";
236
+ }
237
+ else if(stream.match(/ *:/,false)){
238
+ indent(state);
239
+ state.cursorHalf = 1;
240
+ return "atom";
241
+ }
242
+ else if(stream.match(/ *,/,false)){
243
+ return "atom";
244
+ }
245
+ else{
246
+ indent(state);
247
+ return "atom";
248
+ }
249
+ }
250
+
251
+ if(ch === ":"){
252
+ if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element
253
+ return "keyword";
254
+ }
255
+ stream.next();
256
+ state.cursorHalf=1;
257
+ return "operator";
258
+ }
259
+
260
+ } // cursorHalf===0 ends here
261
+ else{
262
+
263
+ if (ch === "#") {
264
+ stream.next();
265
+ // Hex numbers
266
+ if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){
267
+ if(!stream.peek()){
268
+ state.cursorHalf = 0;
269
+ }
270
+ return "number";
271
+ }
272
+ }
273
+
274
+ // Numbers
275
+ if (stream.match(/^-?[0-9\.]+/)){
276
+ if(!stream.peek()){
277
+ state.cursorHalf = 0;
278
+ }
279
+ return "number";
280
+ }
281
+
282
+ // Units
283
+ if (stream.match(/^(px|em|in)\b/)){
284
+ if(!stream.peek()){
285
+ state.cursorHalf = 0;
286
+ }
287
+ return "unit";
288
+ }
289
+
290
+ if (stream.match(keywordsRegexp)){
291
+ if(!stream.peek()){
292
+ state.cursorHalf = 0;
293
+ }
294
+ return "keyword";
295
+ }
296
+
297
+ if (stream.match(/^url/) && stream.peek() === "(") {
298
+ state.tokenizer = urlTokens;
299
+ if(!stream.peek()){
300
+ state.cursorHalf = 0;
301
+ }
302
+ return "atom";
303
+ }
304
+
305
+ // Variables
306
+ if (ch === "$") {
307
+ stream.next();
308
+ stream.eatWhile(/[\w-]/);
309
+ if(!stream.peek()){
310
+ state.cursorHalf = 0;
311
+ }
312
+ return "variable-3";
313
+ }
314
+
315
+ // bang character for !important, !default, etc.
316
+ if (ch === "!") {
317
+ stream.next();
318
+ if(!stream.peek()){
319
+ state.cursorHalf = 0;
320
+ }
321
+ return stream.match(/^[\w]+/) ? "keyword": "operator";
322
+ }
323
+
324
+ if (stream.match(opRegexp)){
325
+ if(!stream.peek()){
326
+ state.cursorHalf = 0;
327
+ }
328
+ return "operator";
329
+ }
330
+
331
+ // attributes
332
+ if (stream.eatWhile(/[\w-]/)) {
333
+ if(!stream.peek()){
334
+ state.cursorHalf = 0;
335
+ }
336
+ return "attribute";
337
+ }
338
+
339
+ //stream.eatSpace();
340
+ if(!stream.peek()){
341
+ state.cursorHalf = 0;
342
+ return null;
343
+ }
344
+
345
+ } // else ends here
346
+
347
+ if (stream.match(opRegexp))
348
+ return "operator";
349
+
350
+ // If we haven't returned by now, we move 1 character
351
+ // and return an error
352
+ stream.next();
353
+ return null;
354
+ }
355
+
356
+ function tokenLexer(stream, state) {
357
+ if (stream.sol()) state.indentCount = 0;
358
+ var style = state.tokenizer(stream, state);
359
+ var current = stream.current();
360
+
361
+ if (current === "@return" || current === "}"){
362
+ dedent(state);
363
+ }
364
+
365
+ if (style !== null) {
366
+ var startOfToken = stream.pos - current.length;
367
+
368
+ var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount);
369
+
370
+ var newScopes = [];
371
+
372
+ for (var i = 0; i < state.scopes.length; i++) {
373
+ var scope = state.scopes[i];
374
+
375
+ if (scope.offset <= withCurrentIndent)
376
+ newScopes.push(scope);
377
+ }
378
+
379
+ state.scopes = newScopes;
380
+ }
381
+
382
+
383
+ return style;
384
+ }
385
+
386
+ return {
387
+ startState: function() {
388
+ return {
389
+ tokenizer: tokenBase,
390
+ scopes: [{offset: 0, type: "sass"}],
391
+ indentCount: 0,
392
+ cursorHalf: 0, // cursor half tells us if cursor lies after (1)
393
+ // or before (0) colon (well... more or less)
394
+ definedVars: [],
395
+ definedMixins: []
396
+ };
397
+ },
398
+ token: function(stream, state) {
399
+ var style = tokenLexer(stream, state);
400
+
401
+ state.lastToken = { style: style, content: stream.current() };
402
+
403
+ return style;
404
+ },
405
+
406
+ indent: function(state) {
407
+ return state.scopes[0].offset;
408
+ }
409
+ };
410
+ });
411
+
412
+ CodeMirror.defineMIME("text/x-sass", "sass");
413
+
414
+ });