mercury-rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/README.rdoc +81 -50
  2. data/VERSION +1 -1
  3. data/app/assets/javascripts/mercury/dialog.js.coffee +4 -4
  4. data/app/assets/javascripts/mercury/dialogs/backcolor.js.coffee +3 -3
  5. data/app/assets/javascripts/mercury/dialogs/forecolor.js.coffee +3 -3
  6. data/app/assets/javascripts/mercury/dialogs/formatblock.js.coffee +1 -1
  7. data/app/assets/javascripts/mercury/dialogs/objectspanel.js.coffee +3 -3
  8. data/app/assets/javascripts/mercury/dialogs/style.js.coffee +1 -1
  9. data/app/assets/javascripts/mercury/history_buffer.js.coffee +2 -2
  10. data/app/assets/javascripts/mercury/mercury.js.coffee +47 -54
  11. data/app/assets/javascripts/mercury/modal.js.coffee +13 -13
  12. data/app/assets/javascripts/mercury/modals/htmleditor.js.coffee +2 -2
  13. data/app/assets/javascripts/mercury/modals/insertcharacter.js.coffee +2 -2
  14. data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +7 -7
  15. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +5 -5
  16. data/app/assets/javascripts/mercury/modals/insertsnippet.js.coffee +2 -2
  17. data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +14 -15
  18. data/app/assets/javascripts/mercury/native_extensions.js.coffee +2 -1
  19. data/app/assets/javascripts/mercury/page_editor.js.coffee +27 -27
  20. data/app/assets/javascripts/mercury/palette.js.coffee +6 -6
  21. data/app/assets/javascripts/mercury/panel.js.coffee +4 -4
  22. data/app/assets/javascripts/mercury/region.js.coffee +9 -9
  23. data/app/assets/javascripts/mercury/regions/editable.js.coffee +71 -71
  24. data/app/assets/javascripts/mercury/regions/markupable.js.coffee +51 -42
  25. data/app/assets/javascripts/mercury/regions/snippetable.js.coffee +7 -8
  26. data/app/assets/javascripts/mercury/select.js.coffee +8 -8
  27. data/app/assets/javascripts/mercury/snippet.js.coffee +6 -6
  28. data/app/assets/javascripts/mercury/snippet_toolbar.js.coffee +7 -7
  29. data/app/assets/javascripts/mercury/statusbar.js.coffee +7 -3
  30. data/app/assets/javascripts/mercury/table_editor.js.coffee +24 -24
  31. data/app/assets/javascripts/mercury/toolbar.button.js.coffee +20 -21
  32. data/app/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  33. data/app/assets/javascripts/mercury/toolbar.expander.js.coffee +9 -9
  34. data/app/assets/javascripts/mercury/toolbar.js.coffee +12 -13
  35. data/app/assets/javascripts/mercury/tooltip.js.coffee +7 -7
  36. data/app/assets/javascripts/mercury/uploader.js.coffee +12 -13
  37. data/app/assets/javascripts/mercury_loader.js +98 -0
  38. data/app/assets/stylesheets/mercury/modal.scss +5 -5
  39. data/app/assets/stylesheets/mercury/toolbar.scss +62 -64
  40. data/app/views/layouts/mercury.html.haml +0 -4
  41. data/app/views/mercury/modals/character.html.haml +1 -1
  42. data/app/views/mercury/modals/htmleditor.html.haml +1 -1
  43. data/app/views/mercury/modals/table.html.haml +10 -10
  44. data/config/routes.rb +2 -2
  45. data/mercury-rails.gemspec +17 -20
  46. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +3 -3
  47. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +3 -3
  48. data/spec/javascripts/mercury/dialogs/objectspanel_spec.js.coffee +3 -3
  49. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +4 -4
  50. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +2 -2
  51. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +10 -10
  52. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +7 -7
  53. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +4 -4
  54. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +17 -17
  55. data/spec/javascripts/mercury/page_editor_spec.js.coffee +5 -6
  56. data/spec/javascripts/mercury/region_spec.js.coffee +5 -5
  57. data/spec/javascripts/mercury/regions/editable_spec.js.coffee +398 -0
  58. data/spec/javascripts/mercury/regions/snippetable_spec.js.coffee +18 -14
  59. data/spec/javascripts/mercury/snippet_spec.js.coffee +1 -1
  60. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +16 -16
  61. data/spec/javascripts/templates/mercury/modals/inserttable.html +11 -11
  62. data/spec/javascripts/templates/mercury/regions/editable.html +3 -0
  63. data/spec/javascripts/templates/mercury/toolbar.button.html +8 -8
  64. data/vendor/assets/javascripts/{jquery-ui-1.8.13.sortable.custom.js → jquery-ui-1.8.13.custom.js} +250 -0
  65. data/vendor/assets/javascripts/jquery.additions.js +151 -0
  66. data/vendor/assets/javascripts/showdown.js +1254 -1276
  67. metadata +26 -29
  68. data/app/assets/javascripts/mercury/websocket.js.coffee +0 -34
  69. data/spec/javascripts/mercury/regions/_editable_.js.coffee +0 -0
  70. data/vendor/assets/javascripts/jquery-ui-1.8.13.custom.min.js +0 -249
  71. data/vendor/assets/javascripts/jquery.easing.js +0 -173
  72. data/vendor/assets/javascripts/jquery.json2.js +0 -178
  73. data/vendor/assets/javascripts/jquery.serialize_object.js +0 -16
  74. data/vendor/assets/javascripts/jquery.ujs.js +0 -289
