kiteditor 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. data/{lib/generators/mercury/install/images/templates → app/controllers/mercury}/images_controller.rb +0 -0
  2. data/{lib/generators/mercury/install/images/templates/ar_paperclip_image.rb → app/models/mercury/image.rb} +0 -7
  3. data/app/views/layouts/mercury.html.erb +20 -10
  4. data/app/views/mercury/modals/character.html +1 -1
  5. data/app/views/mercury/modals/htmleditor.html +7 -3
  6. data/app/views/mercury/modals/link.html +51 -37
  7. data/app/views/mercury/modals/media.html +0 -102
  8. data/app/views/mercury/modals/table.html +73 -79
  9. data/app/views/mercury/panels/snippets.html +1 -6
  10. data/app/views/mercury/snippets/example/options.html.erb +27 -23
  11. data/{lib/generators/mercury/install/images/templates/ar_paperclip_image_migration.rb → db/migrate/20110526035601_create_mercury_images.rb} +0 -0
  12. data/features/loading/loading.feature +2 -5
  13. data/features/loading/user_interface.feature +7 -9
  14. data/features/regions/{full → editable}/advanced_editing.feature +0 -0
  15. data/features/regions/editable/basic_editing.feature +195 -0
  16. data/features/regions/{full → editable}/inserting_links.feature +19 -20
  17. data/features/regions/{full → editable}/inserting_media.feature +18 -36
  18. data/features/regions/{full → editable}/inserting_snippets.feature +18 -28
  19. data/features/regions/{full → editable}/inserting_special_characters.feature +2 -2
  20. data/features/regions/editable/inserting_tables.feature +109 -0
  21. data/features/regions/{full → editable}/pasting.feature +0 -0
  22. data/features/regions/{full → editable}/uploading_images.feature +0 -0
  23. data/features/regions/{markdown → markupable}/advanced_editing.feature +0 -0
  24. data/features/regions/{markdown → markupable}/basic_editing.feature +0 -0
  25. data/features/regions/{markdown → markupable}/inserting_links.feature +0 -0
  26. data/features/regions/{markdown → markupable}/inserting_media.feature +0 -0
  27. data/features/regions/{markdown → markupable}/inserting_snippets.feature +0 -0
  28. data/features/regions/{markdown → markupable}/inserting_special_characters.feature +0 -0
  29. data/features/regions/{markdown → markupable}/inserting_tables.feature +0 -0
  30. data/features/regions/{image → markupable}/uploading_images.feature +0 -0
  31. data/features/regions/{snippets → snippetable}/advanced_editing.feature +0 -0
  32. data/features/regions/{snippets → snippetable}/basic_editing.feature +0 -0
  33. data/features/regions/{snippets → snippetable}/inserting_snippets.feature +0 -0
  34. data/features/saving/saving.feature +8 -8
  35. data/features/step_definitions/mercury_steps.rb +438 -1
  36. data/features/support/env.rb +1 -11
  37. data/{lib/mercury/cucumber → features}/support/mercury_contents.rb +3 -3
  38. data/{lib/mercury/cucumber → features}/support/mercury_selectors.rb +20 -0
  39. data/features/support/selectors.rb +0 -23
  40. data/lib/generators/mercury/install/install_generator.rb +23 -12
  41. data/lib/generators/mercury/install/{images/templates → templates}/mongoid_paperclip_image.rb +0 -0
  42. data/lib/mercury/authentication.rb +0 -1
  43. data/lib/mercury-rails.rb +2 -1
  44. data/spec/javascripts/mercury/{dialog_spec.coffee → dialog_spec.js.coffee} +12 -11
  45. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +3 -2
  46. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +4 -3
  47. data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +3 -2
  48. data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +3 -2
  49. data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +3 -2
  50. data/spec/javascripts/mercury/lightview_spec.js.coffee +142 -180
  51. data/spec/javascripts/mercury/mercury_spec.js.coffee +13 -19
  52. data/spec/javascripts/mercury/modal_spec.js.coffee +148 -192
  53. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +5 -4
  54. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +3 -2
  55. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +34 -107
  56. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +26 -106
  57. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +3 -2
  58. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +40 -50
  59. data/spec/javascripts/mercury/page_editor_spec.js.coffee +80 -124
  60. data/spec/javascripts/mercury/palette_spec.js.coffee +5 -4
  61. data/spec/javascripts/mercury/panel_spec.js.coffee +12 -9
  62. data/spec/javascripts/mercury/region_spec.js.coffee +17 -22
  63. data/spec/javascripts/mercury/regions/{full_spec.js.coffee → editable_spec.js.coffee} +28 -26
  64. data/spec/javascripts/mercury/regions/{markdown_spec.js.coffee → markupable_spec.js.coffee} +34 -32
  65. data/spec/javascripts/mercury/regions/{snippets_spec.js.coffee → snippetable_spec.js.coffee} +55 -54
  66. data/spec/javascripts/mercury/select_spec.js.coffee +5 -4
  67. data/spec/javascripts/mercury/snippet_spec.js.coffee +16 -92
  68. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +16 -31
  69. data/spec/javascripts/mercury/statusbar_spec.js.coffee +10 -9
  70. data/spec/javascripts/mercury/table_editor_spec.js.coffee +2 -1
  71. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +9 -7
  72. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +26 -55
  73. data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +13 -13
  74. data/spec/javascripts/mercury/toolbar_spec.js.coffee +14 -43
  75. data/spec/javascripts/mercury/tooltip_spec.js.coffee +2 -1
  76. data/spec/javascripts/mercury/uploader_spec.js.coffee +33 -47
  77. data/spec/javascripts/{support/event_simulation.js → spec_helper.js} +2 -0
  78. data/spec/javascripts/{fixtures → templates}/mercury/dialog.html +0 -0
  79. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/backcolor.html +0 -0
  80. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/forecolor.html +0 -0
  81. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/formatblock.html +0 -0
  82. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/snippetpanel.html +0 -0
  83. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/style.html +0 -0
  84. data/spec/javascripts/{fixtures → templates}/mercury/lightview.html +0 -0
  85. data/spec/javascripts/{fixtures → templates}/mercury/modal.html +0 -0
  86. data/spec/javascripts/{fixtures → templates}/mercury/modals/htmleditor.html +0 -0
  87. data/spec/javascripts/{fixtures → templates}/mercury/modals/insertcharacter.html +0 -0
  88. data/spec/javascripts/templates/mercury/modals/insertlink.html +30 -0
  89. data/spec/javascripts/templates/mercury/modals/insertmedia.html +35 -0
  90. data/spec/javascripts/{fixtures → templates}/mercury/modals/insertsnippet.html +0 -0
  91. data/spec/javascripts/templates/mercury/modals/inserttable.html +27 -0
  92. data/spec/javascripts/{fixtures → templates}/mercury/page_editor.html +4 -4
  93. data/spec/javascripts/{fixtures → templates}/mercury/palette.html +0 -0
  94. data/spec/javascripts/{fixtures → templates}/mercury/panel.html +0 -0
  95. data/spec/javascripts/templates/mercury/region.html +2 -0
  96. data/spec/javascripts/templates/mercury/regions/editable.html +3 -0
  97. data/spec/javascripts/templates/mercury/regions/snippetable.html +4 -0
  98. data/spec/javascripts/{fixtures → templates}/mercury/select.html +0 -0
  99. data/spec/javascripts/{fixtures → templates}/mercury/snippet.html +0 -0
  100. data/spec/javascripts/{fixtures → templates}/mercury/snippet_toolbar.html +0 -0
  101. data/spec/javascripts/{fixtures → templates}/mercury/statusbar.html +0 -0
  102. data/spec/javascripts/{fixtures → templates}/mercury/table_editor.html +0 -0
  103. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.button.html +0 -0
  104. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.button_group.html +0 -0
  105. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.expander.html +0 -0
  106. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.html +0 -0
  107. data/spec/javascripts/{fixtures → templates}/mercury/tooltip.html +0 -0
  108. data/spec/javascripts/{fixtures → templates}/mercury/uploader.html +0 -0
  109. data/{app → vendor}/assets/images/mercury/button.png +0 -0
  110. data/{app → vendor}/assets/images/mercury/close.png +0 -0
  111. data/{app → vendor}/assets/images/mercury/loading-dark.gif +0 -0
  112. data/{app → vendor}/assets/images/mercury/loading-light.gif +0 -0
  113. data/{app → vendor}/assets/images/mercury/missing-image.png +0 -0
  114. data/{app → vendor}/assets/images/mercury/search-icon.png +0 -0
  115. data/{app → vendor}/assets/images/mercury/temp-logo.png +0 -0
  116. data/{app/assets/javascripts → vendor/assets/javascripts/mercury/dependencies}/jquery-1.7.js +0 -0
  117. data/{app → vendor}/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +0 -0
  118. data/{app → vendor}/assets/javascripts/mercury/dependencies/jquery.additions.js +13 -103
  119. data/{app → vendor}/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +0 -0
  120. data/{app → vendor}/assets/javascripts/mercury/dependencies/liquidmetal.js +0 -0
  121. data/{app → vendor}/assets/javascripts/mercury/dependencies/showdown.js +0 -0
  122. data/{app → vendor}/assets/javascripts/mercury/dialog.js.coffee +0 -0
  123. data/{app → vendor}/assets/javascripts/mercury/dialogs/backcolor.js.coffee +0 -0
  124. data/{app → vendor}/assets/javascripts/mercury/dialogs/forecolor.js.coffee +1 -1
  125. data/{app → vendor}/assets/javascripts/mercury/dialogs/formatblock.js.coffee +0 -0
  126. data/{app → vendor}/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +1 -1
  127. data/{app → vendor}/assets/javascripts/mercury/dialogs/style.js.coffee +0 -0
  128. data/{app → vendor}/assets/javascripts/mercury/finalize.js.coffee +0 -0
  129. data/{app → vendor}/assets/javascripts/mercury/history_buffer.js.coffee +0 -0
  130. data/{app → vendor}/assets/javascripts/mercury/lightview.js.coffee +17 -38
  131. data/{features/regions/markdown/uploading_images.feature → vendor/assets/javascripts/mercury/locales/da.locale.js.coffee} +0 -0
  132. data/{app → vendor}/assets/javascripts/mercury/locales/de.locale.js.coffee +10 -4
  133. data/{app → vendor}/assets/javascripts/mercury/locales/es.locale.js.coffee +9 -3
  134. data/{app → vendor}/assets/javascripts/mercury/locales/example.local.js.coffee +5 -3
  135. data/{app → vendor}/assets/javascripts/mercury/locales/fr.locale.js.coffee +9 -3
  136. data/{app → vendor}/assets/javascripts/mercury/locales/it.locale.js.coffee +9 -3
  137. data/{app → vendor}/assets/javascripts/mercury/locales/ko.local.js.coffee +10 -4
  138. data/{app → vendor}/assets/javascripts/mercury/locales/nl.locale.js.coffee +9 -3
  139. data/{app → vendor}/assets/javascripts/mercury/locales/pt.locale.js.coffee +9 -3
  140. data/{app → vendor}/assets/javascripts/mercury/locales/sv.local.js.coffee +9 -3
  141. data/{app → vendor}/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +9 -3
  142. data/{app → vendor}/assets/javascripts/mercury/mercury.js.coffee +1 -10
  143. data/{app → vendor}/assets/javascripts/mercury/modal.js.coffee +40 -62
  144. data/{app → vendor}/assets/javascripts/mercury/modals/htmleditor.js.coffee +2 -3
  145. data/{app → vendor}/assets/javascripts/mercury/modals/insertcharacter.js.coffee +0 -1
  146. data/{app → vendor}/assets/javascripts/mercury/modals/insertsnippet.js.coffee +0 -2
  147. data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +54 -0
  148. data/{app → vendor}/assets/javascripts/mercury/native_extensions.js.coffee +6 -0
  149. data/{app → vendor}/assets/javascripts/mercury/page_editor.js.coffee +50 -84
  150. data/{app → vendor}/assets/javascripts/mercury/palette.js.coffee +1 -1
  151. data/{app → vendor}/assets/javascripts/mercury/panel.js.coffee +2 -3
  152. data/{app → vendor}/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +2 -2
  153. data/{app → vendor}/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +0 -0
  154. data/{app → vendor}/assets/javascripts/mercury/region.js.coffee +17 -18
  155. data/{app/assets/javascripts/mercury/regions/full.js.coffee → vendor/assets/javascripts/mercury/regions/editable.js.coffee} +31 -41
  156. data/{app/assets/javascripts/mercury/regions/markdown.js.coffee → vendor/assets/javascripts/mercury/regions/markupable.js.coffee} +24 -29
  157. data/{app → vendor}/assets/javascripts/mercury/regions/simple.js.coffee +54 -11
  158. data/{app/assets/javascripts/mercury/regions/snippets.js.coffee → vendor/assets/javascripts/mercury/regions/snippetable.js.coffee} +9 -10
  159. data/{app → vendor}/assets/javascripts/mercury/select.js.coffee +1 -1
  160. data/{app → vendor}/assets/javascripts/mercury/snippet_toolbar.js.coffee +6 -19
  161. data/{app → vendor}/assets/javascripts/mercury/statusbar.js.coffee +0 -0
  162. data/{app → vendor}/assets/javascripts/mercury/support/history.js +0 -0
  163. data/{app → vendor}/assets/javascripts/mercury/table_editor.js.coffee +0 -16
  164. data/{app → vendor}/assets/javascripts/mercury/toolbar.button.js.coffee +30 -45
  165. data/{app → vendor}/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  166. data/{app → vendor}/assets/javascripts/mercury/toolbar.expander.js.coffee +4 -4
  167. data/{app → vendor}/assets/javascripts/mercury/toolbar.js.coffee +6 -10
  168. data/{app → vendor}/assets/javascripts/mercury/tooltip.js.coffee +0 -0
  169. data/{app → vendor}/assets/javascripts/mercury/uploader.js.coffee +19 -37
  170. data/{app → vendor}/assets/javascripts/mercury.js +87 -60
  171. data/vendor/assets/javascripts/mercury_loader.js +193 -0
  172. data/vendor/assets/javascripts/mercury_overrides.js +6 -0
  173. data/{app → vendor}/assets/stylesheets/mercury/all_images.css.erb +2 -6
  174. data/{app → vendor}/assets/stylesheets/mercury/dialog.css +8 -21
  175. data/{app → vendor}/assets/stylesheets/mercury/lightview.css +56 -6
  176. data/vendor/assets/stylesheets/mercury/mercury.css +151 -0
  177. data/{app → vendor}/assets/stylesheets/mercury/modal.css +32 -15
  178. data/{app → vendor}/assets/stylesheets/mercury/statusbar.css +0 -0
  179. data/{app → vendor}/assets/stylesheets/mercury/toolbar.css +1 -4
  180. data/{app → vendor}/assets/stylesheets/mercury/tooltip.css +0 -0
  181. data/{app → vendor}/assets/stylesheets/mercury/uploader.css +4 -4
  182. data/{app → vendor}/assets/stylesheets/mercury.css +5 -1
  183. data/vendor/assets/stylesheets/mercury_overrides.css +17 -0
  184. metadata +197 -367
  185. data/POST_INSTALL +0 -21
  186. data/app/assets/images/mercury/default-snippet.png +0 -0
  187. data/app/assets/images/mercury/toolbar/editable/buttons.png +0 -0
  188. data/app/assets/images/mercury/toolbar/primary/_expander.png +0 -0
  189. data/app/assets/images/mercury/toolbar/primary/_pressed.png +0 -0
  190. data/app/assets/images/mercury/toolbar/primary/action.png +0 -0
  191. data/app/assets/images/mercury/toolbar/primary/historypanel.png +0 -0
  192. data/app/assets/images/mercury/toolbar/primary/insertcharacter.png +0 -0
  193. data/app/assets/images/mercury/toolbar/primary/insertlink.png +0 -0
  194. data/app/assets/images/mercury/toolbar/primary/insertmedia.png +0 -0
  195. data/app/assets/images/mercury/toolbar/primary/inserttable.png +0 -0
  196. data/app/assets/images/mercury/toolbar/primary/inspectorpanel.png +0 -0
  197. data/app/assets/images/mercury/toolbar/primary/notespanel.png +0 -0
  198. data/app/assets/images/mercury/toolbar/primary/preview.png +0 -0
  199. data/app/assets/images/mercury/toolbar/primary/redo.png +0 -0
  200. data/app/assets/images/mercury/toolbar/primary/save.png +0 -0
  201. data/app/assets/images/mercury/toolbar/primary/snippetpanel.png +0 -0
  202. data/app/assets/images/mercury/toolbar/primary/tools.png +0 -0
  203. data/app/assets/images/mercury/toolbar/primary/undo.png +0 -0
  204. data/app/assets/images/mercury/toolbar/primary/user.png +0 -0
  205. data/app/assets/images/mercury/toolbar/snippets/buttons.png +0 -0
  206. data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +0 -201
  207. data/app/assets/javascripts/mercury/locales/da.locale.js.coffee +0 -208
  208. data/app/assets/javascripts/mercury/locales/hu.locale.js.coffee +0 -209
  209. data/app/assets/javascripts/mercury/locales/pl.locale.js.coffee +0 -213
  210. data/app/assets/javascripts/mercury/locales/ru.locale.js.coffee +0 -200
  211. data/app/assets/javascripts/mercury/locales/uk.locale.js.coffee +0 -200
  212. data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +0 -203
  213. data/app/assets/javascripts/mercury/mercury-compiled.js +0 -10720
  214. data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +0 -152
  215. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +0 -132
  216. data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +0 -68
  217. data/app/assets/javascripts/mercury/regions/image.js.coffee +0 -93
  218. data/app/assets/javascripts/mercury/snippet.js.coffee +0 -136
  219. data/app/assets/stylesheets/_mercury-bootstrap-overrides.scss +0 -61
  220. data/app/assets/stylesheets/_mercury-sass.scss +0 -33
  221. data/app/assets/stylesheets/mercury/bootstrap-ish.css +0 -1367
  222. data/app/assets/stylesheets/mercury/bootstrap-overrides.css +0 -61
  223. data/app/assets/stylesheets/mercury/mercury.css +0 -43
  224. data/app/helpers/mercury_helper.rb +0 -7
  225. data/app/views/layouts/mercury.html.haml +0 -19
  226. data/app/views/layouts/mercury.html.slim +0 -19
  227. data/app/views/mercury/snippets/no_options/preview.html.erb +0 -1
  228. data/config/routes.rb +0 -9
  229. data/features/generators/authentication.feature +0 -10
  230. data/features/generators/images.feature +0 -41
  231. data/features/generators/install.feature +0 -21
  232. data/features/regions/full/basic_editing.feature +0 -198
  233. data/features/regions/full/inserting_tables.feature +0 -109
  234. data/features/regions/simple/basic_editing.feature +0 -5
  235. data/features/step_definitions/custom_web_steps.rb +0 -22
  236. data/features/step_definitions/generator_steps.rb +0 -23
  237. data/features/support/aruba.rb +0 -28
  238. data/lib/generators/mercury/install/authentication/authentication_generator.rb +0 -17
  239. data/lib/generators/mercury/install/images/images_generator.rb +0 -47
  240. data/lib/mercury/cucumber/step_definitions/mercury_steps.rb +0 -408
  241. data/lib/mercury/cucumber/step_definitions.rb +0 -13
  242. data/lib/mercury/engine.rb +0 -19
  243. data/lib/mercury/rails.rb +0 -5
  244. data/lib/mercury/version.rb +0 -3
  245. data/spec/dummy/Rakefile +0 -7
  246. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  247. data/spec/dummy/app/assets/javascripts/prototype.js +0 -6082
  248. data/spec/dummy/app/assets/stylesheets/application.css.scss +0 -110
  249. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  250. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  251. data/spec/dummy/app/views/layouts/mercury.html.erb +0 -28
  252. data/spec/dummy/config/application.rb +0 -58
  253. data/spec/dummy/config/boot.rb +0 -10
  254. data/spec/dummy/config/database.yml +0 -10
  255. data/spec/dummy/config/environment.rb +0 -5
  256. data/spec/dummy/config/environments/development.rb +0 -37
  257. data/spec/dummy/config/environments/production.rb +0 -67
  258. data/spec/dummy/config/environments/test.rb +0 -37
  259. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  260. data/spec/dummy/config/initializers/inflections.rb +0 -15
  261. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  262. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  263. data/spec/dummy/config/initializers/session_store.rb +0 -8
  264. data/spec/dummy/config/initializers/teabag.rb +0 -9
  265. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  266. data/spec/dummy/config/locales/en.yml +0 -5
  267. data/spec/dummy/config/routes.rb +0 -5
  268. data/spec/dummy/config.ru +0 -4
  269. data/spec/dummy/db/.gitkeep +0 -0
  270. data/spec/dummy/public/500.html +0 -25
  271. data/spec/dummy/public/blank.html +0 -1
  272. data/spec/dummy/public/favicon.ico +0 -0
  273. data/spec/dummy/public/images/bunny.gif +0 -0
  274. data/spec/dummy/public/images/bunny2.jpg +0 -0
  275. data/spec/dummy/public/index.html +0 -279
  276. data/spec/dummy/script/rails +0 -6
  277. data/spec/javascripts/fixtures/mercury/modals/insertlink.html +0 -67
  278. data/spec/javascripts/fixtures/mercury/modals/insertmedia.html +0 -87
  279. data/spec/javascripts/fixtures/mercury/modals/inserttable.html +0 -73
  280. data/spec/javascripts/fixtures/mercury/region.html +0 -6
  281. data/spec/javascripts/fixtures/mercury/regions/full.html +0 -1
  282. data/spec/javascripts/fixtures/mercury/regions/image.html +0 -1
  283. data/spec/javascripts/fixtures/mercury/regions/markdown.html +0 -1
  284. data/spec/javascripts/fixtures/mercury/regions/simple.html +0 -1
  285. data/spec/javascripts/fixtures/mercury/regions/snippets.html +0 -4
  286. data/spec/javascripts/mercury/regions/image_spec.js.coffee +0 -33
  287. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +0 -32
  288. data/spec/javascripts/spec_helper.coffee +0 -4
  289. data/spec/teabag_env.rb +0 -32
