storytime 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (359) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +17 -0
  7. data/Gemfile.lock +448 -0
  8. data/Guardfile +24 -0
  9. data/MIT-LICENSE +1 -1
  10. data/README.md +160 -0
  11. data/app/assets/{javascripts/storytime/subscriptions.js → images/storytime/.keep} +0 -0
  12. data/app/assets/images/storytime/storytime-logo-nav-light.png +0 -0
  13. data/app/assets/images/storytime/storytime-logo-nav.png +0 -0
  14. data/app/assets/images/storytime/storytime-logo.png +0 -0
  15. data/app/assets/javascripts/storytime/application.js +11 -3
  16. data/app/assets/javascripts/storytime/base.js.coffee +44 -6
  17. data/app/assets/javascripts/storytime/blog_posts.js.coffee +16 -0
  18. data/app/assets/javascripts/storytime/blogs.js.coffee +18 -0
  19. data/app/assets/javascripts/storytime/character_counter.js.coffee +26 -0
  20. data/app/assets/javascripts/storytime/contenteditable.js.coffee +15 -0
  21. data/app/assets/javascripts/storytime/custom_posts.js.coffee +16 -0
  22. data/app/assets/javascripts/storytime/editor.js.coffee +50 -134
  23. data/app/assets/javascripts/storytime/media.js.coffee +91 -22
  24. data/app/assets/javascripts/storytime/pages.js.coffee +16 -0
  25. data/app/assets/javascripts/storytime/posts.js.coffee +28 -1
  26. data/app/assets/javascripts/storytime/sites.js.coffee +1 -16
  27. data/app/assets/javascripts/storytime/snippets.js.coffee +6 -3
  28. data/app/assets/javascripts/storytime/tags.js.coffee +17 -0
  29. data/app/assets/javascripts/storytime/users.js.coffee +10 -0
  30. data/app/assets/javascripts/storytime/wysiwyg.js.coffee +183 -0
  31. data/app/assets/stylesheets/storytime/_buttons.scss +70 -0
  32. data/app/assets/stylesheets/storytime/_dropdowns.scss +5 -0
  33. data/app/assets/stylesheets/storytime/_forms.scss +3 -0
  34. data/app/assets/stylesheets/storytime/_list-group.scss +13 -0
  35. data/app/assets/stylesheets/storytime/_pagination.scss +14 -0
  36. data/app/assets/stylesheets/storytime/_panels.scss +8 -0
  37. data/app/assets/stylesheets/storytime/_tabs.scss +38 -0
  38. data/app/assets/stylesheets/storytime/_type.scss +13 -0
  39. data/app/assets/stylesheets/storytime/_wells.scss +14 -0
  40. data/app/assets/stylesheets/storytime/admin.scss +42 -0
  41. data/app/assets/stylesheets/storytime/application.scss +75 -0
  42. data/app/assets/stylesheets/storytime/{comments.css.scss → comments.scss} +0 -0
  43. data/app/assets/stylesheets/storytime/icons.scss +79 -0
  44. data/app/assets/stylesheets/storytime/layout.scss +21 -0
  45. data/app/assets/stylesheets/storytime/media.scss +65 -0
  46. data/app/assets/stylesheets/storytime/modals.scss +46 -0
  47. data/app/assets/stylesheets/storytime/navigation.scss +137 -0
  48. data/app/assets/stylesheets/storytime/posts.scss +76 -0
  49. data/app/assets/stylesheets/storytime/scroll-panels.scss +19 -0
  50. data/app/assets/stylesheets/storytime/snippets.scss +11 -0
  51. data/app/assets/stylesheets/storytime/{sites.css.scss → subscriptions.scss} +0 -0
  52. data/app/assets/stylesheets/storytime/versions.scss +21 -0
  53. data/app/controllers/storytime/application_controller.rb +36 -16
  54. data/app/controllers/storytime/blog_homepage_controller.rb +10 -0
  55. data/app/controllers/storytime/blogs_controller.rb +56 -0
  56. data/app/controllers/storytime/comments_controller.rb +5 -1
  57. data/app/controllers/storytime/dashboard/autosaves_controller.rb +7 -3
  58. data/app/controllers/storytime/dashboard/blog_posts_controller.rb +60 -0
  59. data/app/controllers/storytime/dashboard/blogs_controller.rb +66 -0
  60. data/app/controllers/storytime/dashboard/custom_posts_controller.rb +51 -0
  61. data/app/controllers/storytime/dashboard/media_controller.rb +9 -7
  62. data/app/controllers/storytime/dashboard/memberships_controller.rb +49 -0
  63. data/app/controllers/storytime/dashboard/pages_controller.rb +24 -0
  64. data/app/controllers/storytime/dashboard/posts_controller.rb +29 -38
  65. data/app/controllers/storytime/dashboard/roles_controller.rb +16 -2
  66. data/app/controllers/storytime/dashboard/sites_controller.rb +25 -11
  67. data/app/controllers/storytime/dashboard/snippets_controller.rb +19 -14
  68. data/app/controllers/storytime/dashboard/subscriptions_controller.rb +9 -5
  69. data/app/controllers/storytime/dashboard/users_controller.rb +24 -22
  70. data/app/controllers/storytime/dashboard_controller.rb +9 -3
  71. data/app/controllers/storytime/homepage_controller.rb +10 -0
  72. data/app/controllers/storytime/pages_controller.rb +30 -13
  73. data/app/controllers/storytime/posts_controller.rb +22 -53
  74. data/app/controllers/storytime/subscriptions_controller.rb +5 -4
  75. data/app/helpers/storytime/application_helper.rb +28 -7
  76. data/app/helpers/storytime/dashboard/sites_helper.rb +2 -5
  77. data/app/helpers/storytime/subscriptions_helper.rb +0 -7
  78. data/app/inputs/date_time_picker_input.rb +1 -1
  79. data/app/mailers/storytime/subscription_mailer.rb +1 -3
  80. data/app/models/concerns/storytime/post_comments.rb +17 -0
  81. data/app/models/concerns/storytime/post_excerpt.rb +14 -0
  82. data/app/models/concerns/storytime/post_featured_images.rb +8 -0
  83. data/app/models/concerns/storytime/post_partial_inheritance.rb +29 -0
  84. data/app/models/concerns/storytime/post_tags.rb +41 -0
  85. data/app/models/concerns/storytime/scoped_to_site.rb +11 -0
  86. data/app/models/storytime/action.rb +1 -0
  87. data/app/models/storytime/autosave.rb +7 -1
  88. data/app/models/storytime/blog.rb +16 -0
  89. data/app/models/storytime/blog_post.rb +12 -1
  90. data/app/models/storytime/comment.rb +4 -1
  91. data/app/models/storytime/media.rb +2 -0
  92. data/app/models/storytime/membership.rb +17 -0
  93. data/app/models/storytime/page.rb +0 -5
  94. data/app/models/storytime/permission.rb +26 -20
  95. data/app/models/storytime/post.rb +29 -82
  96. data/app/models/storytime/role.rb +12 -0
  97. data/app/models/storytime/site.rb +42 -12
  98. data/app/models/storytime/snippet.rb +3 -0
  99. data/app/models/storytime/subscription.rb +2 -1
  100. data/app/models/storytime/tag.rb +5 -1
  101. data/app/models/storytime/tagging.rb +1 -0
  102. data/app/models/storytime/version.rb +1 -0
  103. data/app/policies/admin_policy.rb +30 -0
  104. data/app/policies/storytime/comment_policy.rb +5 -1
  105. data/app/policies/storytime/membership_policy.rb +32 -0
  106. data/app/policies/storytime/post_policy.rb +6 -4
  107. data/app/policies/storytime/site_policy.rb +7 -2
  108. data/app/policies/storytime/snippet_policy.rb +3 -2
  109. data/app/policies/storytime/subscription_policy.rb +3 -2
  110. data/app/policies/user_policy.rb +2 -5
  111. data/app/views/kaminari/_first_page.html.erb +13 -0
  112. data/app/views/kaminari/_gap.html.erb +8 -0
  113. data/app/views/kaminari/_last_page.html.erb +13 -0
  114. data/app/views/kaminari/_next_page.html.erb +13 -0
  115. data/app/views/kaminari/_page.html.erb +12 -0
  116. data/app/views/kaminari/_paginator.html.erb +24 -0
  117. data/app/views/kaminari/_prev_page.html.erb +13 -0
  118. data/app/views/layouts/storytime/application.html.erb +1 -1
  119. data/app/views/layouts/storytime/dashboard.html.erb +22 -6
  120. data/app/views/storytime/application/storytime/_disqus_comment_counts.html.erb +14 -0
  121. data/app/views/storytime/application/storytime/_header.html.erb +3 -4
  122. data/app/views/storytime/application/storytime/_navigation.html.erb +14 -1
  123. data/app/views/storytime/blogs/_tags.html.erb +3 -0
  124. data/app/views/storytime/{posts/index.atom.builder → blogs/show.atom.builder} +1 -1
  125. data/app/views/storytime/{posts/index.html.erb → blogs/show.html.erb} +1 -1
  126. data/app/views/storytime/comments/_discourse.html.erb +18 -0
  127. data/app/views/storytime/comments/_disqus.html.erb +2 -2
  128. data/app/views/storytime/comments/_form.html.erb +2 -2
  129. data/app/views/storytime/dashboard/_navigation.html.erb +109 -41
  130. data/app/views/storytime/dashboard/_settings_tabs.html.erb +32 -0
  131. data/app/views/storytime/dashboard/autosaves/_autosave_info.html.erb +7 -4
  132. data/app/views/storytime/dashboard/blog_posts/_form.html.erb +157 -0
  133. data/app/views/storytime/dashboard/blog_posts/edit.html.erb +55 -0
  134. data/app/views/storytime/dashboard/blog_posts/new.html.erb +31 -0
  135. data/app/views/storytime/dashboard/blogs/_blog.html.erb +3 -0
  136. data/app/views/storytime/dashboard/blogs/_form.html.erb +25 -0
  137. data/app/views/storytime/dashboard/blogs/edit.json.jbuilder +1 -0
  138. data/app/views/storytime/dashboard/blogs/index.json.jbuilder +1 -0
  139. data/app/views/storytime/dashboard/blogs/new.json.jbuilder +1 -0
  140. data/app/views/storytime/dashboard/media/_form.html.erb +3 -3
  141. data/app/views/storytime/dashboard/media/{_gallery.html → _gallery.html.erb} +7 -4
  142. data/app/views/storytime/dashboard/media/_media.html.erb +6 -13
  143. data/app/views/storytime/dashboard/media/_modal.html.erb +3 -3
  144. data/app/views/storytime/dashboard/media/index.html.erb +15 -5
  145. data/app/views/storytime/dashboard/memberships/_form.html.erb +12 -0
  146. data/app/views/storytime/dashboard/memberships/_index.html.erb +39 -0
  147. data/app/views/storytime/dashboard/memberships/_membership.html.erb +12 -0
  148. data/app/views/storytime/dashboard/memberships/index.json.jbuilder +2 -0
  149. data/app/views/storytime/dashboard/memberships/save.json.jbuilder +1 -0
  150. data/app/views/storytime/dashboard/pages/_form.html.erb +88 -0
  151. data/app/views/storytime/dashboard/pages/_index_title.html.erb +1 -0
  152. data/app/views/storytime/dashboard/pages/_new_button.html.erb +1 -0
  153. data/app/views/storytime/dashboard/pages/edit.html.erb +49 -0
  154. data/app/views/storytime/dashboard/pages/new.html.erb +28 -0
  155. data/app/views/storytime/dashboard/posts/_form.html.erb +128 -122
  156. data/app/views/storytime/dashboard/posts/_image_toolbar.html.erb +32 -0
  157. data/app/views/storytime/dashboard/posts/_index_title.html.erb +1 -0
  158. data/app/views/storytime/dashboard/posts/_list.html.erb +23 -24
  159. data/app/views/storytime/dashboard/posts/_new_button.html.erb +10 -0
  160. data/app/views/storytime/dashboard/posts/edit.html.erb +56 -13
  161. data/app/views/storytime/dashboard/posts/index.html.erb +56 -7
  162. data/app/views/storytime/dashboard/posts/new.html.erb +29 -8
  163. data/app/views/storytime/dashboard/roles/_form.html.erb +41 -0
  164. data/app/views/storytime/dashboard/roles/edit.json.jbuilder +1 -0
  165. data/app/views/storytime/dashboard/sites/_form.html.erb +31 -15
  166. data/app/views/storytime/dashboard/sites/new.html.erb +21 -8
  167. data/app/views/storytime/dashboard/sites/site.json.jbuilder +2 -0
  168. data/app/views/storytime/dashboard/snippets/_form.html.erb +26 -12
  169. data/app/views/storytime/dashboard/snippets/_index.html.erb +17 -0
  170. data/app/views/storytime/dashboard/snippets/_snippet.html.erb +12 -0
  171. data/app/views/storytime/dashboard/snippets/edit.json.jbuilder +1 -0
  172. data/app/views/storytime/dashboard/snippets/index.json.jbuilder +4 -0
  173. data/app/views/storytime/dashboard/snippets/new.json.jbuilder +1 -0
  174. data/app/views/storytime/dashboard/subscriptions/_form.html.erb +19 -0
  175. data/app/views/storytime/dashboard/subscriptions/_index.html.erb +19 -0
  176. data/app/views/storytime/dashboard/subscriptions/_subscription.html.erb +9 -10
  177. data/app/views/storytime/dashboard/subscriptions/form.json.jbuilder +1 -0
  178. data/app/views/storytime/dashboard/subscriptions/index.json.jbuilder +1 -0
  179. data/app/views/storytime/dashboard/users/_edit.html.erb +26 -0
  180. data/app/views/storytime/dashboard/users/_new.html.erb +25 -0
  181. data/app/views/storytime/dashboard/users/edit.json.jbuilder +2 -0
  182. data/app/views/storytime/dashboard/users/new.json.jbuilder +2 -0
  183. data/app/views/storytime/dashboard/versions/_version.html.erb +14 -0
  184. data/app/views/storytime/dashboard/versions/_versions_info.html.erb +1 -16
  185. data/app/views/storytime/pages/show.html.erb +1 -1
  186. data/app/views/storytime/posts/_post.html.erb +8 -0
  187. data/app/views/storytime/posts/_tags.html.erb +1 -1
  188. data/app/views/storytime/posts/show.html.erb +1 -1
  189. data/app/views/storytime/sites/_google_analytics_code.html.erb +2 -2
  190. data/app/views/storytime/snippets/_snippet.html.erb +9 -0
  191. data/app/views/storytime/subscription_mailer/new_post_email.html.erb +2 -2
  192. data/app/views/storytime/subscription_mailer/new_post_email.text.erb +2 -2
  193. data/app/views/storytime/subscriptions/_form.html.erb +0 -1
  194. data/app/views/storytime/subscriptions/_modal.html.erb +18 -10
  195. data/bin/rails +12 -0
  196. data/bin/storytime +4 -0
  197. data/circle.yml +3 -0
  198. data/config/initializers/storytime_admin.rb +3 -0
  199. data/config/initializers/url_for_patch.rb +2 -37
  200. data/config/locales/en.yml +33 -13
  201. data/config/routes.rb +47 -19
  202. data/db/migrate/20150128185746_seed_new_actions_and_permissions.rb +9 -0
  203. data/db/migrate/20150206201847_add_site_id_to_storytime_post.rb +7 -0
  204. data/db/migrate/20150206201919_add_site_id_to_storytime_snippet.rb +7 -0
  205. data/db/migrate/20150206201931_add_site_id_to_storytime_tag.rb +7 -0
  206. data/db/migrate/20150206205256_add_notification_fields_to_storytime_post.rb +6 -0
  207. data/db/migrate/20150216211257_add_subdomain_to_storytime_sites.rb +5 -0
  208. data/db/migrate/20150216225045_add_site_to_storytime_media.rb +6 -0
  209. data/db/migrate/20150219210528_remove_root_page_content_from_storytime_sites.rb +12 -0
  210. data/db/migrate/20150220184902_add_blog_id_to_posts.rb +6 -0
  211. data/db/migrate/20150224192138_add_homepage_path_to_storytime_sites.rb +5 -0
  212. data/db/migrate/20150224193151_add_subscription_email_from_to_storytime_sites.rb +5 -0
  213. data/db/migrate/20150224193551_add_layout_to_storytime_sites.rb +5 -0
  214. data/db/migrate/20150224194559_add_disqus_forum_shortname_to_storytime_sites.rb +5 -0
  215. data/db/migrate/20150224212453_remove_homepage_path_from_storytime_sites.rb +5 -0
  216. data/db/migrate/20150225143516_add_site_id_to_storytime_autosaves.rb +6 -0
  217. data/db/migrate/20150225143826_add_site_id_to_storytime_comments.rb +6 -0
  218. data/db/migrate/20150225145119_add_site_id_to_storytime_versions.rb +6 -0
  219. data/db/migrate/20150225145316_add_site_id_to_storytime_taggings.rb +6 -0
  220. data/db/migrate/20150225145608_update_storytime_site_id_columns.rb +11 -0
  221. data/db/migrate/20150225164232_add_site_id_to_storytime_permissions.rb +6 -0
  222. data/db/migrate/20150225212917_create_storytime_memberships.rb +11 -0
  223. data/db/migrate/20150225213535_create_memberships_for_storytime_users.rb +8 -0
  224. data/db/migrate/20150226201739_add_custom_domain_to_storytime_sites.rb +5 -0
  225. data/db/migrate/20150302171500_add_site_id_to_storytime_media.rb +8 -0
  226. data/db/migrate/20150302171722_set_site_layout.rb +8 -0
  227. data/db/migrate/20150302185138_remove_storytime_role_id_from_users.rb +5 -0
  228. data/db/migrate/20150302192525_transfer_posts_to_blogs.rb +8 -0
  229. data/db/migrate/20150302192759_seed_permissions.rb +9 -0
  230. data/db/migrate/20150331162329_add_discourse_name_to_storytime_sites.rb +5 -0
  231. data/db/migrate/20150402161427_remove_subdomain_from_storytime_site.rb +5 -0
  232. data/lib/generators/storytime/install_generator.rb +17 -0
  233. data/lib/generators/storytime/views_generator.rb +21 -9
  234. data/lib/generators/templates/storytime.rb +70 -27
  235. data/lib/storytime/cli/install.rb +274 -0
  236. data/lib/storytime/cli.rb +28 -0
  237. data/lib/storytime/concerns/current_site.rb +10 -0
  238. data/lib/storytime/concerns/has_versions.rb +22 -3
  239. data/lib/storytime/concerns/storytime_user.rb +31 -7
  240. data/lib/storytime/constraints/blog_constraint.rb +11 -0
  241. data/lib/storytime/constraints/blog_homepage_constraint.rb +11 -0
  242. data/lib/storytime/constraints/page_constraint.rb +13 -0
  243. data/lib/storytime/constraints/page_homepage_constraint.rb +11 -0
  244. data/lib/storytime/engine.rb +43 -14
  245. data/lib/storytime/generators/initializer.rb +45 -0
  246. data/lib/storytime/migrators/v1.rb +122 -0
  247. data/lib/storytime/post_notifier.rb +19 -0
  248. data/lib/storytime/post_url_handler.rb +47 -0
  249. data/lib/storytime/storytime_helpers.rb +12 -0
  250. data/lib/storytime/version.rb +1 -1
  251. data/lib/storytime.rb +57 -56
  252. data/screenshots/admin.png +0 -0
  253. data/screenshots/media.png +0 -0
  254. data/screenshots/page-list.png +0 -0
  255. data/screenshots/post-editor.png +0 -0
  256. data/screenshots/site-settings.png +0 -0
  257. data/screenshots/text-snippets.png +0 -0
  258. data/screenshots/user-management.png +0 -0
  259. data/spec/controllers/dashboard_controller_spec.rb +3 -1
  260. data/{app/assets/stylesheets/storytime/subscriptions.css.scss → spec/dummy/app/assets/images/.keep} +0 -0
  261. data/spec/dummy/app/assets/javascripts/application.js +3 -0
  262. data/spec/dummy/app/controllers/application_controller.rb +5 -1
  263. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  264. data/spec/dummy/app/controllers/storytime_admin/widgets_controller.rb +5 -0
  265. data/spec/dummy/app/mailers/.keep +0 -0
  266. data/spec/dummy/app/models/.keep +0 -0
  267. data/spec/dummy/app/models/concerns/.keep +0 -0
  268. data/spec/dummy/app/models/user.rb +5 -1
  269. data/spec/dummy/app/models/video_post.rb +2 -0
  270. data/spec/dummy/app/models/widget.rb +3 -0
  271. data/spec/dummy/app/views/layouts/application.html.erb +1 -1
  272. data/spec/dummy/app/views/storytime/dashboard/posts/_video_post_fields.html.erb +1 -0
  273. data/spec/dummy/app/views/widgets/storytime/dashboard/admin/_headers.html.erb +1 -0
  274. data/spec/dummy/app/views/widgets/storytime/dashboard/admin/_row.html.erb +1 -0
  275. data/spec/dummy/config/database.yml +9 -5
  276. data/spec/dummy/config/environments/test.rb +1 -0
  277. data/spec/dummy/config/initializers/devise.rb +1 -1
  278. data/spec/dummy/config/initializers/session_store.rb +1 -1
  279. data/spec/dummy/config/initializers/storytime.rb +7 -14
  280. data/spec/dummy/db/development.sqlite3 +0 -0
  281. data/spec/dummy/db/migrate/20150127172846_create_widgets.rb +9 -0
  282. data/spec/dummy/db/migrate/20150206203824_add_video_url_to_storytime_posts.rb +5 -0
  283. data/spec/dummy/db/schema.rb +76 -21
  284. data/spec/dummy/db/test.sqlite3 +0 -0
  285. data/spec/dummy/lib/assets/.keep +0 -0
  286. data/spec/dummy/log/.keep +0 -0
  287. data/spec/factories/comment_factories.rb +1 -0
  288. data/spec/factories/membership_factories.rb +7 -0
  289. data/spec/factories/site_factories.rb +3 -2
  290. data/spec/factories/user_factories.rb +3 -3
  291. data/spec/factories/widget_factories.rb +5 -0
  292. data/spec/features/blogs_spec.rb +28 -0
  293. data/spec/features/comments_spec.rb +8 -9
  294. data/spec/features/dashboard/media_spec.rb +14 -30
  295. data/spec/features/dashboard/memberships_spec.rb +58 -0
  296. data/spec/features/dashboard/pages_spec.rb +67 -44
  297. data/spec/features/dashboard/posts_spec.rb +84 -62
  298. data/spec/features/dashboard/sites_spec.rb +28 -23
  299. data/spec/features/dashboard/snippets_spec.rb +44 -44
  300. data/spec/features/dashboard/subscription_spec.rb +36 -28
  301. data/spec/features/dashboard/users_spec.rb +48 -29
  302. data/spec/features/pages_spec.rb +2 -2
  303. data/spec/features/posts_spec.rb +2 -20
  304. data/spec/features/subscription_spec.rb +4 -4
  305. data/spec/models/post_spec.rb +26 -17
  306. data/spec/policies/comment_policy_spec.rb +22 -6
  307. data/spec/policies/post_policy_spec.rb +21 -3
  308. data/spec/requests/routings_spec.rb +27 -17
  309. data/spec/spec_helper.rb +12 -1
  310. data/spec/support/database_cleaner.rb +5 -5
  311. data/spec/support/domains.rb +18 -0
  312. data/spec/support/feature_macros.rb +18 -9
  313. data/storytime.gemspec +59 -0
  314. data/vendor/assets/javascripts/.DS_Store +0 -0
  315. data/vendor/assets/javascripts/codemirror/modes/css.js +717 -0
  316. data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +120 -0
  317. data/vendor/assets/javascripts/codemirror/modes/javascript.js +686 -0
  318. data/vendor/assets/javascripts/codemirror/modes/liquid.js +40 -0
  319. data/vendor/assets/javascripts/codemirror/modes/overlay.js +85 -0
  320. data/vendor/assets/javascripts/codemirror/{xml.js → modes/xml.js} +2 -2
  321. data/vendor/assets/javascripts/medium-editor.min.js +2450 -0
  322. data/vendor/assets/javascripts/phantom_js_bind_polyfill.js +24 -0
  323. data/vendor/assets/javascripts/tidy.js +30 -0
  324. data/vendor/assets/stylesheets/.DS_Store +0 -0
  325. data/vendor/assets/stylesheets/chosen-bootstrap-3.css +148 -0
  326. data/vendor/assets/stylesheets/{chosen.css.scss → chosen.scss} +1 -1
  327. data/vendor/assets/stylesheets/disable-transitions-for-test-env.css +7 -0
  328. data/vendor/assets/stylesheets/medium-editor-default.min.css +1 -0
  329. data/vendor/assets/stylesheets/medium-editor.min.css +1 -0
  330. metadata +297 -47
  331. data/app/assets/stylesheets/storytime/admin.css.scss +0 -121
  332. data/app/assets/stylesheets/storytime/application.css.scss +0 -22
  333. data/app/assets/stylesheets/storytime/layout.css.scss +0 -17
  334. data/app/assets/stylesheets/storytime/media.css.scss +0 -68
  335. data/app/assets/stylesheets/storytime/pagination.css.scss +0 -4
  336. data/app/assets/stylesheets/storytime/posts.css.scss +0 -30
  337. data/app/assets/stylesheets/storytime/versions.css.scss +0 -21
  338. data/app/helpers/storytime/dashboard/posts_helper.rb +0 -21
  339. data/app/views/storytime/blog_posts/_blog_post.html.erb +0 -8
  340. data/app/views/storytime/dashboard/posts/_basic_new_post_button.html.erb +0 -3
  341. data/app/views/storytime/dashboard/posts/_new_post_dropdown_button.html.erb +0 -10
  342. data/app/views/storytime/dashboard/sites/edit.html.erb +0 -25
  343. data/app/views/storytime/dashboard/snippets/_list.html.erb +0 -21
  344. data/app/views/storytime/dashboard/snippets/edit.html.erb +0 -13
  345. data/app/views/storytime/dashboard/snippets/index.html.erb +0 -13
  346. data/app/views/storytime/dashboard/snippets/new.html.erb +0 -12
  347. data/app/views/storytime/dashboard/subscriptions/edit.html.erb +0 -10
  348. data/app/views/storytime/dashboard/subscriptions/index.html.erb +0 -19
  349. data/app/views/storytime/dashboard/subscriptions/new.html.erb +0 -9
  350. data/app/views/storytime/dashboard/users/_user.html.erb +0 -11
  351. data/app/views/storytime/dashboard/users/edit.html.erb +0 -10
  352. data/app/views/storytime/dashboard/users/index.html.erb +0 -22
  353. data/app/views/storytime/dashboard/users/new.html.erb +0 -11
  354. data/spec/lib/storytime_spec.rb +0 -23
  355. data/vendor/assets/javascripts/codemirror/codemirror.js +0 -7831
  356. data/vendor/assets/javascripts/summernote.js +0 -5338
  357. data/vendor/assets/stylesheets/codemirror/codemirror.css +0 -309
  358. data/vendor/assets/stylesheets/codemirror/monokai.css +0 -31
  359. data/vendor/assets/stylesheets/summernote.css +0 -1