@@ -5,8 +5,4 @@
5
5
  = csrf_meta_tags
6
6
  = stylesheet_link_tag "mercury"
7
7
  = javascript_include_tag "mercury"
8
- -#:javascript
9
- -# Mercury.Snippet.load({
10
- -# 'snippet_1': {name: 'example', options: {'options[favorite_beer]': "miller_lite", 'options[first_name]': "1"}},
11
- -# });
12
8
  %body= javascript_tag 'new Mercury.PageEditor()'
@@ -1,4 +1,4 @@
1
- %form#mercury_insertcharacter{ style: 'width:456px' }
1
+ %form#mercury_insertCharacter{ style: 'width:456px' }
2
2
 
3
3
  .mercury-modal-pane-container
4
4
  .mercury-modal-pane
@@ -1,4 +1,4 @@
1
- = semantic_form_for 'htmleditor', { html: { id: 'mercury_htmleditor', style: 'width:650px' } } do |f|
1
+ = semantic_form_for 'htmlEditor', { html: { id: 'mercury_htmlEditor', style: 'width:650px' } } do |f|
2
2
 
3
3
  %textarea.mercury-modal-pane-container{ rows: '5' }
4
4
 
@@ -19,23 +19,23 @@
19
19
  = f.inputs do
20
20
  %li{ class: "select input optional", id: "table_rows_input" }
21
21
  %label{ for: "table_rows" } Rows
22
- %input{ type: 'button', name: 'insertrowbefore', class: 'action', value: 'Add Before' }/
23
- %input{ type: 'button', name: 'insertrowafter', class: 'action', value: 'Add After' }/
24
- %input{ type: 'button', name: 'deleterow', class: 'action', value: 'Remove' }/
22
+ %input{ type: 'button', name: 'insertRowBefore', class: 'action', value: 'Add Before' }/
23
+ %input{ type: 'button', name: 'insertRowAfter', class: 'action', value: 'Add After' }/
24
+ %input{ type: 'button', name: 'deleteRow', class: 'action', value: 'Remove' }/
25
25
  %li{ class: "select input optional", id: "table_columns_input" }
26
26
  %label{ for: "table_columns" } Columns
27
- %input{ type: 'button', name: 'insertcolumnbefore', class: 'action', value: 'Add Before' }/
28
- %input{ type: 'button', name: 'insertcolumnafter', class: 'action', value: 'Add After' }/
29
- %input{ type: 'button', name: 'deletecolumn', class: 'action', value: 'Remove' }/
27
+ %input{ type: 'button', name: 'insertColumnBefore', class: 'action', value: 'Add Before' }/
28
+ %input{ type: 'button', name: 'insertColumnAfter', class: 'action', value: 'Add After' }/
29
+ %input{ type: 'button', name: 'deleteColumn', class: 'action', value: 'Remove' }/
30
30
  %hr