@@ -123,6 +123,26 @@ module MercurySelectorsHelpers
123
123
  end
124
124
  end
125
125
 
126
+ def region_selector_for(locator)
127
+ case locator.downcase
128
+
129
+ when 'the first editable region', 'the editable region' then '#editable1'
130
+ when 'the first markupable region', 'the markupable region', 'the markdown region' then '#markupable1'
131
+ when 'the first snippetable region', 'the first snippet region', 'the snippetable region', 'the snippet region' then '#snippetable1'
132
+
133
+ else locator
134
+ end
135
+ end
136
+
137
+ def snippet_name_for(locator)
138
+ case locator.downcase
139
+
140
+ when 'the example snippet' then 'example'
141
+
142
+ else locator
143
+ end
144
+ end
145
+
126
146
  end
127
147
 
128
148
  World(MercurySelectorsHelpers)
@@ -39,29 +39,6 @@ module HtmlSelectorsHelpers
39
39
  "Now, go and add a mapping in #{__FILE__}"
40
40
  end
41
41
  end
42
-
43
- def region_selector_for(locator)
44
- return '#full_1' if locator.blank? || locator == 'the region'
45
- case locator.downcase
46
-
47
- when 'the first full region', 'the full region' then '#full_1'
48
- when 'the first markdown region', 'the markdown region' then '#markdown_1'
49
- when 'the first snippets region', 'the first snippet region', 'the snippets region', 'the snippet region' then '#snippets_1'
50
-
51
- else locator
52
- end
53
- end
54
-
55
- def snippet_name_for(locator)
56
- case locator.downcase
57
-
58
- when 'the example snippet' then 'example'
59
- when 'the snippet with no options' then 'no_options'
60
-
61
- else locator
62
- end
63
- end
64
-
65
42
  end
