kiteditor 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. data/POST_INSTALL +21 -0
  2. data/{vendor → app}/assets/images/mercury/button.png +0 -0
  3. data/{vendor → app}/assets/images/mercury/close.png +0 -0
  4. data/app/assets/images/mercury/default-snippet.png +0 -0
  5. data/{vendor → app}/assets/images/mercury/loading-dark.gif +0 -0
  6. data/{vendor → app}/assets/images/mercury/loading-light.gif +0 -0
  7. data/{vendor → app}/assets/images/mercury/missing-image.png +0 -0
  8. data/{vendor → app}/assets/images/mercury/search-icon.png +0 -0
  9. data/{vendor → app}/assets/images/mercury/temp-logo.png +0 -0
  10. data/app/assets/images/mercury/toolbar/editable/buttons.png +0 -0
  11. data/app/assets/images/mercury/toolbar/primary/_expander.png +0 -0
  12. data/app/assets/images/mercury/toolbar/primary/_pressed.png +0 -0
  13. data/app/assets/images/mercury/toolbar/primary/action.png +0 -0
  14. data/app/assets/images/mercury/toolbar/primary/historypanel.png +0 -0
  15. data/app/assets/images/mercury/toolbar/primary/insertcharacter.png +0 -0
  16. data/app/assets/images/mercury/toolbar/primary/insertlink.png +0 -0
  17. data/app/assets/images/mercury/toolbar/primary/insertmedia.png +0 -0
  18. data/app/assets/images/mercury/toolbar/primary/inserttable.png +0 -0
  19. data/app/assets/images/mercury/toolbar/primary/inspectorpanel.png +0 -0
  20. data/app/assets/images/mercury/toolbar/primary/notespanel.png +0 -0
  21. data/app/assets/images/mercury/toolbar/primary/preview.png +0 -0
  22. data/app/assets/images/mercury/toolbar/primary/redo.png +0 -0
  23. data/app/assets/images/mercury/toolbar/primary/save.png +0 -0
  24. data/app/assets/images/mercury/toolbar/primary/snippetpanel.png +0 -0
  25. data/app/assets/images/mercury/toolbar/primary/tools.png +0 -0
  26. data/app/assets/images/mercury/toolbar/primary/undo.png +0 -0
  27. data/app/assets/images/mercury/toolbar/primary/user.png +0 -0
  28. data/app/assets/images/mercury/toolbar/snippets/buttons.png +0 -0
  29. data/{vendor/assets/javascripts/mercury/dependencies → app/assets/javascripts}/jquery-1.7.js +0 -0
  30. data/{vendor → app}/assets/javascripts/mercury.js +60 -87
  31. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +0 -0
  32. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.additions.js +103 -13
  33. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +0 -0
  34. data/{vendor → app}/assets/javascripts/mercury/dependencies/liquidmetal.js +0 -0
  35. data/{vendor → app}/assets/javascripts/mercury/dependencies/showdown.js +0 -0
  36. data/{vendor → app}/assets/javascripts/mercury/dialog.js.coffee +0 -0
  37. data/{vendor → app}/assets/javascripts/mercury/dialogs/backcolor.js.coffee +0 -0
  38. data/{vendor → app}/assets/javascripts/mercury/dialogs/forecolor.js.coffee +1 -1
  39. data/{vendor → app}/assets/javascripts/mercury/dialogs/formatblock.js.coffee +0 -0
  40. data/{vendor → app}/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +1 -1
  41. data/{vendor → app}/assets/javascripts/mercury/dialogs/style.js.coffee +0 -0
  42. data/{vendor → app}/assets/javascripts/mercury/finalize.js.coffee +0 -0
  43. data/{vendor → app}/assets/javascripts/mercury/history_buffer.js.coffee +0 -0
  44. data/{vendor → app}/assets/javascripts/mercury/lightview.js.coffee +38 -17
  45. data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +201 -0
  46. data/app/assets/javascripts/mercury/locales/da.locale.js.coffee +208 -0
  47. data/{vendor → app}/assets/javascripts/mercury/locales/de.locale.js.coffee +4 -10
  48. data/{vendor → app}/assets/javascripts/mercury/locales/es.locale.js.coffee +3 -9
  49. data/{vendor → app}/assets/javascripts/mercury/locales/example.local.js.coffee +3 -5
  50. data/{vendor → app}/assets/javascripts/mercury/locales/fr.locale.js.coffee +3 -9
  51. data/app/assets/javascripts/mercury/locales/hu.locale.js.coffee +209 -0
  52. data/{vendor → app}/assets/javascripts/mercury/locales/it.locale.js.coffee +3 -9
  53. data/{vendor → app}/assets/javascripts/mercury/locales/ko.local.js.coffee +4 -10
  54. data/{vendor → app}/assets/javascripts/mercury/locales/nl.locale.js.coffee +3 -9
  55. data/app/assets/javascripts/mercury/locales/pl.locale.js.coffee +213 -0
  56. data/{vendor → app}/assets/javascripts/mercury/locales/pt.locale.js.coffee +3 -9
  57. data/app/assets/javascripts/mercury/locales/ru.locale.js.coffee +200 -0
  58. data/{vendor → app}/assets/javascripts/mercury/locales/sv.local.js.coffee +3 -9
  59. data/{vendor → app}/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +3 -9
  60. data/app/assets/javascripts/mercury/locales/uk.locale.js.coffee +200 -0
  61. data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +203 -0
  62. data/app/assets/javascripts/mercury/mercury-compiled.js +10720 -0
  63. data/{vendor → app}/assets/javascripts/mercury/mercury.js.coffee +10 -1
  64. data/{vendor → app}/assets/javascripts/mercury/modal.js.coffee +62 -40
  65. data/{vendor → app}/assets/javascripts/mercury/modals/htmleditor.js.coffee +1 -0
  66. data/{vendor → app}/assets/javascripts/mercury/modals/insertcharacter.js.coffee +1 -0
  67. data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +152 -0
  68. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +132 -0
  69. data/{vendor → app}/assets/javascripts/mercury/modals/insertsnippet.js.coffee +2 -0
  70. data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +68 -0
  71. data/{vendor → app}/assets/javascripts/mercury/native_extensions.js.coffee +0 -6
  72. data/{vendor → app}/assets/javascripts/mercury/page_editor.js.coffee +84 -50
  73. data/{vendor → app}/assets/javascripts/mercury/palette.js.coffee +1 -1
  74. data/{vendor → app}/assets/javascripts/mercury/panel.js.coffee +3 -2
  75. data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +2 -2
  76. data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +0 -0
  77. data/{vendor → app}/assets/javascripts/mercury/region.js.coffee +18 -17
  78. data/{vendor/assets/javascripts/mercury/regions/editable.js.coffee → app/assets/javascripts/mercury/regions/full.js.coffee} +41 -31
  79. data/app/assets/javascripts/mercury/regions/image.js.coffee +93 -0
  80. data/{vendor/assets/javascripts/mercury/regions/markupable.js.coffee → app/assets/javascripts/mercury/regions/markdown.js.coffee} +29 -24
  81. data/{vendor → app}/assets/javascripts/mercury/regions/simple.js.coffee +11 -54
  82. data/{vendor/assets/javascripts/mercury/regions/snippetable.js.coffee → app/assets/javascripts/mercury/regions/snippets.js.coffee} +10 -9
  83. data/{vendor → app}/assets/javascripts/mercury/select.js.coffee +1 -1
  84. data/app/assets/javascripts/mercury/snippet.js.coffee +136 -0
  85. data/{vendor → app}/assets/javascripts/mercury/snippet_toolbar.js.coffee +19 -6
  86. data/{vendor → app}/assets/javascripts/mercury/statusbar.js.coffee +0 -0
  87. data/{vendor → app}/assets/javascripts/mercury/support/history.js +0 -0
  88. data/{vendor → app}/assets/javascripts/mercury/table_editor.js.coffee +16 -0
  89. data/{vendor → app}/assets/javascripts/mercury/toolbar.button.js.coffee +45 -30
  90. data/{vendor → app}/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  91. data/{vendor → app}/assets/javascripts/mercury/toolbar.expander.js.coffee +4 -4
  92. data/{vendor → app}/assets/javascripts/mercury/toolbar.js.coffee +10 -6
  93. data/{vendor → app}/assets/javascripts/mercury/tooltip.js.coffee +0 -0
  94. data/{vendor → app}/assets/javascripts/mercury/uploader.js.coffee +37 -19
  95. data/app/assets/stylesheets/_mercury-bootstrap-overrides.scss +61 -0
  96. data/app/assets/stylesheets/_mercury-sass.scss +33 -0
  97. data/{vendor → app}/assets/stylesheets/mercury.css +1 -5
  98. data/{vendor → app}/assets/stylesheets/mercury/all_images.css.erb +6 -2
  99. data/app/assets/stylesheets/mercury/bootstrap-ish.css +1367 -0
  100. data/app/assets/stylesheets/mercury/bootstrap-overrides.css +61 -0
  101. data/{vendor → app}/assets/stylesheets/mercury/dialog.css +21 -8
  102. data/{vendor → app}/assets/stylesheets/mercury/lightview.css +6 -56
  103. data/app/assets/stylesheets/mercury/mercury.css +43 -0
  104. data/{vendor → app}/assets/stylesheets/mercury/modal.css +15 -32
  105. data/{vendor → app}/assets/stylesheets/mercury/statusbar.css +0 -0
  106. data/{vendor → app}/assets/stylesheets/mercury/toolbar.css +4 -1
  107. data/{vendor → app}/assets/stylesheets/mercury/tooltip.css +0 -0
  108. data/{vendor → app}/assets/stylesheets/mercury/uploader.css +4 -4
  109. data/app/helpers/mercury_helper.rb +7 -0
  110. data/app/views/layouts/mercury.html.erb +10 -20
  111. data/app/views/layouts/mercury.html.haml +19 -0
  112. data/app/views/layouts/mercury.html.slim +19 -0
  113. data/app/views/mercury/modals/character.html +1 -1
  114. data/app/views/mercury/modals/htmleditor.html +3 -7
  115. data/app/views/mercury/modals/link.html +37 -51
  116. data/app/views/mercury/modals/media.html +102 -0
  117. data/app/views/mercury/modals/table.html +79 -73
  118. data/app/views/mercury/panels/snippets.html +6 -1
  119. data/app/views/mercury/snippets/example/options.html.erb +23 -27
  120. data/app/views/mercury/snippets/no_options/preview.html.erb +1 -0
  121. data/config/routes.rb +9 -0
  122. data/features/generators/authentication.feature +10 -0
  123. data/features/generators/images.feature +41 -0
  124. data/features/generators/install.feature +21 -0
  125. data/features/loading/loading.feature +5 -2
  126. data/features/loading/user_interface.feature +9 -7
  127. data/features/regions/{editable → full}/advanced_editing.feature +0 -0
  128. data/features/regions/full/basic_editing.feature +198 -0
  129. data/features/regions/{editable → full}/inserting_links.feature +20 -19
  130. data/features/regions/{editable → full}/inserting_media.feature +36 -18
  131. data/features/regions/{editable → full}/inserting_snippets.feature +28 -18
  132. data/features/regions/{editable → full}/inserting_special_characters.feature +2 -2
  133. data/features/regions/full/inserting_tables.feature +109 -0
  134. data/features/regions/{editable → full}/pasting.feature +0 -0
  135. data/features/regions/{editable → full}/uploading_images.feature +0 -0
  136. data/features/regions/{markupable → image}/uploading_images.feature +0 -0
  137. data/features/regions/{markupable → markdown}/advanced_editing.feature +0 -0
  138. data/features/regions/{markupable → markdown}/basic_editing.feature +0 -0
  139. data/features/regions/{markupable → markdown}/inserting_links.feature +0 -0
  140. data/features/regions/{markupable → markdown}/inserting_media.feature +0 -0
  141. data/features/regions/{markupable → markdown}/inserting_snippets.feature +0 -0
  142. data/features/regions/{markupable → markdown}/inserting_special_characters.feature +0 -0
  143. data/features/regions/{markupable → markdown}/inserting_tables.feature +0 -0
  144. data/features/regions/{snippetable/advanced_editing.feature → markdown/uploading_images.feature} +0 -0
  145. data/features/regions/simple/basic_editing.feature +5 -0
  146. data/features/regions/{snippetable/basic_editing.feature → snippets/advanced_editing.feature} +0 -0
  147. data/features/regions/{snippetable/inserting_snippets.feature → snippets/basic_editing.feature} +0 -0
  148. data/{vendor/assets/javascripts/mercury/locales/da.locale.js.coffee → features/regions/snippets/inserting_snippets.feature} +0 -0
  149. data/features/saving/saving.feature +8 -8
  150. data/features/step_definitions/custom_web_steps.rb +22 -0
  151. data/features/step_definitions/generator_steps.rb +23 -0
  152. data/features/step_definitions/mercury_steps.rb +1 -438
  153. data/features/support/aruba.rb +28 -0
  154. data/features/support/env.rb +11 -1
  155. data/features/support/selectors.rb +23 -0
  156. data/lib/generators/mercury/install/authentication/authentication_generator.rb +17 -0
  157. data/lib/generators/mercury/install/images/images_generator.rb +47 -0
  158. data/{app/models/mercury/image.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image.rb} +7 -0
  159. data/{db/migrate/20110526035601_create_mercury_images.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image_migration.rb} +0 -0
  160. data/{app/controllers/mercury → lib/generators/mercury/install/images/templates}/images_controller.rb +0 -0
  161. data/lib/generators/mercury/install/{templates → images/templates}/mongoid_paperclip_image.rb +0 -0
  162. data/lib/generators/mercury/install/install_generator.rb +12 -23
  163. data/lib/mercury-rails.rb +1 -2
  164. data/lib/mercury/authentication.rb +1 -0
  165. data/lib/mercury/cucumber/step_definitions.rb +13 -0
  166. data/lib/mercury/cucumber/step_definitions/mercury_steps.rb +408 -0
  167. data/{features → lib/mercury/cucumber}/support/mercury_contents.rb +3 -3
  168. data/{features → lib/mercury/cucumber}/support/mercury_selectors.rb +0 -20
  169. data/lib/mercury/engine.rb +19 -0
  170. data/lib/mercury/rails.rb +5 -0
  171. data/lib/mercury/version.rb +3 -0
  172. data/spec/dummy/Rakefile +7 -0
  173. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  174. data/spec/dummy/app/assets/javascripts/prototype.js +6082 -0
  175. data/spec/dummy/app/assets/stylesheets/application.css.scss +110 -0
  176. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  177. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  178. data/spec/dummy/app/views/layouts/mercury.html.erb +28 -0
  179. data/spec/dummy/config.ru +4 -0
  180. data/spec/dummy/config/application.rb +58 -0
  181. data/spec/dummy/config/boot.rb +10 -0
  182. data/spec/dummy/config/database.yml +10 -0
  183. data/spec/dummy/config/environment.rb +5 -0
  184. data/spec/dummy/config/environments/development.rb +37 -0
  185. data/spec/dummy/config/environments/production.rb +67 -0
  186. data/spec/dummy/config/environments/test.rb +37 -0
  187. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  188. data/spec/dummy/config/initializers/inflections.rb +15 -0
  189. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  190. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  191. data/spec/dummy/config/initializers/session_store.rb +8 -0
  192. data/spec/dummy/config/initializers/teabag.rb +9 -0
  193. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  194. data/spec/dummy/config/locales/en.yml +5 -0
  195. data/spec/dummy/config/routes.rb +5 -0
  196. data/spec/dummy/db/.gitkeep +0 -0
  197. data/spec/dummy/public/500.html +25 -0
  198. data/spec/dummy/public/blank.html +1 -0
  199. data/spec/dummy/public/favicon.ico +0 -0
  200. data/spec/dummy/public/images/bunny.gif +0 -0
  201. data/spec/dummy/public/images/bunny2.jpg +0 -0
  202. data/spec/dummy/public/index.html +279 -0
  203. data/spec/dummy/script/rails +6 -0
  204. data/spec/javascripts/{templates → fixtures}/mercury/dialog.html +0 -0
  205. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/backcolor.html +0 -0
  206. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/forecolor.html +0 -0
  207. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/formatblock.html +0 -0
  208. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/snippetpanel.html +0 -0
  209. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/style.html +0 -0
  210. data/spec/javascripts/{templates → fixtures}/mercury/lightview.html +0 -0
  211. data/spec/javascripts/{templates → fixtures}/mercury/modal.html +0 -0
  212. data/spec/javascripts/{templates → fixtures}/mercury/modals/htmleditor.html +0 -0
  213. data/spec/javascripts/{templates → fixtures}/mercury/modals/insertcharacter.html +0 -0
  214. data/spec/javascripts/fixtures/mercury/modals/insertlink.html +67 -0
  215. data/spec/javascripts/fixtures/mercury/modals/insertmedia.html +87 -0
  216. data/spec/javascripts/{templates → fixtures}/mercury/modals/insertsnippet.html +0 -0
  217. data/spec/javascripts/fixtures/mercury/modals/inserttable.html +73 -0
  218. data/spec/javascripts/{templates → fixtures}/mercury/page_editor.html +4 -4
  219. data/spec/javascripts/{templates → fixtures}/mercury/palette.html +0 -0
  220. data/spec/javascripts/{templates → fixtures}/mercury/panel.html +0 -0
  221. data/spec/javascripts/fixtures/mercury/region.html +6 -0
  222. data/spec/javascripts/fixtures/mercury/regions/full.html +1 -0
  223. data/spec/javascripts/fixtures/mercury/regions/image.html +1 -0
  224. data/spec/javascripts/fixtures/mercury/regions/markdown.html +1 -0
  225. data/spec/javascripts/fixtures/mercury/regions/simple.html +1 -0
  226. data/spec/javascripts/fixtures/mercury/regions/snippets.html +4 -0
  227. data/spec/javascripts/{templates → fixtures}/mercury/select.html +0 -0
  228. data/spec/javascripts/{templates → fixtures}/mercury/snippet.html +0 -0
  229. data/spec/javascripts/{templates → fixtures}/mercury/snippet_toolbar.html +0 -0
  230. data/spec/javascripts/{templates → fixtures}/mercury/statusbar.html +0 -0
  231. data/spec/javascripts/{templates → fixtures}/mercury/table_editor.html +0 -0
  232. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.button.html +0 -0
  233. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.button_group.html +0 -0
  234. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.expander.html +0 -0
  235. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.html +0 -0
  236. data/spec/javascripts/{templates → fixtures}/mercury/tooltip.html +0 -0
  237. data/spec/javascripts/{templates → fixtures}/mercury/uploader.html +0 -0
  238. data/spec/javascripts/mercury/{dialog_spec.js.coffee → dialog_spec.coffee} +11 -12
  239. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +2 -3
  240. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +3 -4
  241. data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +2 -3
  242. data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +2 -3
  243. data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +2 -3
  244. data/spec/javascripts/mercury/lightview_spec.js.coffee +180 -142
  245. data/spec/javascripts/mercury/mercury_spec.js.coffee +19 -13
  246. data/spec/javascripts/mercury/modal_spec.js.coffee +192 -148
  247. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +4 -5
  248. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +2 -3
  249. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +107 -34
  250. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +106 -26
  251. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +2 -3
  252. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +50 -40
  253. data/spec/javascripts/mercury/page_editor_spec.js.coffee +124 -80
  254. data/spec/javascripts/mercury/palette_spec.js.coffee +4 -5
  255. data/spec/javascripts/mercury/panel_spec.js.coffee +9 -12
  256. data/spec/javascripts/mercury/region_spec.js.coffee +22 -17
  257. data/spec/javascripts/mercury/regions/{editable_spec.js.coffee → full_spec.js.coffee} +26 -28
  258. data/spec/javascripts/mercury/regions/image_spec.js.coffee +33 -0
  259. data/spec/javascripts/mercury/regions/{markupable_spec.js.coffee → markdown_spec.js.coffee} +32 -34
  260. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +32 -0
  261. data/spec/javascripts/mercury/regions/{snippetable_spec.js.coffee → snippets_spec.js.coffee} +54 -55
  262. data/spec/javascripts/mercury/select_spec.js.coffee +4 -5
  263. data/spec/javascripts/mercury/snippet_spec.js.coffee +92 -16
  264. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +31 -16
  265. data/spec/javascripts/mercury/statusbar_spec.js.coffee +9 -10
  266. data/spec/javascripts/mercury/table_editor_spec.js.coffee +1 -2
  267. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +7 -9
  268. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +55 -26
  269. data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +13 -13
  270. data/spec/javascripts/mercury/toolbar_spec.js.coffee +43 -14
  271. data/spec/javascripts/mercury/tooltip_spec.js.coffee +1 -2
  272. data/spec/javascripts/mercury/uploader_spec.js.coffee +47 -33
  273. data/spec/javascripts/spec_helper.coffee +4 -0
  274. data/spec/javascripts/{spec_helper.js → support/event_simulation.js} +0 -2
  275. data/spec/teabag_env.rb +32 -0
  276. metadata +366 -196
  277. data/features/regions/editable/basic_editing.feature +0 -195
  278. data/features/regions/editable/inserting_tables.feature +0 -109
  279. data/spec/javascripts/templates/mercury/modals/insertlink.html +0 -30
  280. data/spec/javascripts/templates/mercury/modals/insertmedia.html +0 -35
  281. data/spec/javascripts/templates/mercury/modals/inserttable.html +0 -27
  282. data/spec/javascripts/templates/mercury/region.html +0 -2
  283. data/spec/javascripts/templates/mercury/regions/editable.html +0 -3
  284. data/spec/javascripts/templates/mercury/regions/snippetable.html +0 -4
  285. data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +0 -54
  286. data/vendor/assets/javascripts/mercury_loader.js +0 -193
  287. data/vendor/assets/javascripts/mercury_overrides.js +0 -6
  288. data/vendor/assets/stylesheets/mercury/mercury.css +0 -151
  289. data/vendor/assets/stylesheets/mercury_overrides.css +0 -17
