kuji-mercury-rails 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. data/LICENSE +25 -0
  2. data/POST_INSTALL +15 -0
  3. data/app/controllers/mercury/images_controller.rb +19 -0
  4. data/app/controllers/mercury_controller.rb +34 -0
  5. data/app/models/mercury/image.rb +16 -0
  6. data/app/views/layouts/mercury.html.erb +33 -0
  7. data/app/views/mercury/lightviews/about.html +11 -0
  8. data/app/views/mercury/modals/character.html +255 -0
  9. data/app/views/mercury/modals/htmleditor.html +13 -0
  10. data/app/views/mercury/modals/link.html +75 -0
  11. data/app/views/mercury/modals/media.html +82 -0
  12. data/app/views/mercury/modals/table.html +84 -0
  13. data/app/views/mercury/palettes/backcolor.html +73 -0
  14. data/app/views/mercury/palettes/forecolor.html +73 -0
  15. data/app/views/mercury/panels/history.html +3 -0
  16. data/app/views/mercury/panels/notes.html +3 -0
  17. data/app/views/mercury/panels/snippets.html +12 -0
  18. data/app/views/mercury/selects/formatblock.html +11 -0
  19. data/app/views/mercury/selects/style.html +5 -0
  20. data/app/views/mercury/snippets/example/options.html.erb +34 -0
  21. data/app/views/mercury/snippets/example/preview.html.erb +1 -0
  22. data/config/engine.rb +41 -0
  23. data/db/migrate/20110526035601_create_mercury_images.rb +11 -0
  24. data/features/loading/loading.feature +22 -0
  25. data/features/loading/navigating.feature +77 -0
  26. data/features/loading/user_interface.feature +67 -0
  27. data/features/regions/editable/advanced_editing.feature +0 -0
  28. data/features/regions/editable/basic_editing.feature +195 -0
  29. data/features/regions/editable/inserting_links.feature +98 -0
  30. data/features/regions/editable/inserting_media.feature +110 -0
  31. data/features/regions/editable/inserting_snippets.feature +102 -0
  32. data/features/regions/editable/inserting_special_characters.feature +24 -0
  33. data/features/regions/editable/inserting_tables.feature +109 -0
  34. data/features/regions/editable/pasting.feature +0 -0
  35. data/features/regions/editable/uploading_images.feature +0 -0
  36. data/features/regions/image/uploading_images.feature +0 -0
  37. data/features/regions/markupable/advanced_editing.feature +0 -0
  38. data/features/regions/markupable/basic_editing.feature +0 -0
  39. data/features/regions/markupable/inserting_links.feature +0 -0
  40. data/features/regions/markupable/inserting_media.feature +0 -0
  41. data/features/regions/markupable/inserting_snippets.feature +0 -0
  42. data/features/regions/markupable/inserting_special_characters.feature +0 -0
  43. data/features/regions/markupable/inserting_tables.feature +0 -0
  44. data/features/regions/markupable/uploading_images.feature +0 -0
  45. data/features/regions/simple/basic_editing.feature +5 -0
  46. data/features/regions/snippetable/advanced_editing.feature +0 -0
  47. data/features/regions/snippetable/basic_editing.feature +0 -0
  48. data/features/regions/snippetable/inserting_snippets.feature +0 -0
  49. data/features/saving/saving.feature +33 -0
  50. data/features/step_definitions/debug_steps.rb +14 -0
  51. data/features/step_definitions/mercury_steps.rb +438 -0
  52. data/features/step_definitions/web_steps.rb +211 -0
  53. data/features/support/env.rb +46 -0
  54. data/features/support/mercury_contents.rb +25 -0
  55. data/features/support/mercury_selectors.rb +148 -0
  56. data/features/support/paths.rb +38 -0
  57. data/features/support/selectors.rb +44 -0
  58. data/lib/generators/mercury/install/install_generator.rb +49 -0
  59. data/lib/generators/mercury/install/templates/mongoid_paperclip_image.rb +17 -0
  60. data/lib/mercury-rails.rb +3 -0
  61. data/lib/mercury/authentication.rb +8 -0
  62. data/spec/javascripts/mercury/dialog_spec.js.coffee +281 -0
  63. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +37 -0
  64. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +37 -0
  65. data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +25 -0
  66. data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +30 -0
  67. data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +25 -0
  68. data/spec/javascripts/mercury/history_buffer_spec.js.coffee +76 -0
  69. data/spec/javascripts/mercury/lightview_spec.js.coffee +497 -0
  70. data/spec/javascripts/mercury/mercury_spec.js.coffee +132 -0
  71. data/spec/javascripts/mercury/modal_spec.js.coffee +504 -0
  72. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +30 -0
  73. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +29 -0
  74. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +220 -0
  75. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +167 -0
  76. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +52 -0
  77. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +160 -0
  78. data/spec/javascripts/mercury/native_extensions_spec.js.coffee +60 -0
  79. data/spec/javascripts/mercury/page_editor_spec.js.coffee +757 -0
  80. data/spec/javascripts/mercury/palette_spec.js.coffee +49 -0
  81. data/spec/javascripts/mercury/panel_spec.js.coffee +183 -0
  82. data/spec/javascripts/mercury/region_spec.js.coffee +298 -0
  83. data/spec/javascripts/mercury/regions/editable_spec.js.coffee +561 -0
  84. data/spec/javascripts/mercury/regions/image_spec.js.coffee +34 -0
  85. data/spec/javascripts/mercury/regions/markupable_spec.js.coffee +367 -0
  86. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +33 -0
  87. data/spec/javascripts/mercury/regions/snippetable_spec.js.coffee +370 -0
  88. data/spec/javascripts/mercury/select_spec.js.coffee +49 -0
  89. data/spec/javascripts/mercury/snippet_spec.js.coffee +253 -0
  90. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +184 -0
  91. data/spec/javascripts/mercury/statusbar_spec.js.coffee +150 -0
  92. data/spec/javascripts/mercury/table_editor_spec.js.coffee +194 -0
  93. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +90 -0
  94. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +360 -0
  95. data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +118 -0
  96. data/spec/javascripts/mercury/toolbar_spec.js.coffee +222 -0
  97. data/spec/javascripts/mercury/tooltip_spec.js.coffee +186 -0
  98. data/spec/javascripts/mercury/uploader_spec.js.coffee +530 -0
  99. data/spec/javascripts/spec_helper.js +513 -0
  100. data/spec/javascripts/templates/mercury/dialog.html +2 -0
  101. data/spec/javascripts/templates/mercury/dialogs/backcolor.html +5 -0
  102. data/spec/javascripts/templates/mercury/dialogs/forecolor.html +5 -0
  103. data/spec/javascripts/templates/mercury/dialogs/formatblock.html +3 -0
  104. data/spec/javascripts/templates/mercury/dialogs/snippetpanel.html +16 -0
  105. data/spec/javascripts/templates/mercury/dialogs/style.html +3 -0
  106. data/spec/javascripts/templates/mercury/lightview.html +13 -0
  107. data/spec/javascripts/templates/mercury/modal.html +13 -0
  108. data/spec/javascripts/templates/mercury/modals/htmleditor.html +5 -0
  109. data/spec/javascripts/templates/mercury/modals/insertcharacter.html +5 -0
  110. data/spec/javascripts/templates/mercury/modals/insertlink.html +30 -0
  111. data/spec/javascripts/templates/mercury/modals/insertmedia.html +35 -0
  112. data/spec/javascripts/templates/mercury/modals/insertsnippet.html +6 -0
  113. data/spec/javascripts/templates/mercury/modals/inserttable.html +27 -0
  114. data/spec/javascripts/templates/mercury/page_editor.html +35 -0
  115. data/spec/javascripts/templates/mercury/palette.html +16 -0
  116. data/spec/javascripts/templates/mercury/panel.html +16 -0
  117. data/spec/javascripts/templates/mercury/region.html +2 -0
  118. data/spec/javascripts/templates/mercury/regions/editable.html +3 -0
  119. data/spec/javascripts/templates/mercury/regions/image.html +1 -0
  120. data/spec/javascripts/templates/mercury/regions/simple.html +3 -0
  121. data/spec/javascripts/templates/mercury/regions/snippetable.html +4 -0
  122. data/spec/javascripts/templates/mercury/select.html +16 -0
  123. data/spec/javascripts/templates/mercury/snippet.html +1 -0
  124. data/spec/javascripts/templates/mercury/snippet_toolbar.html +16 -0
  125. data/spec/javascripts/templates/mercury/statusbar.html +8 -0
  126. data/spec/javascripts/templates/mercury/table_editor.html +65 -0
  127. data/spec/javascripts/templates/mercury/toolbar.button.html +64 -0
  128. data/spec/javascripts/templates/mercury/toolbar.button_group.html +9 -0
  129. data/spec/javascripts/templates/mercury/toolbar.expander.html +18 -0
  130. data/spec/javascripts/templates/mercury/toolbar.html +11 -0
  131. data/spec/javascripts/templates/mercury/tooltip.html +12 -0
  132. data/spec/javascripts/templates/mercury/uploader.html +11 -0
  133. data/vendor/assets/images/mercury/button.png +0 -0
  134. data/vendor/assets/images/mercury/close.png +0 -0
  135. data/vendor/assets/images/mercury/default-snippet.png +0 -0
  136. data/vendor/assets/images/mercury/loading-dark.gif +0 -0
  137. data/vendor/assets/images/mercury/loading-light.gif +0 -0
  138. data/vendor/assets/images/mercury/missing-image.png +0 -0
  139. data/vendor/assets/images/mercury/search-icon.png +0 -0
  140. data/vendor/assets/images/mercury/temp-logo.png +0 -0
  141. data/vendor/assets/images/mercury/toolbar/editable/buttons.png +0 -0
  142. data/vendor/assets/images/mercury/toolbar/primary/_expander.png +0 -0
  143. data/vendor/assets/images/mercury/toolbar/primary/_pressed.png +0 -0
  144. data/vendor/assets/images/mercury/toolbar/primary/historypanel.png +0 -0
  145. data/vendor/assets/images/mercury/toolbar/primary/insertcharacter.png +0 -0
  146. data/vendor/assets/images/mercury/toolbar/primary/insertlink.png +0 -0
  147. data/vendor/assets/images/mercury/toolbar/primary/insertmedia.png +0 -0
  148. data/vendor/assets/images/mercury/toolbar/primary/inserttable.png +0 -0
  149. data/vendor/assets/images/mercury/toolbar/primary/inspectorpanel.png +0 -0
  150. data/vendor/assets/images/mercury/toolbar/primary/notespanel.png +0 -0
  151. data/vendor/assets/images/mercury/toolbar/primary/preview.png +0 -0
  152. data/vendor/assets/images/mercury/toolbar/primary/redo.png +0 -0
  153. data/vendor/assets/images/mercury/toolbar/primary/save.png +0 -0
  154. data/vendor/assets/images/mercury/toolbar/primary/snippetpanel.png +0 -0
  155. data/vendor/assets/images/mercury/toolbar/primary/undo.png +0 -0
  156. data/vendor/assets/images/mercury/toolbar/snippetable/buttons.png +0 -0
  157. data/vendor/assets/javascripts/mercury.js +479 -0
  158. data/vendor/assets/javascripts/mercury/dependencies/jquery-1.7.js +9300 -0
  159. data/vendor/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +1328 -0
  160. data/vendor/assets/javascripts/mercury/dependencies/jquery.additions.js +206 -0
  161. data/vendor/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +527 -0
  162. data/vendor/assets/javascripts/mercury/dependencies/liquidmetal.js +88 -0
  163. data/vendor/assets/javascripts/mercury/dependencies/showdown.js +1340 -0
  164. data/vendor/assets/javascripts/mercury/dialog.js.coffee +159 -0
  165. data/vendor/assets/javascripts/mercury/dialogs/backcolor.js.coffee +6 -0
  166. data/vendor/assets/javascripts/mercury/dialogs/forecolor.js.coffee +6 -0
  167. data/vendor/assets/javascripts/mercury/dialogs/formatblock.js.coffee +4 -0
  168. data/vendor/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +10 -0
  169. data/vendor/assets/javascripts/mercury/dialogs/style.js.coffee +4 -0
  170. data/vendor/assets/javascripts/mercury/finalize.js.coffee +3 -0
  171. data/vendor/assets/javascripts/mercury/history_buffer.js.coffee +30 -0
  172. data/vendor/assets/javascripts/mercury/lightview.js.coffee +205 -0
  173. data/vendor/assets/javascripts/mercury/locales/ar.locale.js.coffee +207 -0
  174. data/vendor/assets/javascripts/mercury/locales/da.locale.js.coffee +211 -0
  175. data/vendor/assets/javascripts/mercury/locales/de.locale.js.coffee +206 -0
  176. data/vendor/assets/javascripts/mercury/locales/es.locale.js.coffee +211 -0
  177. data/vendor/assets/javascripts/mercury/locales/example.local.js.coffee +211 -0
  178. data/vendor/assets/javascripts/mercury/locales/fr.locale.js.coffee +211 -0
  179. data/vendor/assets/javascripts/mercury/locales/it.locale.js.coffee +208 -0
  180. data/vendor/assets/javascripts/mercury/locales/ko.local.js.coffee +206 -0
  181. data/vendor/assets/javascripts/mercury/locales/nl.locale.js.coffee +206 -0
  182. data/vendor/assets/javascripts/mercury/locales/pt.locale.js.coffee +211 -0
  183. data/vendor/assets/javascripts/mercury/locales/sv.local.js.coffee +209 -0
  184. data/vendor/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +213 -0
  185. data/vendor/assets/javascripts/mercury/mercury.js.coffee +109 -0
  186. data/vendor/assets/javascripts/mercury/modal.js.coffee +198 -0
  187. data/vendor/assets/javascripts/mercury/modals/htmleditor.js.coffee +11 -0
  188. data/vendor/assets/javascripts/mercury/modals/insertcharacter.js.coffee +4 -0
  189. data/vendor/assets/javascripts/mercury/modals/insertlink.js.coffee +92 -0
  190. data/vendor/assets/javascripts/mercury/modals/insertmedia.js.coffee +81 -0
  191. data/vendor/assets/javascripts/mercury/modals/insertsnippet.js.coffee +12 -0
  192. data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +54 -0
  193. data/vendor/assets/javascripts/mercury/native_extensions.js.coffee +55 -0
  194. data/vendor/assets/javascripts/mercury/page_editor.js.coffee +225 -0
  195. data/vendor/assets/javascripts/mercury/palette.js.coffee +29 -0
  196. data/vendor/assets/javascripts/mercury/panel.js.coffee +115 -0
  197. data/vendor/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +28 -0
  198. data/vendor/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +9 -0
  199. data/vendor/assets/javascripts/mercury/region.js.coffee +107 -0
  200. data/vendor/assets/javascripts/mercury/regions/editable.js.coffee +600 -0
  201. data/vendor/assets/javascripts/mercury/regions/image.js.coffee +114 -0
  202. data/vendor/assets/javascripts/mercury/regions/markupable.js.coffee +398 -0
  203. data/vendor/assets/javascripts/mercury/regions/simple.js.coffee +325 -0
  204. data/vendor/assets/javascripts/mercury/regions/snippetable.js.coffee +124 -0
  205. data/vendor/assets/javascripts/mercury/select.js.coffee +44 -0
  206. data/vendor/assets/javascripts/mercury/snippet.js.coffee +106 -0
  207. data/vendor/assets/javascripts/mercury/snippet_toolbar.js.coffee +72 -0
  208. data/vendor/assets/javascripts/mercury/statusbar.js.coffee +51 -0
  209. data/vendor/assets/javascripts/mercury/support/history.js +1 -0
  210. data/vendor/assets/javascripts/mercury/table_editor.js.coffee +265 -0
  211. data/vendor/assets/javascripts/mercury/toolbar.button.js.coffee +173 -0
  212. data/vendor/assets/javascripts/mercury/toolbar.button_group.js.coffee +42 -0
  213. data/vendor/assets/javascripts/mercury/toolbar.expander.js.coffee +56 -0
  214. data/vendor/assets/javascripts/mercury/toolbar.js.coffee +86 -0
  215. data/vendor/assets/javascripts/mercury/tooltip.js.coffee +74 -0
  216. data/vendor/assets/javascripts/mercury/uploader.js.coffee +244 -0
  217. data/vendor/assets/javascripts/mercury_loader.js +193 -0
  218. data/vendor/assets/javascripts/mercury_overrides.js +6 -0
  219. data/vendor/assets/stylesheets/mercury.css +28 -0
  220. data/vendor/assets/stylesheets/mercury/all_images.css.erb +89 -0
  221. data/vendor/assets/stylesheets/mercury/dialog.css +212 -0
  222. data/vendor/assets/stylesheets/mercury/form.css +118 -0
  223. data/vendor/assets/stylesheets/mercury/lightview.css +151 -0
  224. data/vendor/assets/stylesheets/mercury/mercury.css +37 -0
  225. data/vendor/assets/stylesheets/mercury/modal.css +183 -0
  226. data/vendor/assets/stylesheets/mercury/statusbar.css +32 -0
  227. data/vendor/assets/stylesheets/mercury/toolbar.css +304 -0
  228. data/vendor/assets/stylesheets/mercury/tooltip.css +26 -0
  229. data/vendor/assets/stylesheets/mercury/uploader.css +111 -0
  230. data/vendor/assets/stylesheets/mercury_overrides.css +17 -0
  231. metadata +572 -0