66
43
 
67
44
  World(HtmlSelectorsHelpers)
@@ -1,5 +1,3 @@
1
- require "mercury/engine"
2
-
3
1
  module Mercury
4
2
  module Generators
5
3
  class InstallGenerator < Rails::Generators::Base
@@ -7,25 +5,38 @@ module Mercury
7
5
 
8
6
  desc "Installs Mercury into your application by copying the configuration file."
9
7
 
10
- class_option :full, :type => :boolean, :aliases => '-g',
11
- :desc => 'Full installation will install the layout and css files for easier customization.'
8
+ class_option :orm, :default => 'active_record', :banner => 'mongoid',
9
+ :desc => 'ORM for required models -- active_record, or mongoid'
12
10
 
13
- class_option :template_engine, :type => :string,
14
- :desc => 'Set preferred template engine for layout instead of ERB (haml or slim)'
11
+ class_option :full, :type => :boolean, :aliases => '-g',
12
+ :desc => 'Full installation will install the layout and css overrides for easier customization.'
15
13
 
16
14
  def copy_config
17
- copy_file 'app/assets/javascripts/mercury.js'
15
+ copy_file 'vendor/assets/javascripts/mercury.js', 'app/assets/javascripts/mercury.js'
18
16
  end
19
17
 
20
18
  def add_routes