31
31
  %li{ class: "select input optional", id: "table_row_adjust_input" }
32
32
  %label{ for: "table_row_adjust" } Row Span
33
- %input{ type: 'button', name: 'increaserowspan', class: 'action', value: '+' }/
34
- %input{ type: 'button', name: 'decreaserowspan', class: 'action', value: '-' }/
33
+ %input{ type: 'button', name: 'increaseRowspan', class: 'action', value: '+' }/
34
+ %input{ type: 'button', name: 'decreaseRowspan', class: 'action', value: '-' }/
35
35
  %li{ class: "select input optional", id: "table_column_adjust_input" }
36
36
  %label{ for: "table_column_adjust" } Column Span
37
- %input{ type: 'button', name: 'increasecolspan', class: 'action', value: '+' }/
38
- %input{ type: 'button', name: 'decreasecolspan', class: 'action', value: '-' }/
37
+ %input{ type: 'button', name: 'increaseColspan', class: 'action', value: '+' }/
38
+ %input{ type: 'button', name: 'decreaseColspan', class: 'action', value: '-' }/
39
39
 
40
40
  = f.inputs 'Options' do
41
41
  = f.input :alignment, as: :select, required: false, include_blank: 'None',
@@ -2,8 +2,8 @@ Rails.application.routes.draw do
2
2
 
3
3
  resources :images
4
4
 
5
- match '/edit(/*requested_uri)' => "mercury#edit"
6
- namespace :mercury do
5
+ match '/editor(/*requested_uri)' => "mercury#edit"
6
+ scope '/mercury' do
7
7
  match ':type/:resource' => "mercury#resource"
8
8
  match 'snippets/:name/options' => "mercury#snippet_options"
9
9
  match 'snippets/:name/preview' => "mercury#snippet_preview"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mercury-rails}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeremy Jackson"]
12
- s.date = %q{2011-06-19}
12
+ s.date = %q{2011-06-21}
13
13
  s.description = %q{A fully featured and advanced HTML5 WYSIWYG editor written in CoffeeScript on top of Rails 3.1}
14
14
  s.email = %q{jejacks0n@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -79,7 +79,7 @@ Gem::Specification.new do |s|
79
79
  "app/assets/javascripts/mercury/toolbar.js.coffee",
80
80
  "app/assets/javascripts/mercury/tooltip.js.coffee",
81
81
  "app/assets/javascripts/mercury/uploader.js.coffee",
82
- "app/assets/javascripts/mercury/websocket.js.coffee",
82
+ "app/assets/javascripts/mercury_loader.js",
83
83
  "app/assets/stylesheets/mercury.css",
84
84
  "app/assets/stylesheets/mercury/dialog.scss",
85
85
  "app/assets/stylesheets/mercury/mercury.scss",
@@ -138,8 +138,8 @@ Gem::Specification.new do |s|
138
138
  "spec/javascripts/mercury/palette_spec.js.coffee",
139
139
  "spec/javascripts/mercury/panel_spec.js.coffee",
140
140
  "spec/javascripts/mercury/region_spec.js.coffee",
141
- "spec/javascripts/mercury/regions/_editable_.js.coffee",
142
141
  "spec/javascripts/mercury/regions/_markupable_.js.coffee",
142
+ "spec/javascripts/mercury/regions/editable_spec.js.coffee",
143
143
  "spec/javascripts/mercury/regions/snippetable_spec.js.coffee",
144
144
  "spec/javascripts/mercury/select_spec.js.coffee",
145
145
  "spec/javascripts/mercury/snippet_spec.js.coffee",
@@ -170,6 +170,7 @@ Gem::Specification.new do |s|
170
170
  "spec/javascripts/templates/mercury/palette.html",
171
171
  "spec/javascripts/templates/mercury/panel.html",
172
172
  "spec/javascripts/templates/mercury/region.html",
173
+ "spec/javascripts/templates/mercury/regions/editable.html",
173
174
  "spec/javascripts/templates/mercury/regions/snippetable.html",
174
175
  "spec/javascripts/templates/mercury/select.html",
175
176
  "spec/javascripts/templates/mercury/snippet.html",
@@ -183,12 +184,8 @@ Gem::Specification.new do |s|
183
184
  "spec/javascripts/templates/mercury/tooltip.html",
184
185
  "spec/javascripts/templates/mercury/uploader.html",
185
186
  "vendor/assets/javascripts/jquery-1.6.js",
186
- "vendor/assets/javascripts/jquery-ui-1.8.13.custom.min.js",
187
- "vendor/assets/javascripts/jquery-ui-1.8.13.sortable.custom.js",
188
- "vendor/assets/javascripts/jquery.easing.js",
189
- "vendor/assets/javascripts/jquery.json2.js",
190
- "vendor/assets/javascripts/jquery.serialize_object.js",
191
- "vendor/assets/javascripts/jquery.ujs.js",
187
+ "vendor/assets/javascripts/jquery-ui-1.8.13.custom.js",
188
+ "vendor/assets/javascripts/jquery.additions.js",
192
189
  "vendor/assets/javascripts/liquidmetal.js",
193
190
  "vendor/assets/javascripts/showdown.js"
194
191
  ]