@@ -1,6 +1,6 @@
1
1
  <div class="mercury-snippet-panel">
2
2
  <div class="filter">
3
- <input class="filter" type="text">
3
+ <input class="filter focusable" type="text">
4
4
  </div>
5
5
  <ul>
6
6
  <li data-filter="example, snippet, favorite, beer">
@@ -8,5 +8,10 @@
8
8
  <h4>Snippet Name</h4>
9
9
  <div class="description">A one or two line long description of what this snippet does.</div>
10
10
  </li>
11
+ <li data-filter="no options, snippet">
12
+ <img alt="No Option Snippet" data-snippet="no_options" data-options="false" src="/assets/mercury/default-snippet.png"/>
13
+ <h4>No Options Snippet</h4>
14
+ <div class="description">This snippet doesn't have options.</div>
15
+ </li>
11
16
  </ul>
12
17
  </div>
@@ -1,34 +1,30 @@
1
- <%= form_for 'options', { :html => { :style => 'width:600px' } } do |f| %>
1
+ <%= form_for 'options', {url: '', html: {class: 'form-horizontal', style: 'width:615px'}} do |f| %>
2
2
 
3
- <div class="mercury-display-pane-container">
4
- <div class="mercury-display-pane">
5
- <fieldset class="inputs">
6
- <ol>
7
- <li class="string input optional stringish" id="options_first_name_input">
8
- <label class="label" for="options_first_name">First Name</label>
9
- <input id="options_first_name" name="options[first_name]" type="text" value="<%= @options[:first_name] %>"/>
10
- </li>
11
- </ol>
12
- </fieldset>
3
+ <div class="form-inputs mercury-display-pane-container">
13
4
 
