mercury-rails 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/app/assets/images/mercury/toolbar/{snippetable → snippets}/buttons.png +0 -0
  2. data/app/assets/javascripts/mercury.js +58 -84
  3. data/app/assets/javascripts/mercury/lightview.js.coffee +1 -1
  4. data/app/assets/javascripts/mercury/mercury.js.coffee +1 -1
  5. data/app/assets/javascripts/mercury/modal.js.coffee +1 -1
  6. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +13 -9
  7. data/app/assets/javascripts/mercury/native_extensions.js.coffee +0 -6
  8. data/app/assets/javascripts/mercury/page_editor.js.coffee +19 -19
  9. data/app/assets/javascripts/mercury/region.js.coffee +11 -10
  10. data/app/assets/javascripts/mercury/regions/{editable.js.coffee → full.coffee} +18 -18
  11. data/app/assets/javascripts/mercury/regions/image.js.coffee +13 -34
  12. data/app/assets/javascripts/mercury/regions/{markupable.js.coffee → markdown.coffee} +21 -22
  13. data/app/assets/javascripts/mercury/regions/simple.js.coffee +10 -39
  14. data/app/assets/javascripts/mercury/regions/{snippetable.js.coffee → snippets.js.coffee} +8 -7
  15. data/app/assets/javascripts/mercury/snippet.js.coffee +1 -1
  16. data/app/assets/javascripts/mercury/snippet_toolbar.js.coffee +3 -2
  17. data/app/assets/javascripts/mercury/toolbar.button.js.coffee +2 -2
  18. data/app/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  19. data/app/assets/javascripts/mercury/toolbar.js.coffee +2 -2
  20. data/app/assets/javascripts/mercury/uploader.js.coffee +2 -1
  21. data/app/assets/stylesheets/mercury/all_images.css.erb +2 -2
  22. data/app/assets/stylesheets/mercury/dialog.css +2 -2
  23. data/app/assets/stylesheets/mercury/lightview.css +14 -14
  24. data/app/assets/stylesheets/mercury/modal.css +1 -1
  25. data/app/assets/stylesheets/mercury/toolbar.css +1 -1
  26. data/features/generators/install.feature +1 -1
  27. data/features/loading/loading.feature +2 -2
  28. data/features/regions/{editable → full}/advanced_editing.feature +0 -0
  29. data/features/regions/full/basic_editing.feature +196 -0
  30. data/features/regions/{editable → full}/inserting_links.feature +12 -12
  31. data/features/regions/{editable → full}/inserting_media.feature +15 -15
  32. data/features/regions/{editable → full}/inserting_snippets.feature +15 -15
  33. data/features/regions/{editable → full}/inserting_special_characters.feature +2 -2
  34. data/features/regions/full/inserting_tables.feature +109 -0
  35. data/features/regions/{editable → full}/pasting.feature +0 -0
  36. data/features/regions/{editable → full}/uploading_images.feature +0 -0
  37. data/features/regions/{markupable → markdown}/advanced_editing.feature +0 -0
  38. data/features/regions/{markupable → markdown}/basic_editing.feature +0 -0
  39. data/features/regions/{markupable → markdown}/inserting_links.feature +0 -0
  40. data/features/regions/{markupable → markdown}/inserting_media.feature +0 -0
  41. data/features/regions/{markupable → markdown}/inserting_snippets.feature +0 -0
  42. data/features/regions/{markupable → markdown}/inserting_special_characters.feature +0 -0
  43. data/features/regions/{markupable → markdown}/inserting_tables.feature +0 -0
  44. data/features/regions/{markupable → markdown}/uploading_images.feature +0 -0
  45. data/features/regions/{snippetable → snippets}/advanced_editing.feature +0 -0
  46. data/features/regions/{snippetable → snippets}/basic_editing.feature +0 -0
  47. data/features/regions/{snippetable → snippets}/inserting_snippets.feature +0 -0
  48. data/features/saving/saving.feature +8 -8
  49. data/features/step_definitions/mercury_steps.rb +13 -13
  50. data/features/support/mercury_selectors.rb +3 -3
  51. data/lib/generators/mercury/install/images/images_generator.rb +3 -0
  52. data/lib/generators/mercury/install/install_generator.rb +5 -5
  53. data/lib/mercury/version.rb +1 -1
  54. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  55. data/spec/dummy/{public → app/assets/javascripts}/prototype.js +0 -0
  56. data/spec/dummy/app/assets/stylesheets/application.css.scss +110 -0
  57. data/spec/dummy/public/frame.html +1 -1
  58. data/spec/dummy/public/index.html +92 -216
  59. data/spec/javascripts/mercury/lightview_spec.js.coffee +1 -1
  60. data/spec/javascripts/mercury/modal_spec.js.coffee +1 -1
  61. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +41 -2
  62. data/spec/javascripts/mercury/page_editor_spec.js.coffee +19 -18
  63. data/spec/javascripts/mercury/region_spec.js.coffee +12 -14
  64. data/spec/javascripts/mercury/regions/{editable_spec.js.coffee → full_spec.js.coffee} +16 -16
  65. data/spec/javascripts/mercury/regions/image_spec.js.coffee +3 -3
  66. data/spec/javascripts/mercury/regions/{markupable_spec.js.coffee → markdown_spec.js.coffee} +18 -18
  67. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +3 -3
  68. data/spec/javascripts/mercury/regions/{snippetable_spec.js.coffee → snippets_spec.js.coffee} +53 -53
  69. data/spec/javascripts/mercury/snippet_spec.js.coffee +1 -1
  70. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +2 -2
  71. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +5 -5
  72. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +6 -6
  73. data/spec/javascripts/mercury/toolbar_spec.js.coffee +4 -4
  74. data/spec/javascripts/mercury/uploader_spec.js.coffee +5 -5
  75. data/spec/javascripts/templates/mercury/page_editor.html +4 -4
  76. data/spec/javascripts/templates/mercury/region.html +1 -1
  77. data/spec/javascripts/templates/mercury/regions/full.html +1 -0
  78. data/spec/javascripts/templates/mercury/regions/image.html +1 -1
  79. data/spec/javascripts/templates/mercury/regions/markdown.html +1 -0
  80. data/spec/javascripts/templates/mercury/regions/simple.html +1 -3
  81. data/spec/javascripts/templates/mercury/regions/snippets.html +4 -0
  82. metadata +65 -75
  83. data/app/assets/javascripts/mercury_loader.js +0 -193
  84. data/app/assets/javascripts/mercury_overrides.js +0 -6
  85. data/app/assets/stylesheets/mercury_overrides.css +0 -17
  86. data/features/regions/editable/basic_editing.feature +0 -196
  87. data/features/regions/editable/inserting_tables.feature +0 -109
  88. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  89. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  90. data/spec/dummy/public/404.html +0 -26
  91. data/spec/dummy/public/422.html +0 -26
  92. data/spec/dummy/public/canvastest.html +0 -103
  93. data/spec/javascripts/templates/mercury/regions/editable.html +0 -3
  94. data/spec/javascripts/templates/mercury/regions/snippetable.html +0 -4