@@ -203,47 +200,47 @@ Gem::Specification.new do |s|
203
200
 
204
201
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
205
202
  s.add_runtime_dependency(%q<rails>, ["= 3.1.0.rc4"])
206
- s.add_runtime_dependency(%q<jeweler>, [">= 0"])
207
- s.add_runtime_dependency(%q<sqlite3>, [">= 0"])
208
203
  s.add_runtime_dependency(%q<paperclip>, [">= 0"])
209
204
  s.add_runtime_dependency(%q<formtastic>, [">= 0"])
210
205
  s.add_runtime_dependency(%q<json>, [">= 0"])
211
206
  s.add_runtime_dependency(%q<sass-rails>, ["~> 3.1.0.rc"])
212
207
  s.add_runtime_dependency(%q<coffee-script>, [">= 0"])
213
- s.add_runtime_dependency(%q<uglifier>, [">= 0"])
214
208
  s.add_runtime_dependency(%q<haml>, [">= 0"])
215
- s.add_runtime_dependency(%q<jquery-rails>, [">= 0"])
209
+ s.add_development_dependency(%q<uglifier>, [">= 0"])
210
+ s.add_development_dependency(%q<jquery-rails>, [">= 0"])
211
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
212
+ s.add_development_dependency(%q<sqlite3>, [">= 0"])
216
213
  s.add_development_dependency(%q<thin>, [">= 0"])
217
214
  s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
218
215
  s.add_development_dependency(%q<evergreen>, [">= 0"])
219
216
  else
220
217
  s.add_dependency(%q<rails>, ["= 3.1.0.rc4"])
221
- s.add_dependency(%q<jeweler>, [">= 0"])
222
- s.add_dependency(%q<sqlite3>, [">= 0"])
223
218
  s.add_dependency(%q<paperclip>, [">= 0"])
224
219
  s.add_dependency(%q<formtastic>, [">= 0"])
225
220
  s.add_dependency(%q<json>, [">= 0"])
226
221
  s.add_dependency(%q<sass-rails>, ["~> 3.1.0.rc"])
227
222
  s.add_dependency(%q<coffee-script>, [">= 0"])
228
- s.add_dependency(%q<uglifier>, [">= 0"])
229
223
  s.add_dependency(%q<haml>, [">= 0"])
224
+ s.add_dependency(%q<uglifier>, [">= 0"])
230
225
  s.add_dependency(%q<jquery-rails>, [">= 0"])
226
+ s.add_dependency(%q<jeweler>, [">= 0"])
227
+ s.add_dependency(%q<sqlite3>, [">= 0"])
231
228
  s.add_dependency(%q<thin>, [">= 0"])
232
229
  s.add_dependency(%q<ruby-debug19>, [">= 0"])
233
230
  s.add_dependency(%q<evergreen>, [">= 0"])
234
231
  end
235
232
  else
236
233
  s.add_dependency(%q<rails>, ["= 3.1.0.rc4"])
237
- s.add_dependency(%q<jeweler>, [">= 0"])
238
- s.add_dependency(%q<sqlite3>, [">= 0"])
239
234
  s.add_dependency(%q<paperclip>, [">= 0"])
240
235
  s.add_dependency(%q<formtastic>, [">= 0"])