21
- route %Q{mount Mercury::Engine => '/'}
19
+ route %Q{Mercury::Engine.routes}
20
+ end
21
+
22
+ def copy_models
23
+ if options[:orm] == 'mongoid'
24
+ copy_file 'lib/generators/mercury/install/templates/mongoid_paperclip_image.rb', 'app/models/mercury/image.rb'
25
+ else
26
+ copy_file 'app/models/mercury/image.rb' if options[:full]
27
+ end
22
28
  end
23
29
 
24
30
  def copy_layout_and_css_overrides
25
- if options[:full] || yes?("Install the layout file and CSS? [yN]")
26
- layout_ext = options[:template_engine] || 'erb'
27
- copy_file "app/views/layouts/mercury.html.#{layout_ext}"
28
- copy_file 'app/assets/stylesheets/mercury.css'
31
+ if options[:full] || yes?("Install the layout and CSS overrides files? [yN]")
32
+ copy_file 'app/views/layouts/mercury.html.erb', 'app/views/layouts/mercury.html.erb'
33
+ copy_file 'vendor/assets/stylesheets/mercury_overrides.css', 'app/assets/stylesheets/mercury_overrides.css'
34
+ end
35
+ end
36
+
37
+ def copy_authentication_overrides
38
+ if options[:full] || yes?("Install the authentication file so you can restrict access to editing? [yN]")
39
+ copy_file 'lib/mercury/authentication.rb'
29
40
  end