14
- <fieldset class="inputs">
15
- <legend><span>Options</span></legend>
16
- <ol>
17
- <li class="string input optional stringish" id="options_favorite_beer_input">
18
- <label class="label" for="options_favorite_beer">Favorite Beer</label>
19
- <input id="options_favorite_beer" name="options[favorite_beer]" type="text" value="<%= @options[:favorite_beer] %>"/>
20
- </li>
21
- </ol>
22
- </fieldset>
23
- </div>
24
- </div>
5
+ <fieldset>
6
+ <div class="control-group string optional">
7
+ <label class="string optional control-label" for="options_first_name">First Name</label>
8
+ <div class="controls">
9
+ <input class="span6 string optional" id="options_first_name" name="options[first_name]" size="50" type="text" value="<%= @options[:first_name] %>">
10
+ </div>
11
+ </div>
12
+ </fieldset>
25
13
 
26
- <div class="mercury-display-controls">
27
- <fieldset class="buttons">
28
- <ol>
29
- <li class="commit button"><input class="submit" name="commit" type="submit" value="Insert Snippet"/></li>
30
- </ol>
14
+ <fieldset>
15
+ <legend>Options</legend>
16
+ <div class="control-group string optional">
17
+ <label class="string optional control-label" for="options_favorite_beer">Favorite Beer</label>
18
+ <div class="controls">
19
+ <input class="span6 string optional" id="options_favorite_beer" name="options[favorite_beer]" size="50" type="text" value="<%= @options[:favorite_beer] %>">
20
+ </div>
21
+ </div>
31
22
  </fieldset>