@@ -1,16 +1,17 @@
1
- class @Mercury.Regions.Snippetable extends Mercury.Region
1
+ class @Mercury.Regions.Snippets extends Mercury.Region
2
2
  @supported: document.getElementById
3
3
  @supportedText: "IE 7+, Chrome 10+, Firefox 4+, Safari 5+, Opera 8+"
4
-
5
- type = 'snippetable'
4
+ type = 'snippets'
5
+ type: -> type
6
6
 
7
7
  constructor: (@element, @window, @options = {}) ->
8
- @type = 'snippetable'
8
+ Mercury.log("building #{type}", @element, @options)
9
9
  super
10
10
  @makeSortable()
11
11
 
12
12
 
13
13
  build: ->
14
+ jQuery(snippet).attr('data-version', 0) for snippet in @element.find('[data-snippet]')
14
15
  @element.css({minHeight: 20}) if @element.css('minHeight') == '0px'
15
16
 
16
17
 
@@ -77,7 +78,7 @@ class @Mercury.Regions.Snippetable extends Mercury.Region
77
78
 
78
79
  execCommand: (action, options = {}) ->
79
80
  super
80
- handler.call(@, options) if handler = Mercury.Regions.Snippetable.actions[action]
81
+ handler.call(@, options) if handler = Mercury.Regions.Snippets.actions[action]
81
82
 