@@ -0,0 +1,717 @@
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
+ if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
16
+
17
+ var indentUnit = config.indentUnit,
18
+ tokenHooks = parserConfig.tokenHooks,
19
+ mediaTypes = parserConfig.mediaTypes || {},
20
+ mediaFeatures = parserConfig.mediaFeatures || {},
21
+ propertyKeywords = parserConfig.propertyKeywords || {},
22
+ nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
23
+ colorKeywords = parserConfig.colorKeywords || {},
24
+ valueKeywords = parserConfig.valueKeywords || {},
25
+ fontProperties = parserConfig.fontProperties || {},
26
+ allowNested = parserConfig.allowNested;
27
+
28
+ var type, override;
29
+ function ret(style, tp) { type = tp; return style; }
30
+
31
+ // Tokenizers
32
+
33
+ function tokenBase(stream, state) {
34
+ var ch = stream.next();
35
+ if (tokenHooks[ch]) {
36
+ var result = tokenHooks[ch](stream, state);
37
+ if (result !== false) return result;
38
+ }
39
+ if (ch == "@") {
40
+ stream.eatWhile(/[\w\\\-]/);
41
+ return ret("def", stream.current());
42
+ } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
43
+ return ret(null, "compare");
44
+ } else if (ch == "\"" || ch == "'") {
45
+ state.tokenize = tokenString(ch);
46
+ return state.tokenize(stream, state);
47
+ } else if (ch == "#") {
48
+ stream.eatWhile(/[\w\\\-]/);
49
+ return ret("atom", "hash");
50
+ } else if (ch == "!") {
51
+ stream.match(/^\s*\w*/);
52
+ return ret("keyword", "important");
53
+ } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
54
+ stream.eatWhile(/[\w.%]/);
55
+ return ret("number", "unit");
56
+ } else if (ch === "-") {
57
+ if (/[\d.]/.test(stream.peek())) {
58
+ stream.eatWhile(/[\w.%]/);
59
+ return ret("number", "unit");
60
+ } else if (stream.match(/^\w+-/)) {
61
+ return ret("meta", "meta");
62
+ }
63
+ } else if (/[,+>*\/]/.test(ch)) {
64
+ return ret(null, "select-op");
65
+ } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
66
+ return ret("qualifier", "qualifier");
67
+ } else if (/[:;{}\[\]\(\)]/.test(ch)) {
68
+ return ret(null, ch);
69
+ } else if (ch == "u" && stream.match("rl(")) {
70
+ stream.backUp(1);
71
+ state.tokenize = tokenParenthesized;
72
+ return ret("property", "word");
73
+ } else if (/[\w\\\-]/.test(ch)) {
74
+ stream.eatWhile(/[\w\\\-]/);
75
+ return ret("property", "word");
76
+ } else {
77
+ return ret(null, null);
78
+ }
79
+ }
80
+
81
+ function tokenString(quote) {
82
+ return function(stream, state) {
83
+ var escaped = false, ch;
84
+ while ((ch = stream.next()) != null) {
85
+ if (ch == quote && !escaped) {
86
+ if (quote == ")") stream.backUp(1);
87
+ break;
88
+ }
89
+ escaped = !escaped && ch == "\\";
90
+ }
91
+ if (ch == quote || !escaped && quote != ")") state.tokenize = null;
92
+ return ret("string", "string");
93
+ };
94
+ }
95
+
96
+ function tokenParenthesized(stream, state) {
97
+ stream.next(); // Must be '('
98
+ if (!stream.match(/\s*[\"\')]/, false))
99
+ state.tokenize = tokenString(")");
100
+ else
101
+ state.tokenize = null;
102
+ return ret(null, "(");
103
+ }
104
+
105
+ // Context management
106
+
107
+ function Context(type, indent, prev) {
108
+ this.type = type;
109
+ this.indent = indent;
110
+ this.prev = prev;
111
+ }
112
+
113
+ function pushContext(state, stream, type) {
114
+ state.context = new Context(type, stream.indentation() + indentUnit, state.context);
115
+ return type;
116
+ }
117
+
118
+ function popContext(state) {
119
+ state.context = state.context.prev;
120
+ return state.context.type;
121
+ }
122
+
123
+ function pass(type, stream, state) {
124
+ return states[state.context.type](type, stream, state);
125
+ }
126
+ function popAndPass(type, stream, state, n) {
127
+ for (var i = n || 1; i > 0; i--)
128
+ state.context = state.context.prev;
129
+ return pass(type, stream, state);
130
+ }
131
+
132
+ // Parser
133
+
134
+ function wordAsValue(stream) {
135
+ var word = stream.current().toLowerCase();
136
+ if (valueKeywords.hasOwnProperty(word))
137
+ override = "atom";
138
+ else if (colorKeywords.hasOwnProperty(word))
139
+ override = "keyword";
140
+ else
141
+ override = "variable";
142
+ }
143
+
144
+ var states = {};
145
+
146
+ states.top = function(type, stream, state) {
147
+ if (type == "{") {
148
+ return pushContext(state, stream, "block");
149
+ } else if (type == "}" && state.context.prev) {
150
+ return popContext(state);
151
+ } else if (type == "@media") {
152
+ return pushContext(state, stream, "media");
153
+ } else if (type == "@font-face") {
154
+ return "font_face_before";
155
+ } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
156
+ return "keyframes";
157
+ } else if (type && type.charAt(0) == "@") {
158
+ return pushContext(state, stream, "at");
159
+ } else if (type == "hash") {
160
+ override = "builtin";
161
+ } else if (type == "word") {
162
+ override = "tag";
163
+ } else if (type == "variable-definition") {
164
+ return "maybeprop";
165
+ } else if (type == "interpolation") {
166
+ return pushContext(state, stream, "interpolation");
167
+ } else if (type == ":") {
168
+ return "pseudo";
169
+ } else if (allowNested && type == "(") {
170
+ return pushContext(state, stream, "parens");
171
+ }
172
+ return state.context.type;
173
+ };
174
+
175
+ states.block = function(type, stream, state) {
176
+ if (type == "word") {
177
+ var word = stream.current().toLowerCase();
178
+ if (propertyKeywords.hasOwnProperty(word)) {
179
+ override = "property";
180
+ return "maybeprop";
181
+ } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
182
+ override = "string-2";
183
+ return "maybeprop";
184
+ } else if (allowNested) {
185
+ override = stream.match(/^\s*:/, false) ? "property" : "tag";
186
+ return "block";
187
+ } else {
188
+ override += " error";
189
+ return "maybeprop";
190
+ }
191
+ } else if (type == "meta") {
192
+ return "block";
193
+ } else if (!allowNested && (type == "hash" || type == "qualifier")) {
194
+ override = "error";
195
+ return "block";
196
+ } else {
197
+ return states.top(type, stream, state);
198
+ }
199
+ };
200
+
201
+ states.maybeprop = function(type, stream, state) {
202
+ if (type == ":") return pushContext(state, stream, "prop");
203
+ return pass(type, stream, state);
204
+ };
205
+
206
+ states.prop = function(type, stream, state) {
207
+ if (type == ";") return popContext(state);
208
+ if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
209
+ if (type == "}" || type == "{") return popAndPass(type, stream, state);
210
+ if (type == "(") return pushContext(state, stream, "parens");
211
+
212
+ if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
213
+ override += " error";
214
+ } else if (type == "word") {
215
+ wordAsValue(stream);
216
+ } else if (type == "interpolation") {
217
+ return pushContext(state, stream, "interpolation");
218
+ }
219
+ return "prop";
220
+ };
221
+
222
+ states.propBlock = function(type, _stream, state) {
223
+ if (type == "}") return popContext(state);
224
+ if (type == "word") { override = "property"; return "maybeprop"; }
225
+ return state.context.type;
226
+ };
227
+
228
+ states.parens = function(type, stream, state) {
229
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
230
+ if (type == ")") return popContext(state);
231
+ if (type == "(") return pushContext(state, stream, "parens");
232
+ if (type == "word") wordAsValue(stream);
233
+ return "parens";
234
+ };
235
+
236
+ states.pseudo = function(type, stream, state) {
237
+ if (type == "word") {
238
+ override = "variable-3";
239
+ return state.context.type;
240
+ }
241
+ return pass(type, stream, state);
242
+ };
243
+
244
+ states.media = function(type, stream, state) {
245
+ if (type == "(") return pushContext(state, stream, "media_parens");
246
+ if (type == "}") return popAndPass(type, stream, state);
247
+ if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
248
+
249
+ if (type == "word") {
250
+ var word = stream.current().toLowerCase();
251
+ if (word == "only" || word == "not" || word == "and")
252
+ override = "keyword";
253
+ else if (mediaTypes.hasOwnProperty(word))
254
+ override = "attribute";
255
+ else if (mediaFeatures.hasOwnProperty(word))
256
+ override = "property";
257
+ else
258
+ override = "error";
259
+ }
260
+ return state.context.type;
261
+ };
262
+
263
+ states.media_parens = function(type, stream, state) {
264
+ if (type == ")") return popContext(state);
265
+ if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
266
+ return states.media(type, stream, state);
267
+ };
268
+
269
+ states.font_face_before = function(type, stream, state) {
270
+ if (type == "{")
271
+ return pushContext(state, stream, "font_face");
272
+ return pass(type, stream, state);
273
+ };
274
+
275
+ states.font_face = function(type, stream, state) {
276
+ if (type == "}") return popContext(state);
277
+ if (type == "word") {
278
+ if (!fontProperties.hasOwnProperty(stream.current().toLowerCase()))
279
+ override = "error";
280
+ else
281
+ override = "property";
282
+ return "maybeprop";
283
+ }
284
+ return "font_face";
285
+ };
286
+
287
+ states.keyframes = function(type, stream, state) {
288
+ if (type == "word") { override = "variable"; return "keyframes"; }
289
+ if (type == "{") return pushContext(state, stream, "top");
290
+ return pass(type, stream, state);
291
+ };
292
+
293
+ states.at = function(type, stream, state) {
294
+ if (type == ";") return popContext(state);
295
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
296
+ if (type == "word") override = "tag";
297
+ else if (type == "hash") override = "builtin";
298
+ return "at";
299
+ };
300
+
301
+ states.interpolation = function(type, stream, state) {
302
+ if (type == "}") return popContext(state);
303
+ if (type == "{" || type == ";") return popAndPass(type, stream, state);
304
+ if (type != "variable") override = "error";
305
+ return "interpolation";
306
+ };
307
+
308
+ return {
309
+ startState: function(base) {
310
+ return {tokenize: null,
311
+ state: "top",
312
+ context: new Context("top", base || 0, null)};
313
+ },
314
+
315
+ token: function(stream, state) {
316
+ if (!state.tokenize && stream.eatSpace()) return null;
317
+ var style = (state.tokenize || tokenBase)(stream, state);
318
+ if (style && typeof style == "object") {
319
+ type = style[1];
320
+ style = style[0];
321
+ }
322
+ override = style;
323
+ state.state = states[state.state](type, stream, state);
324
+ return override;
325
+ },
326
+
327
+ indent: function(state, textAfter) {
328
+ var cx = state.context, ch = textAfter && textAfter.charAt(0);
329
+ var indent = cx.indent;
330
+ if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
331
+ if (cx.prev &&
332
+ (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") ||
333
+ ch == ")" && (cx.type == "parens" || cx.type == "media_parens") ||
334
+ ch == "{" && (cx.type == "at" || cx.type == "media"))) {
335
+ indent = cx.indent - indentUnit;
336
+ cx = cx.prev;
337
+ }
338
+ return indent;
339
+ },
340
+
341
+ electricChars: "}",
342
+ blockCommentStart: "/*",
343
+ blockCommentEnd: "*/",
344
+ fold: "brace"
345
+ };
346
+ });
347
+
348
+ function keySet(array) {
349
+ var keys = {};
350
+ for (var i = 0; i < array.length; ++i) {
351
+ keys[array[i]] = true;
352
+ }
353
+ return keys;
354
+ }
355
+
356
+ var mediaTypes_ = [
357
+ "all", "aural", "braille", "handheld", "print", "projection", "screen",
358
+ "tty", "tv", "embossed"
359
+ ], mediaTypes = keySet(mediaTypes_);
360
+
361
+ var mediaFeatures_ = [
362
+ "width", "min-width", "max-width", "height", "min-height", "max-height",
363
+ "device-width", "min-device-width", "max-device-width", "device-height",
364
+ "min-device-height", "max-device-height", "aspect-ratio",
365
+ "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
366
+ "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
367
+ "max-color", "color-index", "min-color-index", "max-color-index",
368
+ "monochrome", "min-monochrome", "max-monochrome", "resolution",
369
+ "min-resolution", "max-resolution", "scan", "grid"
370
+ ], mediaFeatures = keySet(mediaFeatures_);
371
+
372
+ var propertyKeywords_ = [
373
+ "align-content", "align-items", "align-self", "alignment-adjust",
374
+ "alignment-baseline", "anchor-point", "animation", "animation-delay",
375
+ "animation-direction", "animation-duration", "animation-fill-mode",
376
+ "animation-iteration-count", "animation-name", "animation-play-state",
377
+ "animation-timing-function", "appearance", "azimuth", "backface-visibility",
378
+ "background", "background-attachment", "background-clip", "background-color",
379
+ "background-image", "background-origin", "background-position",
380
+ "background-repeat", "background-size", "baseline-shift", "binding",
381
+ "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
382
+ "bookmark-target", "border", "border-bottom", "border-bottom-color",
383
+ "border-bottom-left-radius", "border-bottom-right-radius",
384
+ "border-bottom-style", "border-bottom-width", "border-collapse",
385
+ "border-color", "border-image", "border-image-outset",
386
+ "border-image-repeat", "border-image-slice", "border-image-source",
387
+ "border-image-width", "border-left", "border-left-color",
388
+ "border-left-style", "border-left-width", "border-radius", "border-right",
389
+ "border-right-color", "border-right-style", "border-right-width",
390
+ "border-spacing", "border-style", "border-top", "border-top-color",
391
+ "border-top-left-radius", "border-top-right-radius", "border-top-style",
392
+ "border-top-width", "border-width", "bottom", "box-decoration-break",
393
+ "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
394
+ "caption-side", "clear", "clip", "color", "color-profile", "column-count",
395
+ "column-fill", "column-gap", "column-rule", "column-rule-color",
396
+ "column-rule-style", "column-rule-width", "column-span", "column-width",
397
+ "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
398
+ "cue-after", "cue-before", "cursor", "direction", "display",
399
+ "dominant-baseline", "drop-initial-after-adjust",
400
+ "drop-initial-after-align", "drop-initial-before-adjust",
401
+ "drop-initial-before-align", "drop-initial-size", "drop-initial-value",
402
+ "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
403
+ "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
404
+ "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
405
+ "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
406
+ "font-stretch", "font-style", "font-synthesis", "font-variant",
407
+ "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
408
+ "font-variant-ligatures", "font-variant-numeric", "font-variant-position",
409
+ "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
410
+ "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end",
411
+ "grid-column-start", "grid-row", "grid-row-end", "grid-row-start",
412
+ "grid-template", "grid-template-areas", "grid-template-columns",
413
+ "grid-template-rows", "hanging-punctuation", "height", "hyphens",
414
+ "icon", "image-orientation", "image-rendering", "image-resolution",
415
+ "inline-box-align", "justify-content", "left", "letter-spacing",
416
+ "line-break", "line-height", "line-stacking", "line-stacking-ruby",
417
+ "line-stacking-shift", "line-stacking-strategy", "list-style",
418
+ "list-style-image", "list-style-position", "list-style-type", "margin",
419
+ "margin-bottom", "margin-left", "margin-right", "margin-top",
420
+ "marker-offset", "marks", "marquee-direction", "marquee-loop",
421
+ "marquee-play-count", "marquee-speed", "marquee-style", "max-height",
422
+ "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
423
+ "nav-left", "nav-right", "nav-up", "object-fit", "object-position",
424
+ "opacity", "order", "orphans", "outline",
425
+ "outline-color", "outline-offset", "outline-style", "outline-width",
426
+ "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
427
+ "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
428
+ "page", "page-break-after", "page-break-before", "page-break-inside",
429
+ "page-policy", "pause", "pause-after", "pause-before", "perspective",
430
+ "perspective-origin", "pitch", "pitch-range", "play-during", "position",
431
+ "presentation-level", "punctuation-trim", "quotes", "region-break-after",
432
+ "region-break-before", "region-break-inside", "region-fragment",
433
+ "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
434
+ "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
435
+ "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
436
+ "shape-outside", "size", "speak", "speak-as", "speak-header",
437
+ "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
438
+ "tab-size", "table-layout", "target", "target-name", "target-new",
439
+ "target-position", "text-align", "text-align-last", "text-decoration",
440
+ "text-decoration-color", "text-decoration-line", "text-decoration-skip",
441
+ "text-decoration-style", "text-emphasis", "text-emphasis-color",
442
+ "text-emphasis-position", "text-emphasis-style", "text-height",
443
+ "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
444
+ "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
445
+ "text-wrap", "top", "transform", "transform-origin", "transform-style",
446
+ "transition", "transition-delay", "transition-duration",
447
+ "transition-property", "transition-timing-function", "unicode-bidi",
448
+ "vertical-align", "visibility", "voice-balance", "voice-duration",
449
+ "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
450
+ "voice-volume", "volume", "white-space", "widows", "width", "word-break",
451
+ "word-spacing", "word-wrap", "z-index",
452
+ // SVG-specific
453
+ "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
454
+ "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
455
+ "color-interpolation", "color-interpolation-filters",
456
+ "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
457
+ "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
458
+ "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
459
+ "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
460
+ "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
461
+ "glyph-orientation-vertical", "text-anchor", "writing-mode"
462
+ ], propertyKeywords = keySet(propertyKeywords_);
463
+
464
+ var nonStandardPropertyKeywords_ = [
465
+ "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
466
+ "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
467
+ "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
468
+ "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
469
+ "searchfield-results-decoration", "zoom"
470
+ ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
471
+
472
+ var colorKeywords_ = [
473
+ "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
474
+ "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
475
+ "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
476
+ "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
477
+ "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
478
+ "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
479
+ "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
480
+ "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
481
+ "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
482
+ "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
483
+ "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
484
+ "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
485
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
486
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
487
+ "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
488
+ "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
489
+ "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
490
+ "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
491
+ "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
492
+ "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
493
+ "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
494
+ "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
495
+ "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
496
+ "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
497
+ "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
498
+ "whitesmoke", "yellow", "yellowgreen"
499
+ ], colorKeywords = keySet(colorKeywords_);
500
+
501
+ var valueKeywords_ = [
502
+ "above", "absolute", "activeborder", "activecaption", "afar",
503
+ "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
504
+ "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
505
+ "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page",
506
+ "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
507
+ "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
508
+ "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel",
509
+ "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
510
+ "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
511
+ "cell", "center", "checkbox", "circle", "cjk-earthly-branch",
512
+ "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
513
+ "col-resize", "collapse", "column", "compact", "condensed", "contain", "content",
514
+ "content-box", "context-menu", "continuous", "copy", "cover", "crop",
515
+ "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
516
+ "decimal-leading-zero", "default", "default-button", "destination-atop",
517
+ "destination-in", "destination-out", "destination-over", "devanagari",
518
+ "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
519
+ "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
520
+ "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
521
+ "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
522
+ "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
523
+ "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
524
+ "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
525
+ "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
526
+ "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
527
+ "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
528
+ "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
529
+ "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
530
+ "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
531
+ "help", "hidden", "hide", "higher", "highlight", "highlighttext",
532
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
533
+ "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
534
+ "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
535
+ "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
536
+ "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer",
537
+ "landscape", "lao", "large", "larger", "left", "level", "lighter",
538
+ "line-through", "linear", "lines", "list-item", "listbox", "listitem",
539
+ "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
540
+ "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
541
+ "lower-roman", "lowercase", "ltr", "malayalam", "match",
542
+ "media-controls-background", "media-current-time-display",
543
+ "media-fullscreen-button", "media-mute-button", "media-play-button",
544
+ "media-return-to-realtime-button", "media-rewind-button",
545
+ "media-seek-back-button", "media-seek-forward-button", "media-slider",
546
+ "media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
547
+ "media-volume-slider-container", "media-volume-sliderthumb", "medium",
548
+ "menu", "menulist", "menulist-button", "menulist-text",
549
+ "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
550
+ "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
551
+ "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
552
+ "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
553
+ "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
554
+ "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
555
+ "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
556
+ "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer",
557
+ "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
558
+ "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region",
559
+ "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
560
+ "ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
561
+ "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
562
+ "searchfield-cancel-button", "searchfield-decoration",
563
+ "searchfield-results-button", "searchfield-results-decoration",
564
+ "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
565
+ "single", "skip-white-space", "slide", "slider-horizontal",
566
+ "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
567
+ "small", "small-caps", "small-caption", "smaller", "solid", "somali",
568
+ "source-atop", "source-in", "source-out", "source-over", "space", "square",
569
+ "square-button", "start", "static", "status-bar", "stretch", "stroke",
570
+ "sub", "subpixel-antialiased", "super", "sw-resize", "table",
571
+ "table-caption", "table-cell", "table-column", "table-column-group",
572
+ "table-footer-group", "table-header-group", "table-row", "table-row-group",
573
+ "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
574
+ "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
575
+ "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
576
+ "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
577
+ "transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
578
+ "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
579
+ "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
580
+ "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
581
+ "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
582
+ "window", "windowframe", "windowtext", "x-large", "x-small", "xor",
583
+ "xx-large", "xx-small"
584
+ ], valueKeywords = keySet(valueKeywords_);
585
+
586
+ var fontProperties_ = [
587
+ "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
588
+ "font-stretch", "font-weight", "font-style"
589
+ ], fontProperties = keySet(fontProperties_);
590
+
591
+ var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_)
592
+ .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);
593
+ CodeMirror.registerHelper("hintWords", "css", allWords);
594
+
595
+ function tokenCComment(stream, state) {
596
+ var maybeEnd = false, ch;
597
+ while ((ch = stream.next()) != null) {
598
+ if (maybeEnd && ch == "/") {
599
+ state.tokenize = null;
600
+ break;
601
+ }
602
+ maybeEnd = (ch == "*");
603
+ }
604
+ return ["comment", "comment"];
605
+ }
606
+
607
+ function tokenSGMLComment(stream, state) {
608
+ if (stream.skipTo("-->")) {
609
+ stream.match("-->");
610
+ state.tokenize = null;
611
+ } else {
612
+ stream.skipToEnd();
613
+ }
614
+ return ["comment", "comment"];
615
+ }
616
+
617
+ CodeMirror.defineMIME("text/css", {
618
+ mediaTypes: mediaTypes,
619
+ mediaFeatures: mediaFeatures,
620
+ propertyKeywords: propertyKeywords,
621
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
622
+ colorKeywords: colorKeywords,
623
+ valueKeywords: valueKeywords,
624
+ fontProperties: fontProperties,
625
+ tokenHooks: {
626
+ "<": function(stream, state) {
627
+ if (!stream.match("!--")) return false;
628
+ state.tokenize = tokenSGMLComment;
629
+ return tokenSGMLComment(stream, state);
630
+ },
631
+ "/": function(stream, state) {
632
+ if (!stream.eat("*")) return false;
633
+ state.tokenize = tokenCComment;
634
+ return tokenCComment(stream, state);
635
+ }
636
+ },
637
+ name: "css"
638
+ });
639
+
640
+ CodeMirror.defineMIME("text/x-scss", {
641
+ mediaTypes: mediaTypes,
642
+ mediaFeatures: mediaFeatures,
643
+ propertyKeywords: propertyKeywords,
644
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
645
+ colorKeywords: colorKeywords,
646
+ valueKeywords: valueKeywords,
647
+ fontProperties: fontProperties,
648
+ allowNested: true,
649
+ tokenHooks: {
650
+ "/": function(stream, state) {
651
+ if (stream.eat("/")) {
652
+ stream.skipToEnd();
653
+ return ["comment", "comment"];
654
+ } else if (stream.eat("*")) {
655
+ state.tokenize = tokenCComment;
656
+ return tokenCComment(stream, state);
657
+ } else {
658
+ return ["operator", "operator"];
659
+ }
660
+ },
661
+ ":": function(stream) {
662
+ if (stream.match(/\s*\{/))
663
+ return [null, "{"];
664
+ return false;
665
+ },
666
+ "$": function(stream) {
667
+ stream.match(/^[\w-]+/);
668
+ if (stream.match(/^\s*:/, false))
669
+ return ["variable-2", "variable-definition"];
670
+ return ["variable-2", "variable"];
671
+ },
672
+ "#": function(stream) {
673
+ if (!stream.eat("{")) return false;
674
+ return [null, "interpolation"];
675
+ }
676
+ },
677
+ name: "css",
678
+ helperType: "scss"
679
+ });
680
+
681
+ CodeMirror.defineMIME("text/x-less", {
682
+ mediaTypes: mediaTypes,
683
+ mediaFeatures: mediaFeatures,
684
+ propertyKeywords: propertyKeywords,
685
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
686
+ colorKeywords: colorKeywords,
687
+ valueKeywords: valueKeywords,
688
+ fontProperties: fontProperties,
689
+ allowNested: true,
690
+ tokenHooks: {
691
+ "/": function(stream, state) {
692
+ if (stream.eat("/")) {
693
+ stream.skipToEnd();
694
+ return ["comment", "comment"];
695
+ } else if (stream.eat("*")) {
696
+ state.tokenize = tokenCComment;
697
+ return tokenCComment(stream, state);
698
+ } else {
699
+ return ["operator", "operator"];
700
+ }
701
+ },
702
+ "@": function(stream) {
703
+ if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
704
+ stream.eatWhile(/[\w\\\-]/);
705
+ if (stream.match(/^\s*:/, false))
706
+ return ["variable-2", "variable-definition"];
707
+ return ["variable-2", "variable"];
708
+ },
709
+ "&": function() {
710
+ return ["atom", "atom"];
711
+ }
712
+ },
713
+ name: "css",
714
+ helperType: "less"
715
+ });
716
+
717
+ });