241
236
  s.add_dependency(%q<json>, [">= 0"])
242
237
  s.add_dependency(%q<sass-rails>, ["~> 3.1.0.rc"])
243
238
  s.add_dependency(%q<coffee-script>, [">= 0"])
244
- s.add_dependency(%q<uglifier>, [">= 0"])
245
239
  s.add_dependency(%q<haml>, [">= 0"])
240
+ s.add_dependency(%q<uglifier>, [">= 0"])
246
241
  s.add_dependency(%q<jquery-rails>, [">= 0"])
242
+ s.add_dependency(%q<jeweler>, [">= 0"])
243
+ s.add_dependency(%q<sqlite3>, [">= 0"])
247
244
  s.add_dependency(%q<thin>, [">= 0"])
248
245
  s.add_dependency(%q<ruby-debug19>, [">= 0"])
249
246
  s.add_dependency(%q<evergreen>, [">= 0"])
@@ -1,12 +1,12 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.dialogHandlers.backcolor", ->
3
+ describe "Mercury.dialogHandlers.backColor", ->
4
4
 
5
5
  template 'mercury/dialogs/backcolor.html'
6
6
 
7
7
  beforeEach ->
8
8
  @dialog = {element: $('#test'), button: $('#button')}
9
- Mercury.dialogHandlers.backcolor.call(@dialog)
9
+ Mercury.dialogHandlers.backColor.call(@dialog)
10
10
 
11
11
  describe "when a .picker or .last-picked element is clicked", ->
12
12
 
@@ -28,7 +28,7 @@ describe "Mercury.dialogHandlers.backcolor", ->
28
28
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
29
29
  jasmine.simulate.click($('#white').get(0))
30
30
  expect(spy.callCount).toEqual(1)
31
- expect(spy.argsForCall[0]).toEqual(['action', {action: 'backcolor', value: 'rgb(255, 255, 255)'}])
31
+ expect(spy.argsForCall[0]).toEqual(['action', {action: 'backColor', value: 'rgb(255, 255, 255)'}])
32
32
 
33
33
 
34
34
  describe "when any other element is clicked", ->
@@ -1,12 +1,12 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.dialogHandlers.forecolor", ->
3
+ describe "Mercury.dialogHandlers.foreColor", ->
4
4
 
5
5
  template 'mercury/dialogs/forecolor.html'
6
6
 
7
7
  beforeEach ->
8
8
  @dialog = {element: $('#test'), button: $('#button')}
9
- Mercury.dialogHandlers.forecolor.call(@dialog)
9
+ Mercury.dialogHandlers.foreColor.call(@dialog)
10
10
 
11
11
  describe "when a .picker or .last-picked element is clicked", ->
12
12
 
@@ -28,7 +28,7 @@ describe "Mercury.dialogHandlers.forecolor", ->
28
28
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
29
29
  jasmine.simulate.click($('#white').get(0))
30
30
  expect(spy.callCount).toEqual(1)
31
- expect(spy.argsForCall[0]).toEqual(['action', {action: 'forecolor', value: 'rgb(255, 255, 255)'}])
31
+ expect(spy.argsForCall[0]).toEqual(['action', {action: 'foreColor', value: 'rgb(255, 255, 255)'}])
32
32
 
33
33
 
34
34
  describe "when any other element is clicked", ->
@@ -1,12 +1,12 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.dialogHandlers.backcolor", ->
3
+ describe "Mercury.dialogHandlers.backColor", ->
4
4
 
5
5
  template 'mercury/dialogs/objectspanel.html'
6
6
 
7
7
  beforeEach ->
8
8
  @dialog = {element: $('#test'), button: $('#button')}
9
- Mercury.dialogHandlers.objectspanel.call(@dialog)
9
+ Mercury.dialogHandlers.objectsPanel.call(@dialog)
10
10
 
11
11
  describe "filter", ->
12
12
 
@@ -29,4 +29,4 @@ describe "Mercury.dialogHandlers.backcolor", ->
29
29
 
30
30
  describe "dragging an image with a data-snippet attribute", ->
31
31
 