30
41
  end
31
42
 
@@ -4,6 +4,5 @@ module Mercury
4
4
  def can_edit?
5
5
  true # check here to see if the user is logged in/has access
6
6
  end
7
-
8
7
  end
9
8
  end
data/lib/mercury-rails.rb CHANGED
@@ -1,2 +1,3 @@
1
- require 'mercury/rails'
1
+ require 'paperclip'
2
2
 
3
+ require File.expand_path('../config/engine', File.dirname(__FILE__))
@@ -1,7 +1,8 @@
1
1
  describe "Mercury.Dialog", ->
2
2
 
3
+ template 'mercury/dialog.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/dialog.html')
5
6
  $.fx.off = true
6
7
  Mercury.determinedLocale =
7
8
  top: {'hello world!': 'bork! bork!'}
@@ -48,7 +49,7 @@ describe "Mercury.Dialog", ->
48
49
  @preloadSpy = spyOn(Mercury.Dialog.prototype, 'preload').andCallFake(=>)
49
50
 
50
51
  it "builds an element", ->
51
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
52
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
52
53
  html = $('<div>').html(@dialog.element).html()
53
54
  expect(html).toContain('class="mercury-dialog mercury-foo-dialog loading"')
54
55
  expect(html).toContain('style="display:none"')
@@ -69,18 +70,18 @@ describe "Mercury.Dialog", ->
69
70
  @loadSpy = spyOn(Mercury.Dialog.prototype, 'load').andCallFake(=>)
