mercury-rails 0.2.0 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/POST_INSTALL +15 -0
- data/README.md +27 -6
- data/VERSION +1 -1
- data/app/controllers/mercury_controller.rb +4 -4
- data/app/views/layouts/mercury.html.erb +14 -3
- data/app/views/mercury/panels/snippets.html +1 -1
- data/app/views/mercury/snippets/{example_options.html.erb → example/options.html.erb} +0 -0
- data/app/views/mercury/snippets/{example.html.erb → example/preview.html.erb} +0 -0
- data/config/routes.rb +2 -2
- data/features/loading/loading.feature +22 -0
- data/features/loading/navigating.feature +77 -0
- data/features/loading/user_interface.feature +67 -0
- data/features/regions/editable/advanced_editing.feature +0 -0
- data/features/regions/editable/basic_editing.feature +195 -0
- data/features/regions/editable/inserting_links.feature +98 -0
- data/features/regions/editable/inserting_media.feature +110 -0
- data/features/regions/editable/inserting_snippets.feature +103 -0
- data/features/regions/editable/inserting_special_characters.feature +24 -0
- data/features/regions/editable/inserting_tables.feature +109 -0
- data/features/regions/editable/pasting.feature +0 -0
- data/features/regions/editable/uploading_images.feature +0 -0
- data/features/regions/markupable/advanced_editing.feature +0 -0
- data/features/regions/markupable/basic_editing.feature +0 -0
- data/features/regions/markupable/inserting_links.feature +0 -0
- data/features/regions/markupable/inserting_media.feature +0 -0
- data/features/regions/markupable/inserting_snippets.feature +0 -0
- data/features/regions/markupable/inserting_special_characters.feature +0 -0
- data/features/regions/markupable/inserting_tables.feature +0 -0
- data/features/regions/markupable/uploading_images.feature +0 -0
- data/features/regions/snippetable/advanced_editing.feature +0 -0
- data/features/regions/snippetable/basic_editing.feature +0 -0
- data/features/regions/snippetable/inserting_snippets.feature +0 -0
- data/features/saving/saving.feature +33 -0
- data/features/step_definitions/debug_steps.rb +2 -2
- data/features/step_definitions/mercury_steps.rb +441 -0
- data/features/support/env.rb +3 -3
- data/features/support/mercury_contents.rb +25 -0
- data/features/support/mercury_selectors.rb +147 -0
- data/features/support/paths.rb +20 -18
- data/features/support/selectors.rb +5 -3
- data/lib/generators/mercury/install/install_generator.rb +14 -0
- data/mercury-rails.gemspec +50 -20
- data/spec/javascripts/mercury/lightview_spec.js.coffee +55 -27
- data/spec/javascripts/mercury/mercury_spec.js.coffee +3 -3
- data/spec/javascripts/mercury/modal_spec.js.coffee +2 -2
- data/spec/javascripts/mercury/native_extensions_spec.js.coffee +0 -24
- data/spec/javascripts/mercury/page_editor_spec.js.coffee +148 -67
- data/spec/javascripts/mercury/panel_spec.js.coffee +2 -2
- data/spec/javascripts/mercury/region_spec.js.coffee +10 -7
- data/spec/javascripts/mercury/regions/editable_spec.js.coffee +0 -20
- data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +2 -2
- data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +1 -1
- data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +1 -1
- data/spec/javascripts/templates/mercury/page_editor.html +3 -3
- data/vendor/assets/images/mercury/close.png +0 -0
- data/vendor/assets/javascripts/mercury.js +140 -73
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/jquery-1.6.js +0 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/jquery-ui-1.8.13.custom.js +0 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/jquery.additions.js +0 -0
- data/vendor/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +527 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/liquidmetal.js +0 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/showdown.js +0 -0
- data/vendor/assets/javascripts/mercury/lightview.js.coffee +5 -2
- data/vendor/assets/javascripts/mercury/mercury.js.coffee +9 -8
- data/vendor/assets/javascripts/mercury/modals/htmleditor.js.coffee +3 -1
- data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +2 -2
- data/vendor/assets/javascripts/mercury/native_extensions.js.coffee +6 -17
- data/vendor/assets/javascripts/mercury/page_editor.js.coffee +29 -8
- data/vendor/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +27 -0
- data/vendor/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +9 -0
- data/vendor/assets/javascripts/mercury/region.js.coffee +2 -2
- data/vendor/assets/javascripts/mercury/regions/editable.js.coffee +89 -93
- data/vendor/assets/javascripts/mercury/regions/markupable.js.coffee +1 -1
- data/vendor/assets/javascripts/mercury/support/history.js +1 -0
- data/vendor/assets/javascripts/mercury/uploader.js.coffee +0 -1
- data/vendor/assets/javascripts/mercury_loader.js +4 -4
- data/vendor/assets/stylesheets/mercury/lightview.css +8 -0
- data/vendor/assets/stylesheets/mercury/mercury.css +12 -0
- data/vendor/assets/stylesheets/mercury/modal.css +0 -12
- data/vendor/assets/stylesheets/mercury/toolbar.css +1 -0
- data/vendor/assets/stylesheets/mercury_overrides.css +17 -0
- metadata +73 -45
- data/app/views/mercury/lightviews/imageprocessor.html +0 -3
- data/app/views/mercury/modals/sanitizer.html +0 -9
- data/features/editing/basic.feature +0 -11
- data/vendor/assets/images/mercury/clippy.png +0 -0
data/POST_INSTALL
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
+============================================================================+
|
2
|
+
Congratulations, Mercury was successfully installed in your app. Documentation
|
3
|
+
and other useful info can be found at: https://github.com/jejacks0n/mercury
|
4
|
+
|
5
|
+
Here's a post install checklist:
|
6
|
+
|
7
|
+
* Setup the database for image processing (if you haven't already) by running
|
8
|
+
|
9
|
+
rake mercury_engine:install:migrations
|
10
|
+
rake db:migrate
|
11
|
+
|
12
|
+
* Learn about, and make your configuration adjustments in the mercury.js file
|
13
|
+
|
14
|
+
* If installed, check out mercury.html.erb and mercury_overrides.css for more
|
15
|
+
customization info.
|
data/README.md
CHANGED
@@ -8,6 +8,28 @@ block elements, instead of iframes, which allows for CSS to be applied in ways t
|
|
8
8
|
Mercury has been written using CoffeeScript and jQuery for the Javascript portions, and is written on top of Rails 3.1.
|
9
9
|
|
10
10
|
|
11
|
+
## Translations
|
12
|
+
|
13
|
+
Hey international open source contributors, want to contribute to the Mercury Editor project without having to do much
|
14
|
+
coding? We're looking for good translations. If you have a good grasp of english, another common language, and have
|
15
|
+
the desire and time to do a translation for the project it would be awesome to hear from you. Just shoot me a message
|
16
|
+
or email and I'll provide more details. While any translation would be a good thing, the languages that seem like they
|
17
|
+
would give the most value are:
|
18
|
+
|
19
|
+
- French
|
20
|
+
- German
|
21
|
+
- Spanish
|
22
|
+
- Japanese
|
23
|
+
- Chinese
|
24
|
+
- Dutch
|
25
|
+
|
26
|
+
|
27
|
+
## Awesomeness
|
28
|
+
|
29
|
+
Mercury has been added as a Featured Project on Pivotal Tracker! If you're interested in what's planned, check out the
|
30
|
+
public project at: https://www.pivotaltracker.com/projects/295823
|
31
|
+
|
32
|
+
|
11
33
|
## Browser Support
|
12
34
|
|
13
35
|
Mercury has been written for the future, and thus doesn't support legacy browsers or browsers that don't follow the W3C
|
@@ -62,7 +84,6 @@ The feature list is actually pretty long, so here's a short list that need highl
|
|
62
84
|
- Table Editing: Advanced table editing and creation.
|
63
85
|
- Snippets: Insert and edit predefined and reusable bits of markup/code using drag and drop.
|
64
86
|
- Notes: Attach notes to any page and communicate with other content authors.
|
65
|
-
- Colaborative Editing: Edit any page that others are editing at the same time and see their changes in real time.
|
66
87
|
|
67
88
|
|
68
89
|
## Installation
|
@@ -108,10 +129,10 @@ the Usage portion of this documentation.
|
|
108
129
|
## Usage
|
109
130
|
|
110
131
|
Mercury has an expectation that content regions will be on the page (not required, but probably useful). To define
|
111
|
-
content regions that Mercury will make editable you need to add a `mercury-region` class attribute to a div
|
112
|
-
specify what region type by using the `data-type` attribute -- which can be *editable*,
|
113
|
-
It's important for saving that an id attribute be set on regions, you should always
|
114
|
-
below.
|
132
|
+
content regions that Mercury will make editable you need to add a `mercury-region` class attribute to a div (this is
|
133
|
+
configurable). Then specify what region type by using the `data-type` attribute -- which can be *editable*,
|
134
|
+
*markupable*, or *snippetable*. It's important for saving that an id attribute be set on regions, you should always
|
135
|
+
include. Region types are outlined below.
|
115
136
|
|
116
137
|
<div id="primary" class="mercury-region" data-type="editable">
|
117
138
|
default content
|
@@ -202,7 +223,7 @@ default it will use JSON, that JSON looks like:
|
|
202
223
|
}
|
203
224
|
}
|
204
225
|
}
|
205
|
-
}
|
226
|
+
}
|
206
227
|
}
|
207
228
|
|
208
229
|
Where it gets saved to is also up to you.. by default it submits a post to the current url, but you can adjust this by
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
@@ -10,15 +10,15 @@ class MercuryController < ActionController::Base
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def snippet_options
|
13
|
-
render :action => "/snippets/#{params[:name]}
|
13
|
+
render :action => "/snippets/#{params[:name]}/options", :layout => false
|
14
14
|
end
|
15
15
|
|
16
16
|
def snippet_preview
|
17
|
-
render :action => "/snippets/#{params[:name]}", :layout => false
|
17
|
+
render :action => "/snippets/#{params[:name]}/preview", :layout => false
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
render :
|
20
|
+
def test_page
|
21
|
+
render :text => params
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
@@ -1,14 +1,25 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0">
|
4
5
|
<%= csrf_meta_tags %>
|
5
6
|
<title>Mercury Editor</title>
|
6
|
-
|
7
|
-
|
7
|
+
<%= stylesheet_link_tag 'mercury', 'mercury_overrides' %>
|
8
|
+
<%= javascript_include_tag 'mercury' %>
|
8
9
|
</head>
|
9
10
|
<body>
|
11
|
+
<% if Rails.application.config.respond_to?(:mercury_config) %>
|
12
|
+
<%= javascript_tag("jQuery.extend(Mercury.config, #{Rails.application.config.mercury_config});") %>
|
13
|
+
<% end -%>
|
14
|
+
|
10
15
|
<script type="text/javascript">
|
11
|
-
|
16
|
+
var saveUrl = null;
|
17
|
+
var options = {
|
18
|
+
saveStyle: null, // 'form', or 'json' (default json)
|
19
|
+
saveMethod: null, // 'POST', or 'PUT', (create, vs. update -- default POST)
|
20
|
+
visible: null // if the interface should start visible or not (default true)
|
21
|
+
};
|
22
|
+
new Mercury.PageEditor(saveUrl, options);
|
12
23
|
</script>
|
13
24
|
</body>
|
14
25
|
</html>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<input class="filter" type="text">
|
4
4
|
</div>
|
5
5
|
<ul>
|
6
|
-
<li data-filter="example
|
6
|
+
<li data-filter="example, snippet, favorite, beer">
|
7
7
|
<img alt="Snippet Name" data-snippet="example" src="/assets/mercury/default-snippet.png"/>
|
8
8
|
<h4>Snippet Name</h4>
|
9
9
|
<div class="description">A one to two line long description of what this snippet does.</div>
|
File without changes
|
File without changes
|
data/config/routes.rb
CHANGED
@@ -2,7 +2,7 @@ Rails.application.routes.draw do
|
|
2
2
|
|
3
3
|
resources :images
|
4
4
|
|
5
|
-
match '/editor(/*requested_uri)' => "mercury#edit"
|
5
|
+
match '/editor(/*requested_uri)' => "mercury#edit", :as => :mercury_editor
|
6
6
|
scope '/mercury' do
|
7
7
|
match ':type/:resource' => "mercury#resource"
|
8
8
|
match 'snippets/:name/options' => "mercury#snippet_options"
|
@@ -10,6 +10,6 @@ Rails.application.routes.draw do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
if defined?(Mercury::Application)
|
13
|
-
match '/
|
13
|
+
match 'mercury/test_page' => "mercury#test_page"
|
14
14
|
end
|
15
15
|
end
|
@@ -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.2.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 "About Mercury Editor" within the lightview title
|
16
|
+
And I should see "Mercury Editor is an open source project written by Jeremy Jackson" 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
|
File without changes
|
@@ -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 <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 <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>"
|