32
- it "sets the active snippet", ->
32
+ it "sets the active snippet", ->
@@ -1,6 +1,6 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.modalHandlers.htmleditor", ->
3
+ describe "Mercury.modalHandlers.htmlEditor", ->
4
4
 
5
5
  template 'mercury/modals/htmleditor.html'
6
6
 
@@ -9,8 +9,8 @@ describe "Mercury.modalHandlers.htmleditor", ->
9
9
  element: $('#test')
10
10
  hide: ->
11
11
  Mercury.region =
12
- html: -> '<span>html \ncontent</span>'
13
- Mercury.modalHandlers.htmleditor.call(@modal)
12
+ content: -> '<span>html \ncontent</span>'
13
+ Mercury.modalHandlers.htmlEditor.call(@modal)
14
14
 
15
15
  describe "loading", ->
16
16
 
@@ -29,4 +29,4 @@ describe "Mercury.modalHandlers.htmleditor", ->
29
29
  it "hides the modal", ->
30
30
  spy = spyOn(@modal, 'hide').andCallFake(=>)
31
31
  jasmine.simulate.click($('#submit').get(0))
32
- expect(spy.callCount).toEqual(1)
32
+ expect(spy.callCount).toEqual(1)
@@ -1,6 +1,6 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.modalHandlers.insertcharacter", ->
3
+ describe "Mercury.modalHandlers.insertCharacter", ->
4
4
 
5
5
  template 'mercury/modals/insertcharacter.html'
6
6
 
@@ -8,7 +8,7 @@ describe "Mercury.modalHandlers.insertcharacter", ->
8
8
  @modal =
9
9
  element: $('#test')
10
10
  @modalHideSpy = spyOn(Mercury.modal, 'hide').andCallFake(=>)
11
- Mercury.modalHandlers.insertcharacter.call(@modal)
11
+ Mercury.modalHandlers.insertCharacter.call(@modal)
12
12
 
13
13
  describe "clicking on a character", ->
14
14
 
@@ -1,6 +1,6 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.modalHandlers.insertlink", ->
3
+ describe "Mercury.modalHandlers.insertLink", ->
4
4
 
5
5
  template 'mercury/modals/insertlink.html'
6
6
 
@@ -15,7 +15,7 @@ describe "Mercury.modalHandlers.insertlink", ->
15
15
  describe "initializing", ->
16
16
 
17
17
  beforeEach ->
18
- Mercury.modalHandlers.insertlink.call(@modal)
18
+ Mercury.modalHandlers.insertLink.call(@modal)
19
19
 
20
20
  it "loads all links with a name into the existing bookmarks pulldown", ->
21
21
  options = $('#link_existing_bookmark').html()
@@ -27,7 +27,7 @@ describe "Mercury.modalHandlers.insertlink", ->
27
27
  describe "clicking on a radio button (in a label)", ->
28
28
 
29
29
  beforeEach ->
30
- Mercury.modalHandlers.insertlink.call(@modal)
30
+ Mercury.modalHandlers.insertLink.call(@modal)
31
31
 
32
32
  it "focuses the next input with a selectable class", ->
33
33
  spy = spyOn($.fn, 'focus').andCallFake(=>)
@@ -38,7 +38,7 @@ describe "Mercury.modalHandlers.insertlink", ->
38
38
  describe "focusing an input", ->
39
39
 
40
40
  beforeEach ->
41
- Mercury.modalHandlers.insertlink.call(@modal)
41
+ Mercury.modalHandlers.insertLink.call(@modal)
42
42
 
43
43
  it "checks the corresponding checkbox", ->
44
44
  $('#link_existing_bookmark').focus()
@@ -57,7 +57,7 @@ describe "Mercury.modalHandlers.insertlink", ->
57
57
 
58
58
  beforeEach ->
59
59
  Mercury.region = selection: => {commonAncestor: -> $('<a>', {href: 'http://cnn.com', target: '_top'}).html('foo')}
60
- Mercury.modalHandlers.insertlink.call(@modal)
60
+ Mercury.modalHandlers.insertLink.call(@modal)
61
61
 
62
62
  it "hides the link text input", ->
63
63
  expect($('#link_text_container').css('display')).toEqual('none')
@@ -72,7 +72,7 @@ describe "Mercury.modalHandlers.insertlink", ->
72
72
 