70
71
 
71
72
  it "calls load if configured", ->
72
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el, preload: true})
73
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test', preload: true})
73
74
  expect(@loadSpy.callCount).toEqual(1)
74
75
 
75
76
  it "doesn't call load if configured", ->
76
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el, preload: false})
77
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test', preload: false})
77
78
  expect(@loadSpy.callCount).toEqual(0)
78
79
 
79
80
 
80
81
  describe "#toggle", ->
81
82
 
82
83
  beforeEach ->
83
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
84
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
84
85
 
85
86
  it "shows or hides", ->
86
87
  expect(@dialog.element.css('display')).toEqual('none')
@@ -93,7 +94,7 @@ describe "Mercury.Dialog", ->
93
94
  describe "#resize", ->
94
95
 
95
96
  beforeEach ->
96
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
97
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
97
98
 
98
99
  it "calls show", ->
99
100
  spy = spyOn(Mercury.Dialog.prototype, 'show').andCallFake(=>)
@@ -104,7 +105,7 @@ describe "Mercury.Dialog", ->
104
105
  describe "#show", ->
105
106
 
106
107
  beforeEach ->
107
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
108
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
108
109
 
109
110
  it "triggers a custom event to hide all other dialogs", ->
110
111
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
@@ -156,7 +157,7 @@ describe "Mercury.Dialog", ->
156
157
  describe "#appear", ->