82
83
 
83
84
  makeSortable: ->
@@ -85,7 +86,7 @@ class @Mercury.Regions.Snippetable extends Mercury.Region
85
86
  document: @document,
86
87
  scroll: false, #scrolling is buggy
87
88
  containment: 'parent',
88
- items: '.mercury-snippet',
89
+ items: '[data-snippet]',
89
90
  opacity: 0.4,
90
91
  revert: 100,
91
92
  tolerance: 'pointer',
@@ -93,7 +94,7 @@ class @Mercury.Regions.Snippetable extends Mercury.Region
93
94
  Mercury.trigger('hide:toolbar', {type: 'snippet', immediately: true})
94
95
  return true
95
96
  stop: =>
96
- setTimeout(100, => @pushHistory())
97
+ setTimeout((=> @pushHistory()), 100)
97
98
  return true
98
99
  }
99
100
 
@@ -51,7 +51,7 @@ class @Mercury.Snippet
51
51
 
52
52
  getHTML: (context, callback = null) ->
53
53
  element = jQuery("<#{@wrapperTag}>", {
54
- class: "mercury-snippet #{@name}-snippet"
54
+ class: "#{@name}-snippet"
55
55
  contenteditable: "false"
56
56
  'data-snippet': @identity
57
57
  'data-version': @version
@@ -9,7 +9,7 @@ class @Mercury.SnippetToolbar extends Mercury.Toolbar
9
9
  @element = jQuery('<div>', {class: 'mercury-toolbar mercury-snippet-toolbar', style: 'display:none'})
10
10
  @element.appendTo(jQuery(@options.appendTo).get(0) ? 'body')
11
11
 
12
- for own buttonName, options of Mercury.config.toolbars.snippetable
12
+ for own buttonName, options of Mercury.config.toolbars.snippets
13
13
  button = @buildButton(buttonName, options)
14
14
  button.appendTo(@element) if button
15
15
 
@@ -71,10 +71,11 @@ class @Mercury.SnippetToolbar extends Mercury.Toolbar
71
71
  @element.hide()
72
72
  @visible = false
73
73
  else
74
- @hideTimeout = setTimeout 500, =>
74
+ @hideTimeout = setTimeout =>
75
75
  @element.stop().animate {opacity: 0}, 300, 'easeInOutSine', =>
76
76
  @element.hide()
77
77
  @visible = false
78
+ , 500
78
79
 
79
80
  release: ->
80
81
  @element.off()
@@ -72,8 +72,8 @@ class @Mercury.Toolbar.Button
72
72
  @element.removeClass('active')
73
73
 
74
74
  Mercury.on 'region:focused', (event, options) =>
75
- if @handled.regions && options.region && options.region.type
76
- if @handled.regions.indexOf(options.region.type) > -1
75
+ if @handled.regions && options.region && options.region.type()
76
+ if @handled.regions.indexOf(options.region.type()) > -1
77
77
  @element.removeClass('disabled')
78
78
  else
79
79
  @element.addClass('disabled')
@@ -25,8 +25,8 @@ class @Mercury.Toolbar.ButtonGroup
25
25
  @element.addClass('disabled')
26
26
 
27
27
  Mercury.on 'region:focused', (event, options) =>
28
- if @regions && options.region && options.region.type
29
- if @regions.indexOf(options.region.type) > -1
28
+ if @regions && options.region && options.region.type()
29
+ if @regions.indexOf(options.region.type()) > -1
30
30
  @element.removeClass('disabled') unless @options._context
31
31
  else
32
32
  @element.addClass('disabled')
@@ -56,13 +56,13 @@ class @Mercury.Toolbar
56
56
  for toolbar in @element.find(".mercury-toolbar")
57
57
  toolbar = jQuery(toolbar)
58
58
  if regions = toolbar.data('regions')
59
- toolbar.removeClass('disabled') if regions.split(',').indexOf(options.region.type) > -1
59
+ toolbar.removeClass('disabled') if regions.split(',').indexOf(options.region.type()) > -1
60
60
 
61
61
  Mercury.on 'region:blurred', (event, options) =>
62
62
  for toolbar in @element.find(".mercury-toolbar")
63
63
  toolbar = jQuery(toolbar)
64
64
  if regions = toolbar.data('regions')
65
- toolbar.addClass('disabled') if regions.split(',').indexOf(options.region.type) > -1
65
+ toolbar.addClass('disabled') if regions.split(',').indexOf(options.region.type()) > -1
66
66
 
67
67
  @element.on 'click', ->
68
68
  Mercury.trigger('hide:dialogs')
@@ -161,7 +161,7 @@ jQuery.extend Mercury.uploader,
161
161
 
162
162
 
163
163
  hide: (delay = 0) ->
164
- setTimeout delay * 1000, =>
164
+ setTimeout =>
165
165
  @element.animate {opacity: 0}, 200, 'easeInOutSine', =>
166
166
  @overlay.animate {opacity: 0}, 200, 'easeInOutSine', =>
167
167
  @overlay.hide()
@@ -169,6 +169,7 @@ jQuery.extend Mercury.uploader,
169
169
  @reset()
170
170
  @visible = false
171
171
  Mercury.trigger('focus:frame')
172
+ , delay * 1000
172
173
 
173
174
 
174
175
  reset: ->
@@ -82,8 +82,8 @@ form fieldset.buttons .commit input {
82
82
  }
83
83
 
84
84
  .mercury-snippet-toolbar .mercury-button {
85
- background-image: url(<%= asset_path 'mercury/toolbar/snippetable/buttons.png' %>);
85
+ background-image: url(<%= asset_path 'mercury/toolbar/snippets/buttons.png' %>);
86
86
  }
87
87
  .mercury-snippet-toolbar .mercury-button em {
88
- background-image: url(<%= asset_path 'mercury/toolbar/snippetable/buttons.png' %>);
88
+ background-image: url(<%= asset_path 'mercury/toolbar/snippets/buttons.png' %>);
89
89
  }
@@ -46,8 +46,8 @@
46
46
  opacity: .9;
47
47
  box-shadow: 1px 1px 4px rgba(0,0,0, .5);
48
48
  -moz-box-shadow: 1px 1px 4px rgba(0,0,0, .5);
49
- border-radius: 4px;
50
- -moz-border-radius: 4px;
49
+ border-radius: 6px;
50
+ -moz-border-radius: 6px;
51
51
  color: #333;
52
52
  font-family: Helvetica, Tahoma, Arial, sans-serif;
53
53
  font-size: 9.5pt;
@@ -10,13 +10,13 @@
10
10
  height: 100%;
11
11
  opacity: 0;
12
12
  display: none;
13
- background: rgba(0, 0, 0, .65);
13
+ background: rgba(255, 255, 255, .8);
14
14
  }
15
15
  .mercury-lightview {
16
16
  position: fixed;
17
17
  z-index: 10040;
18
18
  top: 20px;
19
- background: #000;
19
+ background: #EFEFEF;
20
20
  opacity: 0;
21
21
  overflow: hidden;
22
22
  display: none;
@@ -28,7 +28,7 @@
28
28
  font: normal normal normal 12px/normal Helvetica, Tahoma, Arial, sans-serif;
29
29
  -moz-box-sizing: border-box;
30
30
  box-sizing: border-box;
31
- color: #CCC;
31
+ color: #000;
32
32
  }
33
33
  .mercury-lightview.loading {
34
34
  background-repeat: no-repeat;
@@ -40,8 +40,8 @@
40
40
  .mercury-lightview h1.mercury-lightview-title {
41
41
  margin: 0;
42
42
  padding: 10px 20px 8px;
43
- border-bottom: 1px solid #222;
44
- color: #FFF;
43
+ border-bottom: 1px solid #CCC;
44
+ color: #000;
45
45
  -webkit-user-select: none;
46
46
  -moz-user-select: none;
47
47
  user-select: none;
@@ -74,7 +74,7 @@
74
74
  * Forms
75
75
  *----------------------------------------------------------------------------*/
76
76
  .mercury-lightview form fieldset {
77
- background: #111;
77
+ background: #CCC;
78
78
  border: 1px solid #333;
79
79
  }
80
80
  .mercury-lightview form fieldset.buttons {
@@ -86,21 +86,21 @@
86
86
  .mercury-lightview form input[type="password"],
87
87
  .mercury-lightview form textarea,
88
88
  .mercury-lightview form input.text {
89
- background: #444;
90
- color: #FFF;
91
- border: 2px solid #555;
89
+ background: #CCC;
90
+ color: #000;
91
+ border: 2px solid #999;
92
92
  -moz-box-shadow: inset 0 0 3px #000000;
93
93
  -webkit-box-shadow: inset 0 0 3px #000000;
94
94
  box-shadow: inset 0 0 3px #000000;
95
95
  }
96
96
  .mercury-lightview form input[type="button"] {
97
- border: 2px solid #555;
98
- border-radius: 4px;
99
- background: #222;
100
- color: #FFF;
97
+ /*border: 2px solid #555;*/
98
+ /*border-radius: 4px;*/
99
+ /*background: #222;*/
100
+ /*color: #FFF;*/
101
101
  }
102
102
  .mercury-lightview hr {
103
- border-color: #333;
103
+ border-color: #CCC;
104
104
  }
105
105
  /*
106
106
  * Specific Lightviews
@@ -10,7 +10,7 @@
10
10
  height: 100%;
11
11
  opacity: 0;
12
12
  display: none;
13
- background: rgba(255,255,255, .8);
13
+ background: rgba(255, 255, 255, .8);
14
14
  }
15
15
  .mercury-modal {
16
16
  position: fixed;
@@ -253,7 +253,7 @@
253
253
  .mercury-editable-toolbar .mercury-htmlEditor-button { background-position: -612px 0 }
254
254
  .mercury-editable-toolbar .mercury-htmlEditor-button.active { background-position: -612px -18px }
255
255
  /*
256
- * Toolbar: Snippetable Region Toolbar
256
+ * Toolbar: Snippets Region Toolbar
257
257
  *----------------------------------------------------------------------------*/
258
258
  .mercury-snippet-toolbar {
259
259
  position: absolute;
@@ -16,6 +16,6 @@ Feature:
16
16
  When I successfully run `bundle exec rails generate mercury:install --full --trace`
17
17
  Then the following files should exist:
18
18
  | app/assets/javascripts/mercury.js |
19
- | app/assets/stylesheets/mercury_overrides.css |
19
+ | app/assets/stylesheets/mercury.css |
20
20
  | app/views/layouts/mercury.html.erb |
21
21
  And the file "config/routes.rb" should contain "mount Mercury::Engine => '/'"
@@ -15,11 +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
21
  # Latest selenium webdriver seems to consider the lightview hidden
22
22
  @use_hidden_elements
23
23
  Scenario: A user can expect to see the status bar
24
- Then I should see "Mercury Editor v0.4.0" within the statusbar
24
+ Then I should see "Mercury Editor v0.6.0" within the statusbar
25
25
 
@@ -0,0 +1,196 @@
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
+ Scenario: A user can underline content
56
+ Given the content of the full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full 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 full region should be "this is <font color='rgb(255, 0, 0)'><span>simple</span></font> <b>content</b>"
196
+