23
+
24
+ </div>
25
+
26
+ <div class="form-actions mercury-display-controls">
27
+ <input class="btn btn-primary" name="commit" type="submit" value="Insert Snippet"/>
32
28
  </div>
33
29
 
34
30
  <% end %>
@@ -0,0 +1 @@
1
+ <strong>No Option Snippet</strong>
data/config/routes.rb ADDED
@@ -0,0 +1,9 @@
1
+ Mercury::Engine.routes.draw do
2
+ get '/editor(/*requested_uri)' => "mercury#edit", :as => :mercury_editor
3
+
4
+ scope '/mercury' do
5
+ get ':type/:resource' => "mercury#resource"
6
+ get 'snippets/:name/options' => "mercury#snippet_options"
7
+ get 'snippets/:name/preview' => "mercury#snippet_preview"
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ Feature:
2
+ As a developer
3
+ In order to restrict editing using Mercury
4
+ I should be able to use a generator to setup my application
5
+
6
+ Scenario: I can install a basic authentication template
7
+ Given I have created a new rails application
8
+ When I successfully run `bundle exec rails generate mercury:install:authentication --trace`
9
+ Then the following files should exist:
10
+ | lib/mercury/authentication.rb |
@@ -0,0 +1,41 @@
1
+ Feature:
2
+ As a developer
3
+ In order to use image processing within Mercury
4
+ I should be able to use a generator to setup my application
5
+
6
+ Scenario: I can install the image processing files required for Mercury
7
+ Given I have created a new rails application
8
+ When I successfully run `bundle exec rails generate mercury:install:images --trace`
9
+ Then the following files should exist:
10
+ | app/controllers/mercury/images_controller.rb |
11
+ | app/models/mercury/image.rb |
12
+ And the file "app/models/mercury/image.rb" should contain "class Mercury::Image < ActiveRecord::Base"
13
+ And should have the migration "create_mercury_images.rb"
14
+ And the file "config/routes.rb" should contain:
15
+ """
16
+ namespace :mercury do
17
+ resources :images
18
+ end
19
+ """
20
+ And the file "Gemfile" should contain "gem 'paperclip'"
21
+
22
+ Scenario: I can install the image processing files required for Mercury using Mongoid
23
+ Given I have created a new rails application
24
+ When I successfully run `bundle exec rails generate mercury:install:images --orm mongoid --trace`
25
+ Then the following files should exist:
26
+ | app/controllers/mercury/images_controller.rb |
27
+ | app/models/mercury/image.rb |
28
+ And the file "app/models/mercury/image.rb" should contain:
29
+ """
30
+ class Mercury::Image
31
+ include Mongoid::Document
32
+ include Mongoid::Paperclip
33
+ """
34
+ And should not have the migration "create_mercury_images.rb"
35
+ And the file "config/routes.rb" should contain:
36
+ """
37
+ namespace :mercury do
38
+ resources :images
39
+ end
40
+ """
41
+ And the file "Gemfile" should contain "gem 'paperclip'"
@@ -0,0 +1,21 @@
1
+ Feature:
2
+ As a developer
3
+ In order to use Mercury
4
+ I should be able to use a generator to install configuration and overrides into my application
5
+
6
+ Scenario: I can install the Mercury configuration file
7
+ Given I have created a new rails application
8
+ When I run `bundle exec rails generate mercury:install --trace` interactively
9
+ And I type "N"
10
+ Then the following files should exist:
11
+ | app/assets/javascripts/mercury.js |
12
+ And the file "config/routes.rb" should contain "mount Mercury::Engine => '/'"
13
+
14
+ Scenario: I can install the configuration file and overrides
15
+ Given I have created a new rails application
16
+ When I successfully run `bundle exec rails generate mercury:install --full --trace`
17
+ Then the following files should exist:
18
+ | app/assets/javascripts/mercury.js |
19
+ | app/assets/stylesheets/mercury.css |
20
+ | app/views/layouts/mercury.html.erb |
21
+ And the file "config/routes.rb" should contain "mount Mercury::Engine => '/'"
@@ -15,8 +15,11 @@ Feature:
15
15
 