157
158
 
158
159
  beforeEach ->
159
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
160
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
160
161
 
161
162
  it "animates the dialog in", ->
162
163
  @dialog.appear()
@@ -169,7 +170,7 @@ describe "Mercury.Dialog", ->
169
170
  describe "#hide", ->
170
171
 
171
172
  beforeEach ->
172
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
173
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
173
174
 
174
175
  it "hides the dialog", ->
175
176
  @dialog.element.css({display: 'block'})
@@ -183,7 +184,7 @@ describe "Mercury.Dialog", ->
183
184
  beforeEach ->
184
185
  @spyFunction = ->
185
186
  Mercury.dialogHandlers.foo = ->
186
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el, for: $('#button')})
187
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test', for: $('#button')})
187
188
 
188
189
  it "does nothing if there's no url", ->
189
190
  spy = spyOn($, 'ajax').andCallFake(=>)
@@ -260,7 +261,7 @@ describe "Mercury.Dialog", ->
260
261
  describe "#loadContent", ->
261
262
 
262
263
  beforeEach ->
263
- @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: fixture.el})
264
+ @dialog = new Mercury.Dialog('/blank.html', 'foo', {appendTo: '#test'})
264
265
 
265
266
  it "sets loaded to be true", ->
266
267
  @dialog.loadContent()