73
73
  beforeEach ->
74
74
  Mercury.region = selection: => {commonAncestor: -> $('<a>', {href: "javascript:void(window.open('http://cnn.com', 'popup_window', 'width=100,height=42,menubar=no,toolbar=no'))"}).html('foo')}
75
- Mercury.modalHandlers.insertlink.call(@modal)
75
+ Mercury.modalHandlers.insertLink.call(@modal)
76
76
 
77
77
  it "hides the link text input", ->
78
78
  expect($('#link_text_container').css('display')).toEqual('none')
@@ -91,7 +91,7 @@ describe "Mercury.modalHandlers.insertlink", ->
91
91
 
92
92
  beforeEach ->
93
93
  Mercury.region = selection: => {commonAncestor: -> $('<a>', {href: '#link2'}).html('foo')}
94
- Mercury.modalHandlers.insertlink.call(@modal)
94
+ Mercury.modalHandlers.insertLink.call(@modal)
95
95
 
96
96
  it "hides the link text input", ->
97
97
  expect($('#link_text_container').css('display')).toEqual('none')
@@ -106,7 +106,7 @@ describe "Mercury.modalHandlers.insertlink", ->
106
106
 
107
107
  beforeEach ->
108
108
  Mercury.region = selection: => {commonAncestor: -> $('<a>', {name: 'link3'}).html('foo')}
109
- Mercury.modalHandlers.insertlink.call(@modal)
109
+ Mercury.modalHandlers.insertLink.call(@modal)
110
110
 
111
111
  it "hides the link text input", ->
112
112
  expect($('#link_text_container').css('display')).toEqual('none')
@@ -123,7 +123,7 @@ describe "Mercury.modalHandlers.insertlink", ->
123
123
  describe "a new link", ->
124
124
 
125
125
  beforeEach ->
126
- Mercury.modalHandlers.insertlink.call(@modal)
126
+ Mercury.modalHandlers.insertLink.call(@modal)
127
127
  @triggerSpy = spyOn(Mercury, 'trigger').andCallFake(=>)
128
128
  $('#link_text').val('foo')
129
129
 
@@ -191,7 +191,7 @@ describe "Mercury.modalHandlers.insertlink", ->
191
191
  beforeEach ->
192
192
  @existingLink = $('<a>', {name: 'link3'}).html('foo')
193
193
  Mercury.region = selection: => {commonAncestor: => @existingLink}
194
- Mercury.modalHandlers.insertlink.call(@modal)
194
+ Mercury.modalHandlers.insertLink.call(@modal)
195
195
  @triggerSpy = spyOn(Mercury, 'trigger').andCallFake(=>)
196
196
  $('#link_text').val('foo')
197
197
 
@@ -1,6 +1,6 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.modalHandlers.insertmedia", ->
3
+ describe "Mercury.modalHandlers.insertMedia", ->
4
4
 
5
5
  template 'mercury/modals/insertmedia.html'
6
6
 
@@ -14,7 +14,7 @@ describe "Mercury.modalHandlers.insertmedia", ->
14
14
  describe "clicking on a radio button (in a label)", ->
15
15
 
16
16
  beforeEach ->
17
- Mercury.modalHandlers.insertmedia.call(@modal)
17
+ Mercury.modalHandlers.insertMedia.call(@modal)
18
18
 
19
19
  it "focuses the next input with a selectable class", ->
20
20
  spy = spyOn($.fn, 'focus').andCallFake(=>)
@@ -24,7 +24,7 @@ describe "Mercury.modalHandlers.insertmedia", ->
24
24
  describe "focusing an input", ->
25
25
 
26
26
  beforeEach ->
27
- Mercury.modalHandlers.insertmedia.call(@modal)
27
+ Mercury.modalHandlers.insertMedia.call(@modal)
28
28
 
29
29
  it "checks the corresponding checkbox", ->
30
30
  $('#media_youtube_url').focus()
@@ -53,7 +53,7 @@ describe "Mercury.modalHandlers.insertmedia", ->
53
53
  @focusSpy = spyOn($.fn, 'focus').andCallThrough()
54
54
  @selection = {is: -> $('<img>', {src: '/foo.gif', align: 'right'})}
