kiteditor 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/POST_INSTALL +21 -0
- data/{vendor → app}/assets/images/mercury/button.png +0 -0
- data/{vendor → app}/assets/images/mercury/close.png +0 -0
- data/app/assets/images/mercury/default-snippet.png +0 -0
- data/{vendor → app}/assets/images/mercury/loading-dark.gif +0 -0
- data/{vendor → app}/assets/images/mercury/loading-light.gif +0 -0
- data/{vendor → app}/assets/images/mercury/missing-image.png +0 -0
- data/{vendor → app}/assets/images/mercury/search-icon.png +0 -0
- data/{vendor → app}/assets/images/mercury/temp-logo.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/{vendor/assets/javascripts/mercury/dependencies → app/assets/javascripts}/jquery-1.7.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury.js +60 -87
- data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.additions.js +103 -13
- data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dependencies/liquidmetal.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dependencies/showdown.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dialog.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dialogs/backcolor.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dialogs/forecolor.js.coffee +1 -1
- data/{vendor → app}/assets/javascripts/mercury/dialogs/formatblock.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +1 -1
- data/{vendor → app}/assets/javascripts/mercury/dialogs/style.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/finalize.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/history_buffer.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/lightview.js.coffee +38 -17
- data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +201 -0
- data/app/assets/javascripts/mercury/locales/da.locale.js.coffee +208 -0
- data/{vendor → app}/assets/javascripts/mercury/locales/de.locale.js.coffee +4 -10
- data/{vendor → app}/assets/javascripts/mercury/locales/es.locale.js.coffee +3 -9
- data/{vendor → app}/assets/javascripts/mercury/locales/example.local.js.coffee +3 -5
- data/{vendor → app}/assets/javascripts/mercury/locales/fr.locale.js.coffee +3 -9
- data/app/assets/javascripts/mercury/locales/hu.locale.js.coffee +209 -0
- data/{vendor → app}/assets/javascripts/mercury/locales/it.locale.js.coffee +3 -9
- data/{vendor → app}/assets/javascripts/mercury/locales/ko.local.js.coffee +4 -10
- data/{vendor → app}/assets/javascripts/mercury/locales/nl.locale.js.coffee +3 -9
- data/app/assets/javascripts/mercury/locales/pl.locale.js.coffee +213 -0
- data/{vendor → app}/assets/javascripts/mercury/locales/pt.locale.js.coffee +3 -9
- data/app/assets/javascripts/mercury/locales/ru.locale.js.coffee +200 -0
- data/{vendor → app}/assets/javascripts/mercury/locales/sv.local.js.coffee +3 -9
- data/{vendor → app}/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +3 -9
- data/app/assets/javascripts/mercury/locales/uk.locale.js.coffee +200 -0
- data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +203 -0
- data/app/assets/javascripts/mercury/mercury-compiled.js +10720 -0
- data/{vendor → app}/assets/javascripts/mercury/mercury.js.coffee +10 -1
- data/{vendor → app}/assets/javascripts/mercury/modal.js.coffee +62 -40
- data/{vendor → app}/assets/javascripts/mercury/modals/htmleditor.js.coffee +1 -0
- data/{vendor → app}/assets/javascripts/mercury/modals/insertcharacter.js.coffee +1 -0
- data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +152 -0
- data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +132 -0
- data/{vendor → app}/assets/javascripts/mercury/modals/insertsnippet.js.coffee +2 -0
- data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +68 -0
- data/{vendor → app}/assets/javascripts/mercury/native_extensions.js.coffee +0 -6
- data/{vendor → app}/assets/javascripts/mercury/page_editor.js.coffee +84 -50
- data/{vendor → app}/assets/javascripts/mercury/palette.js.coffee +1 -1
- data/{vendor → app}/assets/javascripts/mercury/panel.js.coffee +3 -2
- data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +2 -2
- data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury/region.js.coffee +18 -17
- data/{vendor/assets/javascripts/mercury/regions/editable.js.coffee → app/assets/javascripts/mercury/regions/full.js.coffee} +41 -31
- data/app/assets/javascripts/mercury/regions/image.js.coffee +93 -0
- data/{vendor/assets/javascripts/mercury/regions/markupable.js.coffee → app/assets/javascripts/mercury/regions/markdown.js.coffee} +29 -24
- data/{vendor → app}/assets/javascripts/mercury/regions/simple.js.coffee +11 -54
- data/{vendor/assets/javascripts/mercury/regions/snippetable.js.coffee → app/assets/javascripts/mercury/regions/snippets.js.coffee} +10 -9
- data/{vendor → app}/assets/javascripts/mercury/select.js.coffee +1 -1
- data/app/assets/javascripts/mercury/snippet.js.coffee +136 -0
- data/{vendor → app}/assets/javascripts/mercury/snippet_toolbar.js.coffee +19 -6
- data/{vendor → app}/assets/javascripts/mercury/statusbar.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/support/history.js +0 -0
- data/{vendor → app}/assets/javascripts/mercury/table_editor.js.coffee +16 -0
- data/{vendor → app}/assets/javascripts/mercury/toolbar.button.js.coffee +45 -30
- data/{vendor → app}/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
- data/{vendor → app}/assets/javascripts/mercury/toolbar.expander.js.coffee +4 -4
- data/{vendor → app}/assets/javascripts/mercury/toolbar.js.coffee +10 -6
- data/{vendor → app}/assets/javascripts/mercury/tooltip.js.coffee +0 -0
- data/{vendor → app}/assets/javascripts/mercury/uploader.js.coffee +37 -19
- data/app/assets/stylesheets/_mercury-bootstrap-overrides.scss +61 -0
- data/app/assets/stylesheets/_mercury-sass.scss +33 -0
- data/{vendor → app}/assets/stylesheets/mercury.css +1 -5
- data/{vendor → app}/assets/stylesheets/mercury/all_images.css.erb +6 -2
- data/app/assets/stylesheets/mercury/bootstrap-ish.css +1367 -0
- data/app/assets/stylesheets/mercury/bootstrap-overrides.css +61 -0
- data/{vendor → app}/assets/stylesheets/mercury/dialog.css +21 -8
- data/{vendor → app}/assets/stylesheets/mercury/lightview.css +6 -56
- data/app/assets/stylesheets/mercury/mercury.css +43 -0
- data/{vendor → app}/assets/stylesheets/mercury/modal.css +15 -32
- data/{vendor → app}/assets/stylesheets/mercury/statusbar.css +0 -0
- data/{vendor → app}/assets/stylesheets/mercury/toolbar.css +4 -1
- data/{vendor → app}/assets/stylesheets/mercury/tooltip.css +0 -0
- data/{vendor → app}/assets/stylesheets/mercury/uploader.css +4 -4
- data/app/helpers/mercury_helper.rb +7 -0
- data/app/views/layouts/mercury.html.erb +10 -20
- data/app/views/layouts/mercury.html.haml +19 -0
- data/app/views/layouts/mercury.html.slim +19 -0
- data/app/views/mercury/modals/character.html +1 -1
- data/app/views/mercury/modals/htmleditor.html +3 -7
- data/app/views/mercury/modals/link.html +37 -51
- data/app/views/mercury/modals/media.html +102 -0
- data/app/views/mercury/modals/table.html +79 -73
- data/app/views/mercury/panels/snippets.html +6 -1
- data/app/views/mercury/snippets/example/options.html.erb +23 -27
- data/app/views/mercury/snippets/no_options/preview.html.erb +1 -0
- data/config/routes.rb +9 -0
- data/features/generators/authentication.feature +10 -0
- data/features/generators/images.feature +41 -0
- data/features/generators/install.feature +21 -0
- data/features/loading/loading.feature +5 -2
- data/features/loading/user_interface.feature +9 -7
- data/features/regions/{editable → full}/advanced_editing.feature +0 -0
- data/features/regions/full/basic_editing.feature +198 -0
- data/features/regions/{editable → full}/inserting_links.feature +20 -19
- data/features/regions/{editable → full}/inserting_media.feature +36 -18
- data/features/regions/{editable → full}/inserting_snippets.feature +28 -18
- data/features/regions/{editable → full}/inserting_special_characters.feature +2 -2
- data/features/regions/full/inserting_tables.feature +109 -0
- data/features/regions/{editable → full}/pasting.feature +0 -0
- data/features/regions/{editable → full}/uploading_images.feature +0 -0
- data/features/regions/{markupable → image}/uploading_images.feature +0 -0
- data/features/regions/{markupable → markdown}/advanced_editing.feature +0 -0
- data/features/regions/{markupable → markdown}/basic_editing.feature +0 -0
- data/features/regions/{markupable → markdown}/inserting_links.feature +0 -0
- data/features/regions/{markupable → markdown}/inserting_media.feature +0 -0
- data/features/regions/{markupable → markdown}/inserting_snippets.feature +0 -0
- data/features/regions/{markupable → markdown}/inserting_special_characters.feature +0 -0
- data/features/regions/{markupable → markdown}/inserting_tables.feature +0 -0
- data/features/regions/{snippetable/advanced_editing.feature → markdown/uploading_images.feature} +0 -0
- data/features/regions/simple/basic_editing.feature +5 -0
- data/features/regions/{snippetable/basic_editing.feature → snippets/advanced_editing.feature} +0 -0
- data/features/regions/{snippetable/inserting_snippets.feature → snippets/basic_editing.feature} +0 -0
- data/{vendor/assets/javascripts/mercury/locales/da.locale.js.coffee → features/regions/snippets/inserting_snippets.feature} +0 -0
- data/features/saving/saving.feature +8 -8
- data/features/step_definitions/custom_web_steps.rb +22 -0
- data/features/step_definitions/generator_steps.rb +23 -0
- data/features/step_definitions/mercury_steps.rb +1 -438
- data/features/support/aruba.rb +28 -0
- data/features/support/env.rb +11 -1
- data/features/support/selectors.rb +23 -0
- data/lib/generators/mercury/install/authentication/authentication_generator.rb +17 -0
- data/lib/generators/mercury/install/images/images_generator.rb +47 -0
- data/{app/models/mercury/image.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image.rb} +7 -0
- data/{db/migrate/20110526035601_create_mercury_images.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image_migration.rb} +0 -0
- data/{app/controllers/mercury → lib/generators/mercury/install/images/templates}/images_controller.rb +0 -0
- data/lib/generators/mercury/install/{templates → images/templates}/mongoid_paperclip_image.rb +0 -0
- data/lib/generators/mercury/install/install_generator.rb +12 -23
- data/lib/mercury-rails.rb +1 -2
- data/lib/mercury/authentication.rb +1 -0
- data/lib/mercury/cucumber/step_definitions.rb +13 -0
- data/lib/mercury/cucumber/step_definitions/mercury_steps.rb +408 -0
- data/{features → lib/mercury/cucumber}/support/mercury_contents.rb +3 -3
- data/{features → lib/mercury/cucumber}/support/mercury_selectors.rb +0 -20
- data/lib/mercury/engine.rb +19 -0
- data/lib/mercury/rails.rb +5 -0
- data/lib/mercury/version.rb +3 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +0 -0
- data/spec/dummy/app/assets/javascripts/prototype.js +6082 -0
- data/spec/dummy/app/assets/stylesheets/application.css.scss +110 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mercury.html.erb +28 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +58 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +10 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/teabag.rb +9 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/db/.gitkeep +0 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/blank.html +1 -0
- 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 +279 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/javascripts/{templates → fixtures}/mercury/dialog.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/dialogs/backcolor.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/dialogs/forecolor.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/dialogs/formatblock.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/dialogs/snippetpanel.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/dialogs/style.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/lightview.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/modal.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/modals/htmleditor.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/modals/insertcharacter.html +0 -0
- data/spec/javascripts/fixtures/mercury/modals/insertlink.html +67 -0
- data/spec/javascripts/fixtures/mercury/modals/insertmedia.html +87 -0
- data/spec/javascripts/{templates → fixtures}/mercury/modals/insertsnippet.html +0 -0
- data/spec/javascripts/fixtures/mercury/modals/inserttable.html +73 -0
- data/spec/javascripts/{templates → fixtures}/mercury/page_editor.html +4 -4
- data/spec/javascripts/{templates → fixtures}/mercury/palette.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/panel.html +0 -0
- data/spec/javascripts/fixtures/mercury/region.html +6 -0
- data/spec/javascripts/fixtures/mercury/regions/full.html +1 -0
- data/spec/javascripts/fixtures/mercury/regions/image.html +1 -0
- data/spec/javascripts/fixtures/mercury/regions/markdown.html +1 -0
- data/spec/javascripts/fixtures/mercury/regions/simple.html +1 -0
- data/spec/javascripts/fixtures/mercury/regions/snippets.html +4 -0
- data/spec/javascripts/{templates → fixtures}/mercury/select.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/snippet.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/snippet_toolbar.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/statusbar.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/table_editor.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/toolbar.button.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/toolbar.button_group.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/toolbar.expander.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/toolbar.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/tooltip.html +0 -0
- data/spec/javascripts/{templates → fixtures}/mercury/uploader.html +0 -0
- data/spec/javascripts/mercury/{dialog_spec.js.coffee → dialog_spec.coffee} +11 -12
- data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +2 -3
- data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +3 -4
- data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +2 -3
- data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +2 -3
- data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +2 -3
- data/spec/javascripts/mercury/lightview_spec.js.coffee +180 -142
- data/spec/javascripts/mercury/mercury_spec.js.coffee +19 -13
- data/spec/javascripts/mercury/modal_spec.js.coffee +192 -148
- data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +4 -5
- data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +2 -3
- data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +107 -34
- data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +106 -26
- data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +2 -3
- data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +50 -40
- data/spec/javascripts/mercury/page_editor_spec.js.coffee +124 -80
- data/spec/javascripts/mercury/palette_spec.js.coffee +4 -5
- data/spec/javascripts/mercury/panel_spec.js.coffee +9 -12
- data/spec/javascripts/mercury/region_spec.js.coffee +22 -17
- data/spec/javascripts/mercury/regions/{editable_spec.js.coffee → full_spec.js.coffee} +26 -28
- data/spec/javascripts/mercury/regions/image_spec.js.coffee +33 -0
- data/spec/javascripts/mercury/regions/{markupable_spec.js.coffee → markdown_spec.js.coffee} +32 -34
- data/spec/javascripts/mercury/regions/simple_spec.js.coffee +32 -0
- data/spec/javascripts/mercury/regions/{snippetable_spec.js.coffee → snippets_spec.js.coffee} +54 -55
- data/spec/javascripts/mercury/select_spec.js.coffee +4 -5
- data/spec/javascripts/mercury/snippet_spec.js.coffee +92 -16
- data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +31 -16
- data/spec/javascripts/mercury/statusbar_spec.js.coffee +9 -10
- data/spec/javascripts/mercury/table_editor_spec.js.coffee +1 -2
- data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +7 -9
- data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +55 -26
- data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +13 -13
- data/spec/javascripts/mercury/toolbar_spec.js.coffee +43 -14
- data/spec/javascripts/mercury/tooltip_spec.js.coffee +1 -2
- data/spec/javascripts/mercury/uploader_spec.js.coffee +47 -33
- data/spec/javascripts/spec_helper.coffee +4 -0
- data/spec/javascripts/{spec_helper.js → support/event_simulation.js} +0 -2
- data/spec/teabag_env.rb +32 -0
- metadata +366 -196
- data/features/regions/editable/basic_editing.feature +0 -195
- data/features/regions/editable/inserting_tables.feature +0 -109
- data/spec/javascripts/templates/mercury/modals/insertlink.html +0 -30
- data/spec/javascripts/templates/mercury/modals/insertmedia.html +0 -35
- data/spec/javascripts/templates/mercury/modals/inserttable.html +0 -27
- data/spec/javascripts/templates/mercury/region.html +0 -2
- data/spec/javascripts/templates/mercury/regions/editable.html +0 -3
- data/spec/javascripts/templates/mercury/regions/snippetable.html +0 -4
- data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +0 -54
- data/vendor/assets/javascripts/mercury_loader.js +0 -193
- data/vendor/assets/javascripts/mercury_overrides.js +0 -6
- data/vendor/assets/stylesheets/mercury/mercury.css +0 -151
- data/vendor/assets/stylesheets/mercury_overrides.css +0 -17
@@ -1,8 +1,7 @@
|
|
1
1
|
describe "Mercury.Palette", ->
|
2
2
|
|
3
|
-
template 'mercury/palette.html'
|
4
|
-
|
5
3
|
beforeEach ->
|
4
|
+
fixture.load('mercury/palette.html')
|
6
5
|
$.fx.off = true
|
7
6
|
|
8
7
|
afterEach ->
|
@@ -12,7 +11,7 @@ describe "Mercury.Palette", ->
|
|
12
11
|
describe "#build", ->
|
13
12
|
|
14
13
|
it "builds an element", ->
|
15
|
-
@palette = new Mercury.Palette('/blank.html', 'foo', {appendTo:
|
14
|
+
@palette = new Mercury.Palette('/blank.html', 'foo', {appendTo: fixture.el, for: $('#button')})
|
16
15
|
html = $('<div>').html(@palette.element).html()
|
17
16
|
expect(html).toContain('class="mercury-palette mercury-foo-palette loading"')
|
18
17
|
expect(html).toContain('style="display:none"')
|
@@ -25,7 +24,7 @@ describe "Mercury.Palette", ->
|
|
25
24
|
describe "observed events", ->
|
26
25
|
|
27
26
|
beforeEach ->
|
28
|
-
@palette = new Mercury.Palette('/blank.html', 'foo', {appendTo:
|
27
|
+
@palette = new Mercury.Palette('/blank.html', 'foo', {appendTo: fixture.el, for: $('#button')})
|
29
28
|
|
30
29
|
it "hides", ->
|
31
30
|
@palette.element.css({display: 'block'})
|
@@ -41,7 +40,7 @@ describe "Mercury.Palette", ->
|
|
41
40
|
describe "#position", ->
|
42
41
|
|
43
42
|
beforeEach ->
|
44
|
-
@palette = new Mercury.Palette('/blank.html', 'foo', {appendTo:
|
43
|
+
@palette = new Mercury.Palette('/blank.html', 'foo', {appendTo: fixture.el, for: $('#button')})
|
45
44
|
|
46
45
|
it "positions based on it's button", ->
|
47
46
|
@palette.element.css({display: 'block'})
|
@@ -1,8 +1,7 @@
|
|
1
1
|
describe "Mercury.Panel", ->
|
2
2
|
|
3
|
-
template 'mercury/panel.html'
|
4
|
-
|
5
3
|
beforeEach ->
|
4
|
+
fixture.load('mercury/panel.html')
|
6
5
|
Mercury.displayRect = {top: 20, left: 20, width: 200, height: 200}
|
7
6
|
$.fx.off = true
|
8
7
|
Mercury.determinedLocale =
|
@@ -18,11 +17,11 @@ describe "Mercury.Panel", ->
|
|
18
17
|
describe "#build", ->
|
19
18
|
|
20
19
|
it "builds an element", ->
|
21
|
-
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo:
|
20
|
+
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo: fixture.el, title: 'foo panel'})
|
22
21
|
html = $('<div>').html(@panel.element).html()
|
23
22
|
expect(html).toContain('class="mercury-panel loading"')
|
24
23
|
expect(html).toContain('style="display:none;"')
|
25
|
-
expect(html).toContain('<h1>foo panel</h1><div class="mercury-panel-pane"></div>')
|
24
|
+
expect(html).toContain('<h1><span>foo panel</span></h1><div class="mercury-panel-pane"></div>')
|
26
25
|
expect(html).not.toContain('class="mercury-panel-close"')
|
27
26
|
|
28
27
|
it "appends to any element", ->
|
@@ -30,7 +29,7 @@ describe "Mercury.Panel", ->
|
|
30
29
|
expect($('#panel_container .mercury-panel').length).toEqual(1)
|
31
30
|
|
32
31
|
it "creates a close button if it should", ->
|
33
|
-
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo:
|
32
|
+
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo: fixture.el, title: 'foo panel', closeButton: true})
|
34
33
|
html = $('<div>').html(@panel.element).html()
|
35
34
|
expect(html).toContain('class="mercury-panel-close"')
|
36
35
|
expect(@panel.element.find('.mercury-panel-close').css('opacity')).toEqual('0')
|
@@ -39,7 +38,7 @@ describe "Mercury.Panel", ->
|
|
39
38
|
describe "observed events", ->
|
40
39
|
|
41
40
|
beforeEach ->
|
42
|
-
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo:
|
41
|
+
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo: fixture.el, title: 'foo panel', for: $('#button'), closeButton: true})
|
43
42
|
|
44
43
|
describe "custom event: resize", ->
|
45
44
|
|
@@ -85,7 +84,7 @@ describe "Mercury.Panel", ->
|
|
85
84
|
describe "#show", ->
|
86
85
|
|
87
86
|
beforeEach ->
|
88
|
-
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo:
|
87
|
+
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo: fixture.el, title: 'foo panel'})
|
89
88
|
|
90
89
|
it "hides other panels and dialogs", ->
|
91
90
|
spyOn(Mercury.Panel.prototype, 'position')
|
@@ -146,7 +145,7 @@ describe "Mercury.Panel", ->
|
|
146
145
|
describe "#loadContent", ->
|
147
146
|
|
148
147
|
beforeEach ->
|
149
|
-
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo:
|
148
|
+
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo: fixture.el, title: 'foo panel'})
|
150
149
|
|
151
150
|
it "sets loaded to be true", ->
|
152
151
|
@panel.loadContent()
|
@@ -159,16 +158,14 @@ describe "Mercury.Panel", ->
|
|
159
158
|
it "sets the element html to be the data passed to it", ->
|
160
159
|
@panel.loadContent('<span>hello world!</span>')
|
161
160
|
html = @panel.element.html()
|
162
|
-
expect(html).toContain('<h1>foo panel</h1>')
|
163
161
|
expect(html).toContain('class="mercury-panel-pane"')
|
164
162
|
expect(html).toContain('style="visibility: hidden;')
|
165
163
|
expect(html).toContain('hello world!')
|
166
164
|
|
167
|
-
it "sets the element html to be the data passed to it", ->
|
165
|
+
it "sets the element html to be the data passed to it -- translated", ->
|
168
166
|
Mercury.config.localization.enabled = true
|
169
167
|
@panel.loadContent('<span>hello world!</span>')
|
170
168
|
html = @panel.element.html()
|
171
|
-
expect(html).toContain('<h1>foo panel</h1>')
|
172
169
|
expect(html).toContain('class="mercury-panel-pane"')
|
173
170
|
expect(html).toContain('style="visibility: hidden;')
|
174
171
|
expect(html).toContain('bork! bork!')
|
@@ -177,7 +174,7 @@ describe "Mercury.Panel", ->
|
|
177
174
|
describe "#makesDraggable", ->
|
178
175
|
|
179
176
|
beforeEach ->
|
180
|
-
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo:
|
177
|
+
@panel = new Mercury.Panel('/evergreen/resources/panel.html', 'foo', {appendTo: fixture.el, title: 'foo panel'})
|
181
178
|
|
182
179
|
it "makes the element draggable", ->
|
183
180
|
spy = spyOn($.fn, 'draggable').andCallFake(=>)
|
@@ -1,9 +1,8 @@
|
|
1
1
|
describe "Mercury.Region", ->
|
2
2
|
|
3
|
-
template 'mercury/region.html'
|
4
|
-
|
5
3
|
beforeEach ->
|
6
|
-
|
4
|
+
fixture.load('mercury/region.html')
|
5
|
+
Mercury.config.regions.attribute = 'custom-region-attribute'
|
7
6
|
Mercury.config.regions.dataAttributes = []
|
8
7
|
|
9
8
|
afterEach ->
|
@@ -127,17 +126,17 @@ describe "Mercury.Region", ->
|
|
127
126
|
|
128
127
|
it "does nothing if in preview mode", ->
|
129
128
|
@region.previewing = true
|
130
|
-
jasmine.simulate.mousemove($('#region_with_snippet .
|
129
|
+
jasmine.simulate.mousemove($('#region_with_snippet .example-snippet').get(0))
|
131
130
|
expect(@triggerSpy.callCount).toEqual(0)
|
132
131
|
|
133
132
|
it "does nothing if it's not the active region", ->
|
134
133
|
Mercury.region = {}
|
135
|
-
jasmine.simulate.mousemove($('#region_with_snippet .
|
134
|
+
jasmine.simulate.mousemove($('#region_with_snippet .example-snippet').get(0))
|
136
135
|
expect(@triggerSpy.callCount).toEqual(0)
|
137
136
|
|
138
137
|
it "shows the snippet toolbar if a snippet was moused over", ->
|
139
138
|
Mercury.region = @region
|
140
|
-
jasmine.simulate.mousemove($('#region_with_snippet .
|
139
|
+
jasmine.simulate.mousemove($('#region_with_snippet .example-snippet').get(0))
|
141
140
|
expect(@triggerSpy.callCount).toEqual(1)
|
142
141
|
expect(@triggerSpy.argsForCall[0][0]).toEqual('show:toolbar')
|
143
142
|
|
@@ -157,7 +156,7 @@ describe "Mercury.Region", ->
|
|
157
156
|
expect(@triggerSpy.argsForCall[0]).toEqual(['hide:toolbar', {type: 'snippet', immediately: false}])
|
158
157
|
|
159
158
|
|
160
|
-
describe "#
|
159
|
+
describe "#content", ->
|
161
160
|
|
162
161
|
beforeEach ->
|
163
162
|
@region = new Mercury.Region($('#region_with_snippet'), window)
|
@@ -166,11 +165,15 @@ describe "Mercury.Region", ->
|
|
166
165
|
|
167
166
|
it "returns the html of the element", ->
|
168
167
|
content = @region.content()
|
169
|
-
expect(content).toEqual('contents<div class="
|
168
|
+
expect(content).toEqual('contents<div class="example-snippet" data-snippet="snippet_1" data-version="1">snippet</div>')
|
170
169
|
|
171
170
|
it "replaces snippet content with an indentifier if asked", ->
|
172
171
|
content = @region.content(null, true)
|
173
|
-
expect(content).toEqual('contents<div class="
|
172
|
+
expect(content).toEqual('contents<div class="example-snippet" data-snippet="snippet_1">[snippet_1]</div>')
|
173
|
+
|
174
|
+
it "does not execute JavaScript contained within the region (bug fix)", ->
|
175
|
+
(new Mercury.Region($('#region_with_javascript_snippet'), window)).content()
|
176
|
+
expect($('#modifiable-element').children().length).toEqual(0)
|
174
177
|
|
175
178
|
describe "setting html", ->
|
176
179
|
|
@@ -195,9 +198,8 @@ describe "Mercury.Region", ->
|
|
195
198
|
it "sets previewing to true", ->
|
196
199
|
expect(@region.previewing).toEqual(true)
|
197
200
|
|
198
|
-
it "
|
199
|
-
expect(@region.element.
|
200
|
-
expect(@region.element.hasClass('custom-region-class-preview')).toEqual(true)
|
201
|
+
it "removes the data attribute", ->
|
202
|
+
expect(@region.element.attr('custom-region-attribute')).toEqual(null)
|
201
203
|
|
202
204
|
it "triggers a blur event", ->
|
203
205
|
expect(@triggerSpy.callCount).toEqual(1)
|
@@ -212,9 +214,8 @@ describe "Mercury.Region", ->
|
|
212
214
|
it "sets previewing to false", ->
|
213
215
|
expect(@region.previewing).toEqual(false)
|
214
216
|
|
215
|
-
it "
|
216
|
-
expect(@region.element.
|
217
|
-
expect(@region.element.hasClass('custom-region-class')).toEqual(true)
|
217
|
+
it "adds the correct data attribute back", ->
|
218
|
+
expect(@region.element.attr('custom-region-attribute')).toEqual('unknown')
|
218
219
|
|
219
220
|
it "calls focus if it's the active region", ->
|
220
221
|
expect(@focusSpy.callCount).toEqual(1)
|
@@ -270,6 +271,10 @@ describe "Mercury.Region", ->
|
|
270
271
|
@region.element.attr('data-version', 2)
|
271
272
|
expect(@region.dataAttributes()).toEqual({scope: 'scope', version: '2'})
|
272
273
|
|
274
|
+
it "looks to @container if it's set", ->
|
275
|
+
@region.container = $('<div>').attr('data-version', 3)
|
276
|
+
expect(@region.dataAttributes()).toEqual({scope: undefined, version: '3'})
|
277
|
+
|
273
278
|
|
274
279
|
describe "#serialize", ->
|
275
280
|
|
@@ -280,7 +285,7 @@ describe "Mercury.Region", ->
|
|
280
285
|
|
281
286
|
it "returns an object with it's type, value, and snippets", ->
|
282
287
|
serialized = @region.serialize()
|
283
|
-
expect(serialized.type).toEqual('
|
288
|
+
expect(serialized.type).toEqual('unknown')
|
284
289
|
expect(serialized.value).toEqual('contents')
|
285
290
|
expect(serialized.snippets).toEqual({})
|
286
291
|
expect(serialized.data).toEqual({})
|
@@ -292,7 +297,7 @@ describe "Mercury.Region", ->
|
|
292
297
|
|
293
298
|
it "returns an object with it's type, value, data and snippets", ->
|
294
299
|
serialized = @region.serialize()
|
295
|
-
expect(serialized.type).toEqual('
|
300
|
+
expect(serialized.type).toEqual('unknown')
|
296
301
|
expect(serialized.value).toEqual('contents')
|
297
302
|
expect(serialized.snippets).toEqual({})
|
298
303
|
expect(serialized.data).toEqual({scope: 'scope', version: '1'})
|
@@ -1,36 +1,35 @@
|
|
1
|
-
describe "Mercury.Regions.
|
2
|
-
|
3
|
-
template 'mercury/regions/editable.html'
|
1
|
+
describe "Mercury.Regions.Full", ->
|
4
2
|
|
5
3
|
beforeEach ->
|
6
|
-
|
4
|
+
fixture.load('mercury/regions/full.html')
|
5
|
+
@regionElement = $('#full_region1')
|
7
6
|
|
8
7
|
describe "constructor", ->
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
beforeEach ->
|
10
|
+
@buildSpy = spyOn(Mercury.Regions.Full.prototype, 'build').andCallFake(=>)
|
11
|
+
@bindEventsSpy = spyOn(Mercury.Regions.Full.prototype, 'bindEvents').andCallFake(=>)
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
it "expects an element and window", ->
|
14
|
+
@region = new Mercury.Regions.Full(@regionElement, window)
|
15
|
+
expect(@region.element.get(0)).toEqual($('#full_region1').get(0))
|
16
|
+
expect(@region.window).toEqual(window)
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
it "accepts options", ->
|
19
|
+
@region = new Mercury.Regions.Full(@regionElement, window, {foo: 'something'})
|
20
|
+
expect(@region.options).toEqual({foo: 'something'})
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
it "sets it's type", ->
|
23
|
+
@region = new Mercury.Regions.Full(@regionElement, window)
|
24
|
+
expect(@region.type()).toEqual('full')
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
it "calls build", ->
|
27
|
+
@region = new Mercury.Regions.Full(@regionElement, window)
|
28
|
+
expect(@buildSpy.callCount).toEqual(1)
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
it "calls bindEvents", ->
|
31
|
+
@region = new Mercury.Regions.Full(@regionElement, window)
|
32
|
+
expect(@bindEventsSpy.callCount).toEqual(1)
|
34
33
|
|
35
34
|
|
36
35
|
describe "#build", ->
|
@@ -326,13 +325,12 @@ describe "Mercury.Regions.Editable", ->
|
|
326
325
|
|
327
326
|
|
328
327
|
|
329
|
-
describe "Mercury.Regions.
|
330
|
-
|
331
|
-
template 'mercury/regions/editable.html'
|
328
|
+
describe "Mercury.Regions.Full.actions", ->
|
332
329
|
|
333
330
|
beforeEach ->
|
334
|
-
|
335
|
-
#@
|
331
|
+
fixture.load('mercury/regions/full.html')
|
332
|
+
#@region = new Mercury.Regions.Full($('#full_region1'), window)
|
333
|
+
#@actions = Mercury.Regions.Full.actions
|
336
334
|
|
337
335
|
#
|
338
336
|
# behaviors
|
@@ -0,0 +1,33 @@
|
|
1
|
+
describe "Mercury.Regions.Image", ->
|
2
|
+
|
3
|
+
beforeEach ->
|
4
|
+
fixture.load('mercury/regions/image.html')
|
5
|
+
@regionElement = $('#image_region1')
|
6
|
+
|
7
|
+
describe "constructor", ->
|
8
|
+
|
9
|
+
beforeEach ->
|
10
|
+
@buildSpy = spyOn(Mercury.Regions.Image.prototype, 'build').andCallFake(=>)
|
11
|
+
@bindEventsSpy = spyOn(Mercury.Regions.Image.prototype, 'bindEvents').andCallFake(=>)
|
12
|
+
|
13
|
+
it "expects an element and window", ->
|
14
|
+
@region = new Mercury.Regions.Image(@regionElement, window)
|
15
|
+
expect(@region.element.get(0)).toEqual($('#image_region1').get(0))
|
16
|
+
expect(@region.window).toEqual(window)
|
17
|
+
|
18
|
+
it "accepts options", ->
|
19
|
+
@region = new Mercury.Regions.Image(@regionElement, window, {foo: 'something'})
|
20
|
+
expect(@region.options).toEqual({foo: 'something'})
|
21
|
+
|
22
|
+
it "sets it's type", ->
|
23
|
+
@region = new Mercury.Regions.Image(@regionElement, window)
|
24
|
+
expect(@region.type()).toEqual('image')
|
25
|
+
|
26
|
+
it "calls build", ->
|
27
|
+
@region = new Mercury.Regions.Image(@regionElement, window)
|
28
|
+
expect(@buildSpy.callCount).toEqual(1)
|
29
|
+
|
30
|
+
it "calls bindEvents", ->
|
31
|
+
@region = new Mercury.Regions.Image(@regionElement, window)
|
32
|
+
expect(@bindEventsSpy.callCount).toEqual(1)
|
33
|
+
|
@@ -1,43 +1,42 @@
|
|
1
|
-
describe "Mercury.Regions.
|
2
|
-
|
3
|
-
template 'mercury/regions/markupable.html'
|
1
|
+
describe "Mercury.Regions.Markdown", ->
|
4
2
|
|
5
3
|
beforeEach ->
|
6
|
-
|
4
|
+
fixture.load('mercury/regions/markdown.html')
|
5
|
+
@regionElement = $('#markdown_region1')
|
7
6
|
|
8
7
|
describe "constructor", ->
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
beforeEach ->
|
10
|
+
@buildSpy = spyOn(Mercury.Regions.Markdown.prototype, 'build').andCallFake(=>)
|
11
|
+
@bindEventsSpy = spyOn(Mercury.Regions.Markdown.prototype, 'bindEvents').andCallFake(=>)
|
12
|
+
spyOn(Mercury.Regions.Markdown.prototype, 'pushHistory').andCallFake(=>)
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
it "expects an element and window", ->
|
15
|
+
@region = new Mercury.Regions.Markdown(@regionElement, window)
|
16
|
+
expect(@region.element.get(0)).toEqual($('#markdown_region1').get(0))
|
17
|
+
expect(@region.window).toEqual(window)
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
it "accepts options", ->
|
20
|
+
@region = new Mercury.Regions.Markdown(@regionElement, window, {foo: 'something'})
|
21
|
+
expect(@region.options).toEqual({foo: 'something'})
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
it "sets it's type", ->
|
24
|
+
@region = new Mercury.Regions.Markdown(@regionElement, window)
|
25
|
+
expect(@region.type()).toEqual('markdown')
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
it "creates a markdown converter using Showdown", ->
|
28
|
+
spy = spyOn(Showdown, 'converter').andCallFake(=>)
|
29
|
+
@region = new Mercury.Regions.Markdown(@regionElement, window)
|
30
|
+
expect(spy.callCount).toEqual(1)
|
31
|
+
expect(@region.converter).toBeDefined()
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
it "calls build", ->
|
34
|
+
@region = new Mercury.Regions.Markdown(@regionElement, window)
|
35
|
+
expect(@buildSpy.callCount).toEqual(1)
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
it "calls bindEvents", ->
|
38
|
+
@region = new Mercury.Regions.Markdown(@regionElement, window)
|
39
|
+
expect(@bindEventsSpy.callCount).toEqual(1)
|
41
40
|
|
42
41
|
|
43
42
|
describe "#build", ->
|
@@ -266,13 +265,12 @@ describe "Mercury.Regions.Markupable", ->
|
|
266
265
|
|
267
266
|
|
268
267
|
|
269
|
-
describe "Mercury.Regions.
|
270
|
-
|
271
|
-
template 'mercury/regions/markupable.html'
|
268
|
+
describe "Mercury.Regions.Markdown.actions", ->
|
272
269
|
|
273
270
|
beforeEach ->
|
274
|
-
|
275
|
-
#@
|
271
|
+
fixture.load('mercury/regions/markdown.html')
|
272
|
+
#@region = new Mercury.Regions.Markdown($('#markdown_region1'), window)
|
273
|
+
#@actions = Mercury.Regions.Markdown.actions
|
276
274
|
|
277
275
|
describe ".undo", ->
|
278
276
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe "Mercury.Regions.Simple", ->
|
2
|
+
|
3
|
+
beforeEach ->
|
4
|
+
fixture.load('mercury/regions/simple.html')
|
5
|
+
@regionElement = $('#simple_region1')
|
6
|
+
|
7
|
+
describe "constructor", ->
|
8
|
+
|
9
|
+
beforeEach ->
|
10
|
+
@buildSpy = spyOn(Mercury.Regions.Simple.prototype, 'build').andCallFake(=>)
|
11
|
+
@bindEventsSpy = spyOn(Mercury.Regions.Simple.prototype, 'bindEvents').andCallFake(=>)
|
12
|
+
|
13
|
+
it "expects an element and window", ->
|
14
|
+
@region = new Mercury.Regions.Simple(@regionElement, window)
|
15
|
+
expect(@region.element.get(0)).toEqual($('#simple_region1').get(0))
|
16
|
+
expect(@region.window).toEqual(window)
|
17
|
+
|
18
|
+
it "accepts options", ->
|
19
|
+
@region = new Mercury.Regions.Simple(@regionElement, window, {foo: 'something'})
|
20
|
+
expect(@region.options).toEqual({foo: 'something'})
|
21
|
+
|
22
|
+
it "sets it's type", ->
|
23
|
+
@region = new Mercury.Regions.Simple(@regionElement, window)
|
24
|
+
expect(@region.type()).toEqual('simple')
|
25
|
+
|
26
|
+
it "calls build", ->
|
27
|
+
@region = new Mercury.Regions.Simple(@regionElement, window)
|
28
|
+
expect(@buildSpy.callCount).toEqual(1)
|
29
|
+
|
30
|
+
it "calls bindEvents", ->
|
31
|
+
@region = new Mercury.Regions.Simple(@regionElement, window)
|
32
|
+
expect(@bindEventsSpy.callCount).toEqual(1)
|