16
16
 
17
17
  Scenario: A user can expect to see the contents of the iframe
18
- Then I should see "Editable region" in the content frame
18
+ Then I should see "Full region" in the content frame
19
19
 
20
20
 
21
+ # Latest selenium webdriver seems to consider the lightview hidden
22
+ @use_hidden_elements
21
23
  Scenario: A user can expect to see the status bar
22
- Then I should see "Mercury Editor v0.3.0" within the statusbar
24
+ Then I should see "Mercury Editor v0.9.0" within the statusbar
25
+
@@ -7,12 +7,14 @@ Feature:
7
7
  Background:
8
8
  Given I am on an editable page
9
9
 
10
- Scenario: A user can expect all this!
10
+ # Scenario: A user can expect all this!
11
11
 
12
12
 
13
- # Scenario: A user can view and close the about dialog
13
+ # Latest selenium webdriver seems to consider the lightview hidden
14
+ @use_hidden_elements
15
+ Scenario: A user can view and close the about dialog
14
16
  When I click on the about the editor link
15
- Then I should see "Mercury Editor" within the lightview title
17
+ Then I should see "Mercury Editor" within the lightview window
16
18
  And I should see "Mercury Editor is an open source HTML5 WYSIWYG editor written in Coffeescript using jQuery. The project has been released under the MIT license." within the lightview window
