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
@@ -1,31 +1,31 @@
|
|
1
1
|
describe "Mercury.modalHandlers.insertTable", ->
|
2
2
|
|
3
|
+
template 'mercury/modals/inserttable.html'
|
4
|
+
|
3
5
|
beforeEach ->
|
4
|
-
fixture.load('mercury/modals/inserttable.html')
|
5
6
|
@modal =
|
6
|
-
element: $(
|
7
|
+
element: $('#test')
|
7
8
|
hide: ->
|
8
|
-
@insertTable = $.extend(@modal, Mercury.modalHandlers.insertTable)
|
9
9
|
|
10
10
|
describe "initializing", ->
|
11
11
|
|
12
12
|
beforeEach ->
|
13
13
|
@tableEditorSpy = spyOn(Mercury, 'tableEditor').andCallFake(=>)
|
14
|
-
|
14
|
+
Mercury.modalHandlers.insertTable.call(@modal)
|
15
15
|
|
16
16
|
it "selects the first cell", ->
|
17
17
|
expect($('#cell1').hasClass('selected')).toEqual(true)
|
18
18
|
|
19
19
|
it "sets the table editor up", ->
|
20
20
|
expect(@tableEditorSpy.callCount).toEqual(1)
|
21
|
-
expect(@tableEditorSpy.argsForCall[0][0].get(0)).toEqual($('table').get(0))
|
21
|
+
expect(@tableEditorSpy.argsForCall[0][0].get(0)).toEqual($('#table').get(0))
|
22
22
|
expect(@tableEditorSpy.argsForCall[0][1].get(0)).toEqual($('#cell1').get(0))
|
23
23
|
|
24
24
|
describe "clicking on the cells", ->
|
25
25
|
|
26
26
|
beforeEach ->
|
27
27
|
@tableEditorSpy = spyOn(Mercury, 'tableEditor').andCallFake(=>)
|
28
|
-
|
28
|
+
Mercury.modalHandlers.insertTable.call(@modal)
|
29
29
|
|
30
30
|
it "should unselect any selected cells", ->
|
31
31
|
jasmine.simulate.click($('#cell2').get(0))
|
@@ -44,56 +44,58 @@ describe "Mercury.modalHandlers.insertTable", ->
|
|
44
44
|
describe "clicking on the action buttons", ->
|
45
45
|
|
46
46
|
beforeEach ->
|
47
|
-
@
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@
|
51
|
-
@addColumnSpy = spyOn(Mercury.tableEditor, 'addColumn').andCallFake(=>)
|
52
|
-
@removeColumnSpy = spyOn(Mercury.tableEditor, 'removeColumn').andCallFake(=>)
|
47
|
+
@addRowSpy = spyOn(Mercury.tableEditor, 'addRow').andCallFake(=>)
|
48
|
+
@removeRowSpy = spyOn(Mercury.tableEditor, 'removeRow').andCallFake(=>)
|
49
|
+
@addColumnSpy = spyOn(Mercury.tableEditor, 'addColumn').andCallFake(=>)
|
50
|
+
@removeColumnSpy = spyOn(Mercury.tableEditor, 'removeColumn').andCallFake(=>)
|
53
51
|
@increaseColspanSpy = spyOn(Mercury.tableEditor, 'increaseColspan').andCallFake(=>)
|
54
52
|
@decreaseColspanSpy = spyOn(Mercury.tableEditor, 'decreaseColspan').andCallFake(=>)
|
55
53
|
@increaseRowspanSpy = spyOn(Mercury.tableEditor, 'increaseRowspan').andCallFake(=>)
|
56
54
|
@decreaseRowspanSpy = spyOn(Mercury.tableEditor, 'decreaseRowspan').andCallFake(=>)
|
57
|
-
|
55
|
+
Mercury.modalHandlers.insertTable.call(@modal)
|
58
56
|
|
59
57
|
it "adds a row before the selected cell", ->
|
60
|
-
jasmine.simulate.click($('[
|
61
|
-
expect(@
|
58
|
+
jasmine.simulate.click($('input[name=insertRowBefore]').get(0))
|
59
|
+
expect(@addRowSpy.callCount).toEqual(1)
|
60
|
+
expect(@addRowSpy.argsForCall[0]).toEqual(['before'])
|
62
61
|
|
63
62
|
it "adds a row after the selected cell", ->
|
64
|
-
jasmine.simulate.click($('[
|
63
|
+
jasmine.simulate.click($('input[name=insertRowAfter]').get(0))
|
65
64
|
expect(@addRowSpy.callCount).toEqual(1)
|
65
|
+
expect(@addRowSpy.argsForCall[0]).toEqual(['after'])
|
66
66
|
|
67
67
|
it "deletes the row of the selected cell", ->
|
68
|
-
jasmine.simulate.click($('[
|
68
|
+
jasmine.simulate.click($('input[name=deleteRow]').get(0))
|
69
69
|
expect(@removeRowSpy.callCount).toEqual(1)
|
70
70
|
|
71
71
|
it "adds a column before the selected cell", ->
|
72
|
-
jasmine.simulate.click($('[
|
73
|
-
expect(@
|
72
|
+
jasmine.simulate.click($('input[name=insertColumnBefore]').get(0))
|
73
|
+
expect(@addColumnSpy.callCount).toEqual(1)
|
74
|
+
expect(@addColumnSpy.argsForCall[0]).toEqual(['before'])
|
74
75
|
|
75
76
|
it "adds a column after the selected cell", ->
|
76
|
-
jasmine.simulate.click($('[
|
77
|
+
jasmine.simulate.click($('input[name=insertColumnAfter]').get(0))
|
77
78
|
expect(@addColumnSpy.callCount).toEqual(1)
|
79
|
+
expect(@addColumnSpy.argsForCall[0]).toEqual(['after'])
|
78
80
|
|
79
81
|
it "deletes the column of the selected cell", ->
|
80
|
-
jasmine.simulate.click($('[
|
82
|
+
jasmine.simulate.click($('input[name=deleteColumn]').get(0))
|
81
83
|
expect(@removeColumnSpy.callCount).toEqual(1)
|
82
84
|
|
83
85
|
it "increases the colspan of the selected cell", ->
|
84
|
-
jasmine.simulate.click($('[
|
86
|
+
jasmine.simulate.click($('input[name=increaseColspan]').get(0))
|
85
87
|
expect(@increaseColspanSpy.callCount).toEqual(1)
|
86
88
|
|
87
89
|
it "decreases the colspan of the selected cell", ->
|
88
|
-
jasmine.simulate.click($('[
|
90
|
+
jasmine.simulate.click($('input[name=decreaseColspan]').get(0))
|
89
91
|
expect(@decreaseColspanSpy.callCount).toEqual(1)
|
90
92
|
|
91
93
|
it "increases the rowspan of the selected cell", ->
|
92
|
-
jasmine.simulate.click($('[
|
94
|
+
jasmine.simulate.click($('input[name=increaseRowspan]').get(0))
|
93
95
|
expect(@increaseRowspanSpy.callCount).toEqual(1)
|
94
96
|
|
95
97
|
it "decreases the rowspan of the selected cell", ->
|
96
|
-
jasmine.simulate.click($('[
|
98
|
+
jasmine.simulate.click($('input[name=decreaseRowspan]').get(0))
|
97
99
|
expect(@decreaseRowspanSpy.callCount).toEqual(1)
|
98
100
|
|
99
101
|
|
@@ -105,57 +107,43 @@ describe "Mercury.modalHandlers.insertTable", ->
|
|
105
107
|
describe "changing the border", ->
|
106
108
|
|
107
109
|
beforeEach ->
|
108
|
-
|
110
|
+
Mercury.modalHandlers.insertTable.call(@modal)
|
109
111
|
|
110
112
|
it "changes the border of the table", ->
|
111
113
|
$('#table_border').val('19')
|
112
114
|
jasmine.simulate.keyup($('#table_border').get(0))
|
113
|
-
expect($('table').attr('border')).toEqual('19')
|
115
|
+
expect($('#table').attr('border')).toEqual('19')
|
114
116
|
|
115
117
|
it "handles non-numeric values", ->
|
116
|
-
$('#table_border').
|
117
|
-
# chrome already does this -- so only test in those browsers that will return 12x
|
118
|
-
$('#table_border').attr(value: '2') unless $('#table_border').val() == '2x'
|
119
|
-
jasmine.simulate.keyup($('#table_border').get(0))
|
120
|
-
expect($('table').attr('border')).toEqual('2')
|
121
|
-
|
122
|
-
it "removes the property if empty value specified", ->
|
123
|
-
$('#table_border').val('')
|
118
|
+
$('#table_border').val('2x')
|
124
119
|
jasmine.simulate.keyup($('#table_border').get(0))
|
125
|
-
expect($('table').attr('border')).toEqual(
|
120
|
+
expect($('#table').attr('border')).toEqual('2')
|
126
121
|
|
127
122
|
|
128
123
|
describe "changing the cellspacing", ->
|
129
124
|
|
130
125
|
beforeEach ->
|
131
|
-
|
126
|
+
Mercury.modalHandlers.insertTable.call(@modal)
|
132
127
|
|
133
128
|
it "changes the cellspacing of the table", ->
|
134
129
|
$('#table_spacing').val('5')
|
135
130
|
jasmine.simulate.keyup($('#table_spacing').get(0))
|
136
|
-
expect($('table').attr('cellspacing')).toEqual('5')
|
131
|
+
expect($('#table').attr('cellspacing')).toEqual('5')
|
137
132
|
|
138
133
|
it "handles non-numeric values", ->
|
139
|
-
$('#table_spacing').
|
140
|
-
# chrome already does this -- so only test in those browsers that will return 12x
|
141
|
-
$('#table_spacing').attr(value: '12') unless $('#table_spacing').val() == '12x'
|
134
|
+
$('#table_spacing').val('12x')
|
142
135
|
jasmine.simulate.keyup($('#table_spacing').get(0))
|
143
|
-
expect($('table').attr('cellspacing')).toEqual('12')
|
144
|
-
|
145
|
-
it "removes the property if empty value specified", ->
|
146
|
-
$('#table_spacing').val('')
|
147
|
-
jasmine.simulate.keyup($('#table_spacing').get(0))
|
148
|
-
expect($('table').attr('cellspacing')).toEqual(undefined)
|
136
|
+
expect($('#table').attr('cellspacing')).toEqual('12')
|
149
137
|
|
150
138
|
|
151
139
|
describe "submitting", ->
|
152
140
|
|
153
141
|
beforeEach ->
|
154
|
-
|
142
|
+
Mercury.modalHandlers.insertTable.call(@modal)
|
155
143
|
|
156
144
|
it "triggers an action", ->
|
157
145
|
spy = spyOn(Mercury, 'trigger').andCallFake(=>)
|
158
|
-
jasmine.simulate.click($('
|
146
|
+
jasmine.simulate.click($('#submit').get(0))
|
159
147
|
expect(spy.callCount).toEqual(1)
|
160
148
|
expect(spy.argsForCall[0][0]).toEqual('action')
|
161
149
|
expect(spy.argsForCall[0][1]['action']).toEqual('insertTable')
|
@@ -166,5 +154,7 @@ describe "Mercury.modalHandlers.insertTable", ->
|
|
166
154
|
|
167
155
|
it "hides the modal", ->
|
168
156
|
spy = spyOn(@modal, 'hide').andCallFake(=>)
|
169
|
-
jasmine.simulate.click($('
|
157
|
+
jasmine.simulate.click($('#submit').get(0))
|
170
158
|
expect(spy.callCount).toEqual(1)
|
159
|
+
|
160
|
+
|