@@ -0,0 +1,22 @@
1
+ @javascript
2
+ Feature:
3
+ As a content editor type person
4
+ In order to manage content
5
+ I should be able to expect the editor to load properly
6
+
7
+ Background:
8
+ Given I am on an editable page
9
+
10
+
11
+ Scenario: A user can expect to see the toolbar
12
+ Then I should see "Save" within the toolbar
13
+ And I should see "Preview" within the toolbar
14
+ And I should see "Bold" within the toolbar
15
+
16
+
17
+ Scenario: A user can expect to see the contents of the iframe
18
+ Then I should see "Editable region" in the content frame
19
+
20
+
21
+ Scenario: A user can expect to see the status bar
22
+ Then I should see "Mercury Editor v0.3.1" within the statusbar
@@ -0,0 +1,77 @@
1
+ @javascript
2
+ Feature:
3
+ As a content editor type person
4
+ In order to manage content
5
+ I should be able to expect the editor to not get in the way when I navigate and submit forms
6
+
7
+ Background:
8
+ Given I adjust the configuration to have: {"nonHijackableClasses": ["lightview"]}
9
+ And am on an editable page
10
+
11
+
12
+ Scenario: A user can navigate links targeting _top
13
+ When I follow "_top" in the content frame
14
+ Then I should be on the test page
15
+
16
+
17
+ Scenario: A user can navigate links targeting _blank
18
+ When I follow "_blank" in the content frame
19
+ Then I should be on the editable page
20
+ And I should see "test_page" in the "/mercury/test_page" window
21
+
22
+
23
+ Scenario: A user can navigate links targeting _self
24
+ When I follow "_self" in the content frame
25
+ Then I should be on the test page
26
+
27
+
28
+ Scenario: A user can navigate links with no target set
29
+ When I follow "[none]" in the content frame
30
+ Then I should be on the test page
31
+
32
+
33
+ Scenario: A user can navigate links that are ignored by configuration
34
+ When I follow "_self .lightview" in the content frame
35
+ Then I should be on the editable page
36
+
37
+
38
+ Scenario: A user can navigate links targeting random windows
39
+ When I follow "foo" in the content frame
40
+ Then I should be on the editable page
41
+ Then I should see "test_page" in the "foo" window
42
+
43
+
44
+ Scenario: A user can submit forms targeting _top
45
+ When I press "post _top" in the content frame
46
+ Then I should be on the test page
47
+ And I should see "post _top"
48
+
49
+
50
+ # todo: intermittent failure
51
+ # Scenario: A user can submit forms targeting _blank
52
+ # When I press "post _blank" in the content frame
53
+ # Then I should be on the editable page
54
+ # And I should see "post _blank" in the "/mercury/test_page" window
55
+
56
+
57
+ Scenario: A user can submit forms targeting _self
58
+ When I press "post _self" in the content frame
59
+ Then I should be on the test page
60
+ And I should see "post _self"
61
+
62
+
63
+ Scenario: A user can submit forms with no target set
64
+ When I press "get [none]" in the content frame
65
+ Then I should be on the test page
66
+ And I should see "get [none]"
67
+
68
+
69
+ Scenario: A user can submit forms that are ignored by configuration
70
+ When I press "post _self .lightview" in the content frame
71
+ Then I should be on the editable page
72
+
73
+
74
+ Scenario: A user can submit forms targeting random windows
75
+ When I press "get foo" in the content frame
76
+ Then I should be on the editable page
77
+ And I should see "get foo" in the "foo" window
@@ -0,0 +1,67 @@
1
+ @javascript
2
+ Feature:
3
+ As a content editor type person
4
+ In order to manage content
5
+ I should be able to interact with various user interface aspects of the editor
6
+
7
+ Background:
8
+ Given I am on an editable page
9
+
10
+ Scenario: A user can expect all this!
11
+
12
+
13
+ # Scenario: A user can view and close the about dialog
14
+ When I click on the about the editor link
15
+ Then I should see "Mercury Editor" within the lightview title
16
+ 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
+ And I should see "Project Home" within the lightview window
18
+ And I should see "Project Source" within the lightview window
19
+
20
+ When I click on the lightview overlay
21
+ Then the lightview window should not be visible
22
+ And the lightview overlay should not be visible
23
+
24
+
25
+ # Scenario: A user can open and close select dropdowns
26
+ When I click on the formatblock editor dropdown
27
+ Then the formatblock select should be visible
28
+ And I should see "Heading 1 <h1>" within the formatblock select
29
+
30
+ When I click on the style editor dropdown
31
+ Then the style select should be visible
32
+ And the formatblock select should not be visible
33
+
34
+
35
+ # Scenario: A user can open and close palette dialogs
36
+ When I click on the background color editor button
37
+ Then the background color palette should be visible
38
+
39
+ When I click on the foreground color editor button
40
+ Then the foreground color palette should be visible
41
+ And the background color palette should not be visible
42
+
43
+
44
+ # Scenario: A user can open and close a panel
45
+ When I click on the "View History" button
46
+ Then the history panel should be visible
47
+ And I should see "Page Version History" within the history panel
48
+
49
+ When I click on the "View History" button
50
+ Then the history panel should not be visible
51
+
52
+
53
+ # Scenario: A user can open and close a modal window
54
+ When I click on the "Insert Link" button
55
+ Then the modal window should be visible
56
+ And the modal overlay should be visible
57
+ And I should see "Insert Link" within the modal title
58
+ And I should see "Standard Links" within the insert link modal
59
+
60
+ When I click on the modal close button
61
+ Then the modal window should not be visible
62
+ And the modal overlay should not be visible
63
+
64
+ When I click on the "Insert Link" button
65
+ And click on the modal overlay
66
+ Then the modal window should not be visible
67
+ And the modal overlay should not be visible
@@ -0,0 +1,195 @@
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 editable 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 editable 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 editable 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 editable 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 editable 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 editable 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 editable 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 editable 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 editable 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 editable 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 editable region should be "this is <span>simple</span> <b>content</b>"
54
+
55
+ # Scenario: A user can underline content
56
+ Given the content of the editable region is simple content
57
+ And I make a selection
58
+
59
+ When I click on the underline editor button
60
+ Then the contents of the editable region should be "this is <u><span>simple</span></u> <b>content</b>"
61
+
62
+ When I click on the underline editor button
63
+ Then the contents of the editable region should be "this is <span>simple</span> <b>content</b>"
64
+
65
+
66
+ # Scenario: A user can make content superscript
67
+ Given the content of the editable region is simple content
68
+ And I make a selection
69
+
70
+ When I click on the superscript editor button
71
+ Then the contents of the editable region should be "this is <sup><span>simple</span></sup> <b>content</b>"
72
+
73
+ When I click on the superscript editor button
74
+ Then the contents of the editable region should be "this is <span>simple</span> <b>content</b>"
75
+
76
+
77
+ # Scenario: A user can make content subscript
78
+ Given the content of the editable region is simple content
79
+ And I make a selection
80
+
81
+ When I click on the subscript editor button
82
+ Then the contents of the editable region should be "this is <sub><span>simple</span></sub> <b>content</b>"
83
+
84
+ When I click on the subscript editor button
85
+ Then the contents of the editable region should be "this is <span>simple</span> <b>content</b>"
86
+
87
+
88
+ # Scenario: A user can justify content to the left, center, right, or fully justified
89
+ # firefox: this isn't possible on the first line due to a bug in gecko, so we have special content for it
90
+ Given the content of the editable region has justifiable content
91
+ And I make a selection
92
+
93
+ When I click on the justify left editor button
94
+ Then the contents of the editable region should be "<div>first line</div><br><div align='left'>this is <span>justifiable</span><b>content</b></div> "
95
+
96
+ When I click on the justify center editor button
97
+ Then the contents of the editable region should be "<div>first line</div><br><div align='center'>this is <span>justifiable</span><b>content</b></div> "
98
+
99
+ When I click on the justify right editor button
100
+ Then the contents of the editable region should be "<div>first line</div><br><div align='right'>this is <span>justifiable</span><b>content</b></div> "
101
+
102
+ When I click on the full justification editor button
103
+ Then the contents of the editable region should be "<div>first line</div><br><div align='justify'>this is <span>justifiable</span><b>content</b></div> "
104
+
105
+
106
+ # Scenario: A user can make an unordered list
107
+ Given the content of the editable region is simple content
108
+ And I make a selection
109
+
110
+ When I click on the insert unordered list editor button
111
+ Then the contents of the editable region should be "<ul><li>this is <span>simple</span> <b>content</b></li></ul>"
112
+
113
+ # todo: we should test enter and tab, and shift+tab in advanced editing
114
+
115
+ # Scenario: A user can make an ordered list
116
+ Given the content of the editable region is simple content
117
+ And I make a selection
118
+
119
+ When I click on the insert ordered list editor button
120
+ Then the contents of the editable region should be "<ol><li>this is <span>simple</span> <b>content</b></li></ol>"
121
+
122
+ # todo: we should test enter and tab, and shift+tab in advanced editing
123
+
124
+
125
+ # Scenario: A user can indent and outdent content
126
+ # firefox: this isn't possible on the first line due to a bug in gecko, so we have special content for it
127
+ Given the content of the editable region has justifiable content
128
+ And I make a selection
129
+
130
+ When I click on the indent editor button
131
+ Then the contents of the editable region should be "<div>first line</div><br><blockquote>this is <span>justifiable</span><b>content</b></blockquote> "
132
+
133
+ When I click on the indent editor button
134
+ Then the contents of the editable region should be "<div>first line</div><br><blockquote><blockquote>this is <span>justifiable</span><b>content</b></blockquote></blockquote> "
135
+
136
+ When I click on the outdent editor button
137
+ Then the contents of the editable region should be "<div>first line</div><br><blockquote>this is <span>justifiable</span><b>content</b></blockquote> "
138
+
139
+ When I click on the outdent editor button
140
+ Then the contents of the editable region should be "<div>first line</div><br>this is <span>justifiable</span><b>content</b> "
141
+
142
+
143
+ # Scenario: A user can insert horizontal rules
144
+ Given the content of the editable region is simple content
145
+ And I make a selection
146
+
147
+ When I click on the insert hr editor button
148
+ Then the contents of the editable region should be "this is&nbsp;<hr size='2' width='100%'> <b>content</b>"
149
+
150
+ When I click on the insert hr editor button
151
+ Then the contents of the editable region should be "this is&nbsp;<hr size='2' width='100%'><hr size='2' width='100%'> <b>content</b>"
152
+
153
+
154
+ # Scenario: A user can clean/remove formatting on their selection
155
+ Given the content of the editable region has wrapped content
156
+ And I make a selection
157
+
158
+ When I click on the remove formatting editor button
159
+ Then the contents of the editable region should be "this is wrapped content"
160
+
161
+
162
+ # Scenario: A user can wrap content within predefined styles
163
+ Given the content of the editable region is simple content
164
+ And I make a selection
165
+
166
+ When I click on the style editor dropdown
167
+ And select the red style from the dropdown
168
+ Then the contents of the editable region should be "this is <span class='red'><span>simple</span></span> <b>content</b>"
169
+
170
+
171
+ # Scenario: A user can wrap content in formatted block tags
172
+ Given the content of the editable region is simple content
173
+ And I make a selection
174
+
175
+ When I click on the block format editor dropdown
176
+ And select the heading 2 block from the dropdown
177
+ Then the contents of the editable region should be "<h2>this is <span>simple</span> <b>content</b></h2>"
178
+
179
+
180
+ # Scenario: A user can set the background color of a selection
181
+ Given the content of the editable region is simple content
182
+ And I make a selection
183
+
184
+ When I click on the background color editor palette
185
+ And click on the color red
186
+ Then the contents of the editable region should be "this is <span style='background-color:#FF0000'><span>simple</span></span> <b>content</b>"
187
+
188
+
189
+ # Scenario: A user can set the foreground color
190
+ Given the content of the editable region is simple content
191
+ And I make a selection
192
+
193
+ When I click on the foreground color editor palette
194
+ And click on the color red
195
+ Then the contents of the editable region should be "this is <font color='rgb(255, 0, 0)'><span>simple</span></font> <b>content</b>"
@@ -0,0 +1,98 @@
1
+ @javascript
2
+ Feature:
3
+ As a content editor type person
4
+ In order to manage content
5
+ I should be able to insert links of different types
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 insert and edit a link to an external site
15
+ Given the content of the editable region is simple content
16
+ And I make a selection
17
+
18
+ When I click on the "Insert Link" button
19
+ Then the modal window should be visible
20
+ And the "Link Content" field should contain "simple"
21
+
22
+ When I fill in "URL" with "http://google.com"
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>"
25
+ And the modal window should not be visible
26
+
27
+ When I click on the "Insert Link" button
28
+ Then I should not see "Link Content"
29
+
30
+ When I fill in "URL" with "http://cnn.com"
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>"
33
+
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
37
+ And I make a selection
38
+
39
+ When I click on the "Insert Link" button
40
+ And fill in "URL" with "http://google.com"
41
+ And select "Blank (a new window or tab)" from "Link Target"
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>"
44
+
45
+ When I click on the "Insert Link" button
46
+ And select "Top (removes any frames)" from "Link Target"
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>"
49
+
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
53
+ And I make a selection
54
+
55
+ When I click on the "Insert Link" button
56
+ And fill in "URL" with "http://google.com"
57
+ And select "Popup Window (javascript new window popup)" from "Link Target"
58
+ And I fill in "Popup Width" with "500"
59
+ And fill in "Popup Height" with "200"
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>"
62
+
63
+ When I click on the "Insert Link" button
64
+ Then the "Popup Width" field should contain "500"
65
+ And the "Popup Height" field should contain "200"
66
+
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
70
+ And I make a selection
71
+
72
+ When I click on the "Insert Link" button
73
+ And I choose "Bookmark"
74
+ And fill in "Bookmark" with "test-bookmark1"
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>"
77
+
78
+ When I make a selection for "b"
79
+ And click on the "Insert Link" button
80
+ And I choose "Existing Links"
81
+ And select "simple" from "Existing Links"
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>"
84
+
85
+ When I make a selection for "a"
86
+ And click on the "Insert Link" button
87
+ # todo: this should prefill
88
+ #Then the "Bookmark" field should contain "test-bookmark1"
89
+ And I choose "Bookmark"
90
+ And fill in "Bookmark" with "test-bookmark2"
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>"
93
+
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
+
96
+
97
+ Scenario: A user can navigate links inside of regions
98
+ # todo: finish