17
19
  And I should see "Project Home" within the lightview window
18
20
  And I should see "Project Source" within the lightview window
@@ -22,7 +24,7 @@ Feature:
22
24
  And the lightview overlay should not be visible
23
25
 
24
26
 
25
- # Scenario: A user can open and close select dropdowns
27
+ Scenario: A user can open and close select dropdowns
26
28
  When I click on the formatblock editor dropdown
27
29
  Then the formatblock select should be visible
28
30
  And I should see "Heading 1 <h1>" within the formatblock select
@@ -32,7 +34,7 @@ Feature:
32
34
  And the formatblock select should not be visible
33
35
 
34
36
 
35
- # Scenario: A user can open and close palette dialogs
37
+ Scenario: A user can open and close palette dialogs
36
38
  When I click on the background color editor button
37
39
  Then the background color palette should be visible
38
40
 
@@ -41,7 +43,7 @@ Feature:
41
43
  And the background color palette should not be visible
42
44
 
43
45
 
44
- # Scenario: A user can open and close a panel
46
+ Scenario: A user can open and close a panel
45
47
  When I click on the "View History" button
46
48
  Then the history panel should be visible
47
49
  And I should see "Page Version History" within the history panel
@@ -50,7 +52,7 @@ Feature:
50
52
  Then the history panel should not be visible
51
53
 
52
54
 
53
- # Scenario: A user can open and close a modal window
55
+ Scenario: A user can open and close a modal window
54
56
  When I click on the "Insert Link" button
55
57
  Then the modal window should be visible
56
58
  And the modal overlay should be visible