@@ -1,8 +1,9 @@
1
1
  describe "Mercury.dialogHandlers.backColor", ->
2
2
 
3
+ template 'mercury/dialogs/backcolor.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/dialogs/backcolor.html')
5
- @dialog = {element: $(fixture.el), button: $('#button')}
6
+ @dialog = {element: $('#test'), button: $('#button')}
6
7
  Mercury.dialogHandlers.backColor.call(@dialog)
7
8
 
8
9
  describe "when a .picker or .last-picked element is clicked", ->
@@ -1,8 +1,9 @@
1
1
  describe "Mercury.dialogHandlers.foreColor", ->
2
2
 
3
+ template 'mercury/dialogs/forecolor.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/dialogs/forecolor.html')
5
- @dialog = {element: $(fixture.el), button: $('#button')}
6
+ @dialog = {element: $('#test'), button: $('#button')}
6
7
  Mercury.dialogHandlers.foreColor.call(@dialog)
7
8
 
8
9
  describe "when a .picker or .last-picked element is clicked", ->
@@ -25,7 +26,7 @@ describe "Mercury.dialogHandlers.foreColor", ->
25
26
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
26
27
  jasmine.simulate.click($('#white').get(0))
27
28
  expect(spy.callCount).toEqual(1)
28
- expect(spy.argsForCall[0]).toEqual(['action', {action: 'foreColor', value: '#FFFFFF'}])
29
+ expect(spy.argsForCall[0]).toEqual(['action', {action: 'foreColor', value: 'rgb(255, 255, 255)'}])
29
30
 
30
31
 
31
32
  describe "when any other element is clicked", ->
@@ -1,8 +1,9 @@
1
1
  describe "Mercury.dialogHandlers.formatblock", ->
2
2
 
3
+ template 'mercury/dialogs/formatblock.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/dialogs/formatblock.html')
5
- @dialog = {element: $(fixture.el)}
6
+ @dialog = {element: $('#test')}
6
7
  Mercury.dialogHandlers.formatblock.call(@dialog)
7
8
 
8
9
  describe "when an element with a data-tag attribute is clicked", ->
@@ -1,8 +1,9 @@
1
1
  describe "Mercury.dialogHandlers.snippetPanel", ->
2
2
 
3
+ template 'mercury/dialogs/snippetpanel.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/dialogs/snippetpanel.html')
5
- @dialog = {element: $(fixture.el), button: $('#button')}
6
+ @dialog = {element: $('#test'), button: $('#button')}
6
7
  Mercury.dialogHandlers.snippetPanel.call(@dialog)
7
8
 
8
9
  describe "filter", ->
@@ -1,8 +1,9 @@
1
1
  describe "Mercury.dialogHandlers.style", ->
2
2
 
3
+ template 'mercury/dialogs/style.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/dialogs/style.html')
5
- @dialog = {element: $(fixture.el)}
6
+ @dialog = {element: $('#test')}
6
7
  Mercury.dialogHandlers.style.call(@dialog)
7
8
 
8
9
  describe "when an element with a data-class attribute is clicked", ->