55
55
  Mercury.region = selection: => @selection
56
- Mercury.modalHandlers.insertmedia.call(@modal)
56
+ Mercury.modalHandlers.insertMedia.call(@modal)
57
57
 
58
58
  it "pre-fills the image url", ->
59
59
  expect($('#media_image_url').val()).toEqual('/foo.gif')
@@ -71,7 +71,7 @@ describe "Mercury.modalHandlers.insertmedia", ->
71
71
  @focusSpy = spyOn($.fn, 'focus').andCallThrough()
72
72
  @selection = {is: -> $('<iframe>', {src: 'http://www.youtube.com/embed/foo?wmode=transparent', style: 'width:100px;height:42px'})}
73
73
  Mercury.region = selection: => @selection
74
- Mercury.modalHandlers.insertmedia.call(@modal)
74
+ Mercury.modalHandlers.insertMedia.call(@modal)
75
75
 
76
76
  it "pre-fills the url", ->
77
77
  expect($('#media_youtube_url').val()).toEqual('http://youtu.be/foo')
@@ -91,7 +91,7 @@ describe "Mercury.modalHandlers.insertmedia", ->
91
91
  @focusSpy = spyOn($.fn, 'focus').andCallThrough()
92
92
  @selection = {is: -> $('<iframe>', {src: 'http://player.vimeo.com/video/foo?title=1&byline=1&portrait=0&color=ffffff', style: 'width:100px;height:42px'})}
93
93
  Mercury.region = selection: => @selection
94
- Mercury.modalHandlers.insertmedia.call(@modal)
94
+ Mercury.modalHandlers.insertMedia.call(@modal)
95
95
 
96
96
  it "pre-fills the url", ->
97
97
  expect($('#media_vimeo_url').val()).toEqual('http://vimeo.com/foo')
@@ -109,7 +109,7 @@ describe "Mercury.modalHandlers.insertmedia", ->
109
109
  describe "submitting", ->
110
110
 
111
111
  beforeEach ->
112
- Mercury.modalHandlers.insertmedia.call(@modal)
112
+ Mercury.modalHandlers.insertMedia.call(@modal)
113
113
  @triggerSpy = spyOn(Mercury, 'trigger').andCallFake(=>)
114
114
 
115
115
  it "hides the modal", ->
@@ -1,6 +1,6 @@
1
1
  require '/assets/mercury/mercury.js'
2
2
 
3
- describe "Mercury.modalHandlers.insertsnippet", ->
3
+ describe "Mercury.modalHandlers.insertSnippet", ->
4
4
 
5
5
  template 'mercury/modals/insertsnippet.html'
6
6
 
@@ -13,7 +13,7 @@ describe "Mercury.modalHandlers.insertsnippet", ->
13
13
  element: $('#test')
14
14
  hide: ->
15
15
  options: {snippetName: 'test'}
16
- Mercury.modalHandlers.insertsnippet.call(@modal)
16
+ Mercury.modalHandlers.insertSnippet.call(@modal)
17
17
 
18
18
  describe "submitting", ->
19
19
 
@@ -37,7 +37,7 @@ describe "Mercury.modalHandlers.insertsnippet", ->
37
37
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
38
38
  jasmine.simulate.click($('#submit').get(0))
39
39
  expect(spy.callCount).toEqual(1)
40
- expect(spy.argsForCall[0]).toEqual(['action', {action: 'insertsnippet', value: Mercury.Snippet.all[0]}])
40
+ expect(spy.argsForCall[0]).toEqual(['action', {action: 'insertSnippet', value: Mercury.Snippet.all[0]}])
41
41
 
42
42
  describe "if there's no active snippet", ->
43
43
 
@@ -51,4 +51,4 @@ describe "Mercury.modalHandlers.insertsnippet", ->
51
51
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
52
52
  jasmine.simulate.click($('#submit').get(0))
53
53
  expect(spy.callCount).toEqual(1)
54
- expect(spy.argsForCall[0]).toEqual(['action', {action: 'insertsnippet', value: Mercury.Snippet.all[1]}])
54
+ expect(spy.argsForCall[0]).toEqual(['action', {action: 'insertSnippet', value: Mercury.Snippet.all[1]}])