@@ -0,0 +1,198 @@
1
+ @javascript
2
+ Feature:
3
+ As a content editor type person
4
+ In order to manage content
5
+ I should be able to manipulate it in various ways (eg. bold, add italics, set headers, colors, etc.)
6
+
7
+ Background:
8
+ Given I am on an editable page
9
+ And the editor won't prompt when leaving the page
10
+
11
+ Scenario: A user can expect all this!
12
+
13
+
14
+ Scenario: A user can set and unset bold content
15
+ Given the content of the full region is simple content
16
+ And I make a selection
17
+
18
+ When I click on the bold editor button
19
+ Then the contents of the full region should be "this is <b><span>simple</span></b> <b>content</b>"
20
+
21
+ When I click on the bold editor button
22
+ Then the contents of the full region should be "this is <span>simple</span> <b>content</b>"
23
+
24
+
25
+ Scenario: A user can italicize content
26
+ Given the content of the full region is simple content
27
+ And I make a selection
28
+
29
+ When I click on the italicize editor button
30
+ Then the contents of the full region should be "this is <i><span>simple</span></i> <b>content</b>"
31
+
32
+ When I click on the italicize editor button
33
+ Then the contents of the full region should be "this is <span>simple</span> <b>content</b>"
34
+
35
+
36
+ Scenario: A user can overline content
37
+ Given the content of the full region is simple content
38
+ And I make a selection
39
+
40
+ When I click on the overline editor button
41
+ Then the contents of the full region should be "this is <span style='text-decoration:overline'><span>simple</span></span> <b>content</b>"
42
+ # doesn't remove overlines
43
+
44
+
45
+ Scenario: A user can strikeout content
46
+ Given the content of the full region is simple content
47
+ And I make a selection
48
+
49
+ When I click on the strikethrough editor button
50
+ Then the contents of the full region should be "this is <strike><span>simple</span></strike> <b>content</b>"
51
+
52
+ When I click on the strikethrough editor button
53
+ Then the contents of the full region should be "this is <span>simple</span> <b>content</b>"
54
+
55
+
56
+ Scenario: A user can underline content
57
+ Given the content of the full region is simple content
58
+ And I make a selection
59
+
60
+ When I click on the underline editor button
61
+ Then the contents of the full region should be "this is <u><span>simple</span></u> <b>content</b>"
62
+
63
+ When I click on the underline editor button
64
+ Then the contents of the full region should be "this is <span>simple</span> <b>content</b>"
65
+
66
+
67
+ Scenario: A user can make content superscript
68
+ Given the content of the full region is simple content
69
+ And I make a selection
70
+
71
+ When I click on the superscript editor button
72
+ Then the contents of the full region should be "this is <sup><span>simple</span></sup> <b>content</b>"
73
+
74
+ When I click on the superscript editor button
75
+ Then the contents of the full region should be "this is <span>simple</span> <b>content</b>"
76
+
77
+
78
+ Scenario: A user can make content subscript
79
+ Given the content of the full region is simple content
80
+ And I make a selection
81
+
82
+ When I click on the subscript editor button
83
+ Then the contents of the full region should be "this is <sub><span>simple</span></sub> <b>content</b>"
84
+
85
+ When I click on the subscript editor button
86
+ Then the contents of the full region should be "this is <span>simple</span> <b>content</b>"
87
+
88
+
89
+ Scenario: A user can justify content to the left, center, right, or fully justified
90
+ # firefox: this isn't possible on the first line due to a bug in gecko, so we have special content for it
91
+ Given the content of the full region has justifiable content
92
+ And I make a selection
93
+
94
+ When I click on the justify left editor button
95
+ Then the contents of the full region should be "<div>first line</div><br><div align='left'>this is <span>justifiable</span><b>content</b></div>"
96
+
97
+ When I click on the justify center editor button
98
+ Then the contents of the full region should be "<div>first line</div><br><div align='center'>this is <span>justifiable</span><b>content</b></div>"
99
+
100
+ When I click on the justify right editor button
101
+ Then the contents of the full region should be "<div>first line</div><br><div align='right'>this is <span>justifiable</span><b>content</b></div>"
102
+
103
+ When I click on the full justification editor button
104
+ Then the contents of the full region should be "<div>first line</div><br><div align='justify'>this is <span>justifiable</span><b>content</b></div>"
105
+
106
+
107
+ Scenario: A user can make an unordered list
108
+ Given the content of the full region is simple content
109
+ And I make a selection
110
+
111
+ When I click on the insert unordered list editor button
112
+ Then the contents of the full region should be "<ul><li>this is <span>simple</span> <b>content</b></li></ul>"
113
+
114
+ # todo: we should test enter and tab, and shift+tab in advanced editing
115
+
116
+
117
+ Scenario: A user can make an ordered list
118
+ Given the content of the full region is simple content
119
+ And I make a selection
120
+
121
+ When I click on the insert ordered list editor button
122
+ Then the contents of the full region should be "<ol><li>this is <span>simple</span> <b>content</b></li></ol>"
123
+
124
+ # todo: we should test enter and tab, and shift+tab in advanced editing
125
+
126
+
127
+ Scenario: A user can indent and outdent content
128
+ # firefox: this isn't possible on the first line due to a bug in gecko, so we have special content for it
129
+ Given the content of the full region has justifiable content
130
+ And I make a selection
131
+
132
+ When I click on the indent editor button
133
+ Then the contents of the full region should be "<div>first line</div><br><blockquote>this is <span>justifiable</span><b>content</b></blockquote>"
134
+
135
+ When I click on the indent editor button
136
+ Then the contents of the full region should be "<div>first line</div><br><blockquote><blockquote>this is <span>justifiable</span><b>content</b></blockquote></blockquote>"
137
+
138
+ When I click on the outdent editor button
139
+ Then the contents of the full region should be "<div>first line</div><br><blockquote>this is <span>justifiable</span><b>content</b></blockquote>"
140
+
141
+ When I click on the outdent editor button
142
+ Then the contents of the full region should be "<div>first line</div><br>this is <span>justifiable</span><b>content</b>"
143
+
144
+
145
+ Scenario: A user can insert horizontal rules
146
+ Given the content of the full region is simple content
147
+ And I make a selection
148
+
149
+ When I click on the insert hr editor button
150
+ Then the contents of the full region should be "this is&nbsp;<hr> <b>content</b>"
151
+
152
+ When I click on the insert hr editor button
153
+ Then the contents of the full region should be "this is&nbsp;<hr><hr> <b>content</b>"
154
+
155
+
156
+ Scenario: A user can clean/remove formatting on their selection
157
+ Given the content of the full region has wrapped content
158
+ And I make a selection
159
+
160
+ When I click on the remove formatting editor button
161
+ Then the contents of the full region should be "this is wrapped content"
162
+
163
+
164
+ Scenario: A user can wrap content within predefined styles
165
+ Given the content of the full region is simple content
166
+ And I make a selection
167
+
168
+ When I click on the style editor dropdown
169
+ And select the red style from the dropdown
170
+ Then the contents of the full region should be "this is <span class='red'><span>simple</span></span> <b>content</b>"
171
+
172
+
173
+ Scenario: A user can wrap content in formatted block tags
174
+ Given the content of the full region is simple content
175
+ And I make a selection
176
+
177
+ When I click on the block format editor dropdown
178
+ And select the heading 2 block from the dropdown
179
+ Then the contents of the full region should be "<h2>this is <span>simple</span> <b>content</b></h2>"
180
+
181
+
182
+ Scenario: A user can set the background color of a selection
183
+ Given the content of the full region is simple content
184
+ And I make a selection
185
+
186
+ When I click on the background color editor palette
187
+ And click on the color red
188
+ Then the contents of the full region should be "this is <span style='background-color:#FF0000'><span>simple</span></span> <b>content</b>"
189
+
190
+
191
+ Scenario: A user can set the foreground color
192
+ Given the content of the full region is simple content
193
+ And I make a selection
194
+
195
+ When I click on the foreground color editor palette
196
+ And click on the color red
197
+ Then the contents of the full region should be "this is <font color='#FF0000'><span>simple</span></font> <b>content</b>"
198
+
@@ -8,11 +8,11 @@ Feature:
8
8
  Given I am on an editable page
