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