9
9
  And the editor won't prompt when leaving the page
10
10
 
11
- Scenario: A user can expect all this!
11
+ # Scenario: A user can expect all this!
12
12
 
13
13
 
14
- # Scenario: A user can insert and edit a link to an external site
15
- Given the content of the editable region is simple content
14
+ Scenario: A user can insert and edit a link to an external site
15
+ Given the content of the full region is simple content
16
16
  And I make a selection
17
17
 
18
18
  When I click on the "Insert Link" button
@@ -21,7 +21,7 @@ Feature:
21
21
 
22
22
  When I fill in "URL" with "http://google.com"
23
23
  And press "Insert Link"
24
- Then the contents of the editable region should be "this is <a href='http://google.com'>simple</a> <b>content</b>"
24
+ Then the contents of the full region should be "this is <a href='http://google.com'>simple</a> <b>content</b>"
25
25
  And the modal window should not be visible
26
26
 
27
27
  When I click on the "Insert Link" button
@@ -29,27 +29,27 @@ Feature:
29
29
 
30
30
  When I fill in "URL" with "http://cnn.com"
31
31
  And press "Insert Link"
32
- Then the contents of the editable region should be "this is <a href='http://cnn.com'>simple</a> <b>content</b>"
32
+ Then the contents of the full region should be "this is <a href='http://cnn.com'>simple</a> <b>content</b>"
33
33
 
34
34
 
35
- # Scenario: A user can insert and edit a link with a target set
36
- Given the content of the editable region is simple content
35
+ Scenario: A user can insert and edit a link with a target set
36
+ Given the content of the full region is simple content
37
37
  And I make a selection
38
38
 
39
39
  When I click on the "Insert Link" button
40
40
  And fill in "URL" with "http://google.com"
41
41
  And select "Blank (a new window or tab)" from "Link Target"
42
42
  And press "Insert Link"
43
- Then the contents of the editable region should be "this is <a target='_blank' href='http://google.com'>simple</a> <b>content</b>"
43
+ Then the contents of the full region should be "this is <a target='_blank' href='http://google.com'>simple</a> <b>content</b>"
44
44
 
45
45
  When I click on the "Insert Link" button
46
46
  And select "Top (removes any frames)" from "Link Target"
47
47
  And press "Insert Link"
48
- Then the contents of the editable region should be "this is <a target='_top' href='http://google.com'>simple</a> <b>content</b>"
48
+ Then the contents of the full region should be "this is <a target='_top' href='http://google.com'>simple</a> <b>content</b>"
49
49
 
50
50
 
51
- # Scenario: A user can insert a link to an external site and open it in a popup
52
- Given the content of the editable region is simple content
51
+ Scenario: A user can insert a link to an external site and open it in a popup
52
+ Given the content of the full region is simple content
53
53
  And I make a selection
54
54
 
55
55
  When I click on the "Insert Link" button
@@ -58,29 +58,29 @@ Feature:
58
58
  And I fill in "Popup Width" with "500"
59
59
  And fill in "Popup Height" with "200"
60
60
  And press "Insert Link"
61
- Then the contents of the editable region should be "this is <a href='javascript:void(window.open('http://google.com', 'popup_window', 'width=500,height=200,menubar=no,toolbar=no'))'>simple</a> <b>content</b>"
61
+ Then the contents of the full region should be "this is <a href='javascript:void(window.open('http://google.com', 'popup_window', 'width=500,height=200,menubar=no,toolbar=no'))'>simple</a> <b>content</b>"
62
62
 
63
63
  When I click on the "Insert Link" button
64
64
  Then the "Popup Width" field should contain "500"
65
65
  And the "Popup Height" field should contain "200"
66
66
 
67
67
 
68
- # Scenario: A user can insert a bookmark and then link to it
69
- Given the content of the editable region is simple content
68
+ Scenario: A user can insert a bookmark and then link to it
69
+ Given the content of the full region is simple content
70
70
  And I make a selection
71
71
 
72
72
  When I click on the "Insert Link" button
73
73
  And I choose "Bookmark"
74
74
  And fill in "Bookmark" with "test-bookmark1"
75
75
  And press "Insert Link"
76
- Then the contents of the editable region should be "this is <a name='test-bookmark1'>simple</a> <b>content</b>"
76
+ Then the contents of the full region should be "this is <a name='test-bookmark1'>simple</a> <b>content</b>"
77
77
 
78
78
  When I make a selection for "b"
79
79
  And click on the "Insert Link" button
80
80
  And I choose "Existing Links"
81
81
  And select "simple" from "Existing Links"
82
82
  And press "Insert Link"
83
- Then the contents of the editable region should be "this is <a name='test-bookmark1'>simple</a> <a href='#test-bookmark1'>content</a>"
83
+ Then the contents of the full region should be "this is <a name='test-bookmark1'>simple</a> <a href='#test-bookmark1'>content</a>"
84
84
 
85
85
  When I make a selection for "a"
86
86
  And click on the "Insert Link" button
@@ -89,10 +89,11 @@ Feature:
89
89
  And I choose "Bookmark"
90
90
  And fill in "Bookmark" with "test-bookmark2"
91
91
  And press "Insert Link"
92
- Then the contents of the editable region should be "this is <a name='test-bookmark2'>simple</a> <a href='#test-bookmark1'>content</a>"
92
+ Then the contents of the full region should be "this is <a name='test-bookmark2'>simple</a> <a href='#test-bookmark1'>content</a>"
93
93
 
94
94
  # todo: when I change the name of a bookmark, and bookmarks that are pointing to me should also be updated (on this page)
95
95
 
96
96
 
97
- Scenario: A user can navigate links inside of regions
98
- # todo: finish
97
+ # Scenario: A user can navigate links inside of regions
98
+ # todo: finish
99
+