mercury-rails 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/app/assets/javascripts/mercury.js +1 -0
  2. data/app/assets/javascripts/mercury/lightview.js.coffee +26 -12
  3. data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +3 -5
  4. data/app/assets/javascripts/mercury/locales/da.locale.js.coffee +3 -5
  5. data/app/assets/javascripts/mercury/locales/de.locale.js.coffee +4 -6
  6. data/app/assets/javascripts/mercury/locales/es.locale.js.coffee +3 -5
  7. data/app/assets/javascripts/mercury/locales/example.local.js.coffee +3 -1
  8. data/app/assets/javascripts/mercury/locales/fr.locale.js.coffee +3 -5
  9. data/app/assets/javascripts/mercury/locales/it.locale.js.coffee +3 -5
  10. data/app/assets/javascripts/mercury/locales/ko.local.js.coffee +4 -6
  11. data/app/assets/javascripts/mercury/locales/nl.locale.js.coffee +3 -5
  12. data/app/assets/javascripts/mercury/locales/pt.locale.js.coffee +3 -5
  13. data/app/assets/javascripts/mercury/locales/sv.local.js.coffee +3 -5
  14. data/app/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +3 -5
  15. data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +3 -5
  16. data/app/assets/javascripts/mercury/mercury.js.coffee +1 -1
  17. data/app/assets/javascripts/mercury/modal.js.coffee +38 -23
  18. data/app/assets/javascripts/mercury/modals/htmleditor.js.coffee +1 -0
  19. data/app/assets/javascripts/mercury/modals/insertcharacter.js.coffee +1 -0
  20. data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +111 -60
  21. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +80 -35
  22. data/app/assets/javascripts/mercury/modals/insertsnippet.js.coffee +1 -0
  23. data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +59 -51
  24. data/app/assets/javascripts/mercury/page_editor.js.coffee +1 -1
  25. data/app/assets/javascripts/mercury/regions/full.coffee +1 -1
  26. data/app/assets/javascripts/mercury/regions/image.js.coffee +1 -1
  27. data/app/assets/javascripts/mercury/regions/markdown.coffee +1 -1
  28. data/app/assets/javascripts/mercury/regions/simple.js.coffee +1 -1
  29. data/app/assets/javascripts/mercury/regions/snippets.js.coffee +1 -1
  30. data/app/assets/javascripts/mercury/table_editor.js.coffee +16 -0
  31. data/app/assets/javascripts/mercury/toolbar.js.coffee +2 -2
  32. data/app/assets/stylesheets/mercury.css +0 -5
  33. data/app/assets/stylesheets/mercury/bootstrap-ish.css +1367 -0
  34. data/app/assets/stylesheets/mercury/bootstrap-overrides.css +60 -0
  35. data/app/assets/stylesheets/mercury/lightview.css +2 -52
  36. data/app/assets/stylesheets/mercury/mercury.css +2 -2
  37. data/app/assets/stylesheets/mercury/modal.css +13 -31
  38. data/app/assets/stylesheets/mercury/uploader.css +3 -3
  39. data/app/views/mercury/modals/htmleditor.html +2 -6
  40. data/app/views/mercury/modals/link.html +70 -64
  41. data/app/views/mercury/modals/media.html +80 -71
  42. data/app/views/mercury/modals/table.html +79 -73
  43. data/app/views/mercury/snippets/example/options.html.erb +11 -30
  44. data/features/loading/loading.feature +1 -1
  45. data/features/regions/full/inserting_links.feature +4 -4
  46. data/features/regions/full/inserting_media.feature +3 -3
  47. data/features/step_definitions/mercury_steps.rb +5 -5
  48. data/features/support/env.rb +1 -1
  49. data/lib/mercury/version.rb +1 -1
  50. data/spec/javascripts/mercury/lightview_spec.js.coffee +136 -129
  51. data/spec/javascripts/mercury/modal_spec.js.coffee +143 -139
  52. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +105 -31
  53. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +76 -38
  54. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +32 -35
  55. data/spec/javascripts/mercury/toolbar_spec.js.coffee +8 -0
  56. data/spec/javascripts/templates/mercury/modals/insertlink.html +58 -21
  57. data/spec/javascripts/templates/mercury/modals/insertmedia.html +69 -27
  58. data/spec/javascripts/templates/mercury/modals/inserttable.html +66 -20
  59. metadata +5 -5
  60. data/app/assets/stylesheets/mercury/buttons.css +0 -73
  61. data/app/assets/stylesheets/mercury/form.css +0 -125
@@ -6,26 +6,27 @@ describe "Mercury.modalHandlers.insertTable", ->
6
6
  @modal =
7
7
  element: $('#test')
8
8
  hide: ->
9
+ @insertTable = $.extend(@modal, Mercury.modalHandlers.insertTable)
9
10
 
10
11
  describe "initializing", ->
11
12
 
12
13
  beforeEach ->
13
14
  @tableEditorSpy = spyOn(Mercury, 'tableEditor').andCallFake(=>)
14
- Mercury.modalHandlers.insertTable.call(@modal)
15
+ @insertTable.initialize()
15
16
 
16
17
  it "selects the first cell", ->
17
18
  expect($('#cell1').hasClass('selected')).toEqual(true)
18
19
 
19
20
  it "sets the table editor up", ->
20
21
  expect(@tableEditorSpy.callCount).toEqual(1)
21
- expect(@tableEditorSpy.argsForCall[0][0].get(0)).toEqual($('#table').get(0))
22
+ expect(@tableEditorSpy.argsForCall[0][0].get(0)).toEqual($('table').get(0))
22
23
  expect(@tableEditorSpy.argsForCall[0][1].get(0)).toEqual($('#cell1').get(0))
23
24
 
24
25
  describe "clicking on the cells", ->
25
26
 
26
27
  beforeEach ->
27
28
  @tableEditorSpy = spyOn(Mercury, 'tableEditor').andCallFake(=>)
28
- Mercury.modalHandlers.insertTable.call(@modal)
29
+ @insertTable.initialize()
29
30
 
30
31
  it "should unselect any selected cells", ->
31
32
  jasmine.simulate.click($('#cell2').get(0))
@@ -44,58 +45,56 @@ describe "Mercury.modalHandlers.insertTable", ->
44
45
  describe "clicking on the action buttons", ->
45
46
 
46
47
  beforeEach ->
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(=>)
48
+ @addRowBeforeSpy = spyOn(Mercury.tableEditor, 'addRowBefore').andCallFake(=>)
49
+ @addRowSpy = spyOn(Mercury.tableEditor, 'addRow').andCallFake(=>)
50
+ @removeRowSpy = spyOn(Mercury.tableEditor, 'removeRow').andCallFake(=>)
51
+ @addColumnBeforeSpy = spyOn(Mercury.tableEditor, 'addColumnBefore').andCallFake(=>)
52
+ @addColumnSpy = spyOn(Mercury.tableEditor, 'addColumn').andCallFake(=>)
53
+ @removeColumnSpy = spyOn(Mercury.tableEditor, 'removeColumn').andCallFake(=>)
51
54
  @increaseColspanSpy = spyOn(Mercury.tableEditor, 'increaseColspan').andCallFake(=>)
52
55
  @decreaseColspanSpy = spyOn(Mercury.tableEditor, 'decreaseColspan').andCallFake(=>)
53
56
  @increaseRowspanSpy = spyOn(Mercury.tableEditor, 'increaseRowspan').andCallFake(=>)
54
57
  @decreaseRowspanSpy = spyOn(Mercury.tableEditor, 'decreaseRowspan').andCallFake(=>)
55
- Mercury.modalHandlers.insertTable.call(@modal)
58
+ @insertTable.initialize()
56
59
 
57
60
  it "adds a row before the selected cell", ->
58
- jasmine.simulate.click($('input[name=insertRowBefore]').get(0))
59
- expect(@addRowSpy.callCount).toEqual(1)
60
- expect(@addRowSpy.argsForCall[0]).toEqual(['before'])
61
+ jasmine.simulate.click($('[data-action=addRowBefore]').get(0))
62
+ expect(@addRowBeforeSpy.callCount).toEqual(1)
61
63
 
62
64
  it "adds a row after the selected cell", ->
63
- jasmine.simulate.click($('input[name=insertRowAfter]').get(0))
65
+ jasmine.simulate.click($('[data-action=addRow]').get(0))
64
66
  expect(@addRowSpy.callCount).toEqual(1)
65
- expect(@addRowSpy.argsForCall[0]).toEqual(['after'])
66
67
 
67
68
  it "deletes the row of the selected cell", ->
68
- jasmine.simulate.click($('input[name=deleteRow]').get(0))
69
+ jasmine.simulate.click($('[data-action=removeRow]').get(0))
69
70
  expect(@removeRowSpy.callCount).toEqual(1)
70
71
 
71
72
  it "adds a column before the selected cell", ->
72
- jasmine.simulate.click($('input[name=insertColumnBefore]').get(0))
73
- expect(@addColumnSpy.callCount).toEqual(1)
74
- expect(@addColumnSpy.argsForCall[0]).toEqual(['before'])
73
+ jasmine.simulate.click($('[data-action=addColumnBefore]').get(0))
74
+ expect(@addColumnBeforeSpy.callCount).toEqual(1)
75
75
 
76
76
  it "adds a column after the selected cell", ->
77
- jasmine.simulate.click($('input[name=insertColumnAfter]').get(0))
77
+ jasmine.simulate.click($('[data-action=addColumn]').get(0))
78
78
  expect(@addColumnSpy.callCount).toEqual(1)
79
- expect(@addColumnSpy.argsForCall[0]).toEqual(['after'])
80
79
 
81
80
  it "deletes the column of the selected cell", ->
82
- jasmine.simulate.click($('input[name=deleteColumn]').get(0))
81
+ jasmine.simulate.click($('[data-action=removeColumn]').get(0))
83
82
  expect(@removeColumnSpy.callCount).toEqual(1)
84
83
 
85
84
  it "increases the colspan of the selected cell", ->
86
- jasmine.simulate.click($('input[name=increaseColspan]').get(0))
85
+ jasmine.simulate.click($('[data-action=increaseColspan]').get(0))
87
86
  expect(@increaseColspanSpy.callCount).toEqual(1)
88
87
 
89
88
  it "decreases the colspan of the selected cell", ->
90
- jasmine.simulate.click($('input[name=decreaseColspan]').get(0))
89
+ jasmine.simulate.click($('[data-action=decreaseColspan]').get(0))
91
90
  expect(@decreaseColspanSpy.callCount).toEqual(1)
92
91
 
93
92
  it "increases the rowspan of the selected cell", ->
94
- jasmine.simulate.click($('input[name=increaseRowspan]').get(0))
93
+ jasmine.simulate.click($('[data-action=increaseRowspan]').get(0))
95
94
  expect(@increaseRowspanSpy.callCount).toEqual(1)
96
95
 
97
96
  it "decreases the rowspan of the selected cell", ->
98
- jasmine.simulate.click($('input[name=decreaseRowspan]').get(0))
97
+ jasmine.simulate.click($('[data-action=decreaseRowspan]').get(0))
99
98
  expect(@decreaseRowspanSpy.callCount).toEqual(1)
100
99
 
101
100
 
@@ -107,43 +106,43 @@ describe "Mercury.modalHandlers.insertTable", ->
107
106
  describe "changing the border", ->
108
107
 
109
108
  beforeEach ->
110
- Mercury.modalHandlers.insertTable.call(@modal)
109
+ @insertTable.initialize()
111
110
 
112
111
  it "changes the border of the table", ->
113
112
  $('#table_border').val('19')
114
113
  jasmine.simulate.keyup($('#table_border').get(0))
115
- expect($('#table').attr('border')).toEqual('19')
114
+ expect($('table').attr('border')).toEqual('19')
116
115
 
117
116
  it "handles non-numeric values", ->
118
117
  $('#table_border').val('2x')
119
118
  jasmine.simulate.keyup($('#table_border').get(0))
120
- expect($('#table').attr('border')).toEqual('2')
119
+ expect($('table').attr('border')).toEqual('2')
121
120
 
122
121
 
123
122
  describe "changing the cellspacing", ->
124
123
 
125
124
  beforeEach ->
126
- Mercury.modalHandlers.insertTable.call(@modal)
125
+ @insertTable.initialize()
127
126
 
128
127
  it "changes the cellspacing of the table", ->
129
128
  $('#table_spacing').val('5')
130
129
  jasmine.simulate.keyup($('#table_spacing').get(0))
131
- expect($('#table').attr('cellspacing')).toEqual('5')
130
+ expect($('table').attr('cellspacing')).toEqual('5')
132
131
 
133
132
  it "handles non-numeric values", ->
134
133
  $('#table_spacing').val('12x')
135
134
  jasmine.simulate.keyup($('#table_spacing').get(0))
136
- expect($('#table').attr('cellspacing')).toEqual('12')
135
+ expect($('table').attr('cellspacing')).toEqual('12')
137
136
 
138
137
 
139
138
  describe "submitting", ->
140
139
 
141
140
  beforeEach ->
142
- Mercury.modalHandlers.insertTable.call(@modal)
141
+ @insertTable.initialize()
143
142
 
144
143
  it "triggers an action", ->
145
144
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
146
- jasmine.simulate.click($('#submit').get(0))
145
+ jasmine.simulate.click($('input[type=submit]').get(0))
147
146
  expect(spy.callCount).toEqual(1)
148
147
  expect(spy.argsForCall[0][0]).toEqual('action')
149
148
  expect(spy.argsForCall[0][1]['action']).toEqual('insertTable')
@@ -154,7 +153,5 @@ describe "Mercury.modalHandlers.insertTable", ->
154
153
 
155
154
  it "hides the modal", ->
156
155
  spy = spyOn(@modal, 'hide').andCallFake(=>)
157
- jasmine.simulate.click($('#submit').get(0))
156
+ jasmine.simulate.click($('input[type=submit]').get(0))
158
157
  expect(spy.callCount).toEqual(1)
159
-
160
-
@@ -180,6 +180,14 @@ describe "Mercury.Toolbar", ->
180
180
  it "returns 0", ->
181
181
  expect(@toolbar.height()).toEqual(0)
182
182
 
183
+ describe "when forced", ->
184
+
185
+ beforeEach ->
186
+ @toolbar = new Mercury.Toolbar({appendTo: '#test', visible: false})
187
+
188
+ it "returns the element outerheight", ->
189
+ expect(@toolbar.height(true)).toEqual($('.mercury-toolbar-container').outerHeight())
190
+
183
191
 
184
192
  describe "#show", ->
185
193
 
@@ -1,30 +1,67 @@
1
1
  <form>
2
- <fieldset id="link_text_container">
3
- <input id="link_text" name="link[text]" type="text"/>
4
- </fieldset>
5
2
 
6
- <label for="link_external_url"><input id="checkbox1" name="link_type" type="radio" value="external_url" checked="checked"/>URL</label>
7
- <input class="selectable" id="link_external_url" name="link[external_url]" type="text"/>
8
-
9
- <label for="link_existing_bookmark"><input id="checkbox2" name="link_type" type="radio" value="existing_bookmark"/>Existing Links</label>
10
- <select class="selectable" id="link_existing_bookmark" name="link[existing_bookmark]"></select>
3
+ <div id="link_text_container" class="control-group string optional">
4
+ <label class="string optional control-label" for="link_text">Link Content</label>
5
+ <div class="controls">
6
+ <input class="string optional" id="link_text" name="link[text]" size="50" type="text">
7
+ </div>
8
+ </div>
11
9
 
12
- <label for="link_new_bookmark"><input name="link_type" type="radio" value="new_bookmark"/>Bookmark</label>
13
- <input class="selectable" id="link_new_bookmark" name="link[new_bookmark]" type="text"/>
10
+ <div class="control-group url optional">
11
+ <label class="url optional control-label" for="link_external_url">
12
+ <input name="link_type" type="radio" value="external_url" checked="checked"/>URL
13
+ </label>
14
+ <div class="controls">
15
+ <input class="string url optional" id="link_external_url" name="link[external_url]" size="50" type="text">
16
+ </div>
17
+ </div>
14
18
 
15
- <select id="link_target" name="link[target]">
16
- <option value="">Self (the same window or tab)</option>
17
- <option value="_blank">Blank (a new window or tab)</option>
18
- <option value="_top">Top (removes any frames)</option>
19
- <option value="popup">Popup Window (javascript new window popup)</option>
20
- </select>
19
+ <div class="control-group select optional">
20
+ <label class="select optional control-label" for="link_existing_bookmark">
21
+ <input name="link_type" type="radio" value="existing_bookmark"/>Existing Links
22
+ </label>
23
+ <div class="controls">
24
+ <select class="select optional" id="link_existing_bookmark" name="link[existing_bookmark]"></select>
25
+ </div>
26
+ </div>
27
+ <div class="control-group string optional">
28
+ <label class="string optional control-label" for="link_new_bookmark">
29
+ <input name="link_type" type="radio" value="new_bookmark"/>Bookmark
30
+ </label>
31
+ <div class="controls">
32
+ <input class="string optional" id="link_new_bookmark" name="link[new_bookmark]" size="50" type="text">
33
+ </div>
34
+ </div>
21
35
 
22
- <div class="link-target-options" id="popup_options" style="display:none">
23
- <input id="link_popup_width" name="link[popup_width]" type="text"/>
24
- <input id="link_popup_height" name="link[popup_height]" type="text"/>
36
+ <div class="control-group select optional">
37
+ <label class="select optional control-label" for="link_target">Link Target</label>
38
+ <div class="controls">
39
+ <select class="select optional" id="link_target" name="link[target]">
40
+ <option value="">Self (the same window or tab)</option>
41
+ <option value="_blank">Blank (a new window or tab)</option>
42
+ <option value="_top">Top (removes any frames)</option>
43
+ <option value="popup">Popup Window (javascript new window popup)</option>
44
+ </select>
45
+ </div>
46
+ </div>
47
+ <div id="popup_options" class="link-target-options" style="display:none">
48
+ <div class="control-group number optional">
49
+ <label class="number optional control-label" for="link_popup_width">Popup Width</label>
50
+ <div class="controls">
51
+ <input class="number optional" id="link_popup_width" name="link[popup_width]" size="50" type="number">
52
+ </div>
53
+ </div>
54
+ <div class="control-group number optional">
55
+ <label class="number optional control-label" for="link_popup_height">Popup Height</label>
56
+ <div class="controls">
57
+ <input class="number optional" id="link_popup_height" name="link[popup_height]" size="50" type="number">
58
+ </div>
59
+ </div>
25
60
  </div>
26
61
 
27
- <input id="submit" type="submit"/>
62
+ <input name="commit" type="submit" value="Insert Link">
63
+
28
64
  </form>
65
+
29
66
  <a name="link1">Link One</a>
30
- <a name="link2">Link Two</a>
67
+ <a name="link2">Link Two</a>
@@ -1,35 +1,77 @@
1
1
  <form>
2
- <label for="media_image_url"><input id="checkbox1" name="media_type" type="radio" value="image_url" checked="checked"/>URL</label>
3
- <input class="selectable" id="media_image_url" name="media[image_url]" type="text"/>
4
2
 
5
- <label for="media_youtube_url"><input id="checkbox2" name="media_type" type="radio" value="youtube_url"/>YouTube Share URL</label>
6
- <input class="selectable" id="media_youtube_url" name="media[youtube_url]" type="text"/>
7
-
8
- <label for="media_vimeo_url"><input name="media_type" type="radio" value="vimeo_url"/>Vimeo URL</label>
9
- <input class="selectable" id="media_vimeo_url" name="media[vimeo_url]" type="text"/>
10
-
11
- <div class="media-options" id="image_url">
12
- <select id="media_image_alignment" name="media[image_alignment]">
13
- <option value="">None</option>
14
- <option value="left">Left</option>
15
- <option value="right">Right</option>
16
- <option value="top">Top</option>
17
- <option value="middle">Middle</option>
18
- <option value="bottom">Bottom</option>
19
- <option value="absmiddle">Absolute Middle</option>
20
- <option value="absbottom">Absolute Bottom</option>
21
- </select>
3
+ <div class="control-group url optional">
4
+ <label class="url optional control-label" for="media_image_url">
5
+ <input name="media_type" type="radio" value="image_url" checked="checked"/>URL
6
+ </label>
7
+ <div class="controls">
8
+ <input class="string url optional" id="media_image_url" name="media[image_url]" size="50" type="text">
9
+ </div>
22
10
  </div>
23
11
 
24
- <div class="media-options" id="youtube_url" style="display:none">
25
- <input id="media_youtube_width" name="media[youtube_width]" type="text" value="560"/>
26
- <input id="media_youtube_height" name="media[youtube_height]" type="text" value="349"/>
12
+ <div class="control-group url optional">
13
+ <label class="url optional control-label" for="media_youtube_url">
14
+ <input name="media_type" type="radio" value="youtube_url"/>Youtube Share URL
15
+ </label>
16
+ <div class="controls">
17
+ <input class="string url optional" id="media_youtube_url" name="media[youtube_url]" size="50" type="text" placeholder="http://youtu.be/Pny4hoN8eII">
18
+ </div>
19
+ </div>
20
+ <div class="control-group url optional">
21
+ <label class="url optional control-label" for="media_vimeo_url">
22
+ <input name="media_type" type="radio" value="vimeo_url"/>Vimeo URL
23
+ </label>
24
+ <div class="controls">
25
+ <input class="string url optional" id="media_vimeo_url" name="media[vimeo_url]" size="50" type="text" placeholder="http://vimeo.com/25708134">
26
+ </div>
27
27
  </div>
28
28
 
29
- <div class="media-options" id="vimeo_url" style="display:none">
30
- <input id="media_vimeo_width" name="media[vimeo_width]" type="text" value="400"/>
31
- <input id="media_vimeo_height" name="media[vimeo_height]" type="text" value="225"/>
29
+ <div class="media-options" id="image_url_options">
30
+ <div class="control-group select optional">
31
+ <label class="select optional control-label" for="media_image_alignment">Alignment</label>
32
+ <div class="controls">
33
+ <select class="select optional" id="media_image_alignment" name="media[image_alignment]">
34
+ <option value="">None</option>
35
+ <option value="left">Left</option>
36
+ <option value="right">Right</option>
37
+ <option value="top">Top</option>
38
+ <option value="middle">Middle</option>
39
+ <option value="bottom">Bottom</option>
40
+ <option value="absmiddle">Absolute Middle</option>
41
+ <option value="absbottom">Absolute Bottom</option>
42
+ </select>
43
+ </div>
44
+ </div>
32
45
  </div>
46
+ <div class="media-options" id="youtube_url_options" style="display:none">
47
+ <div class="control-group number optional">
48
+ <label class="number optional control-label" for="media_youtube_width">Width</label>
49
+ <div class="controls">
50
+ <input class="number optional" id="media_youtube_width" name="media[youtube_width]" size="50" type="number" value="560">
51
+ </div>
52
+ </div>
53
+ <div class="control-group number optional">
54
+ <label class="number optional control-label" for="media_youtube_height">Height</label>
55
+ <div class="controls">
56
+ <input class="number optional" id="media_youtube_height" name="media[youtube_height]" size="50" type="number" value="349">
57
+ </div>
58
+ </div>
59
+ </div>
60
+ <div class="media-options" id="vimeo_url_options" style="display:none">
61
+ <div class="control-group number optional">
62
+ <label class="number optional control-label" for="media_vimeo_width">Width</label>
63
+ <div class="controls">
64
+ <input class="number optional" id="media_vimeo_width" name="media[vimeo_width]" size="50" type="number" value="400">
65
+ </div>
66
+ </div>
67
+ <div class="control-group number optional">
68
+ <label class="number optional control-label" for="media_vimeo_height">Height</label>
69
+ <div class="controls">
70
+ <input class="number optional" id="media_vimeo_height" name="media[vimeo_height]" size="50" type="number" value="225">
71
+ </div>
72
+ </div>
73
+ </div>
74
+
75
+ <input class="submit" name="commit" type="submit" value="Insert Media"/>
33
76
 
34
- <input id="submit" type="submit"/>
35
- </form>
77
+ </form>
@@ -1,27 +1,73 @@
1
1
  <form>
2
- <div id="table_display">
3
- <table id="table" border="1" cellspacing="0"><tr><td id="cell1"></td></tr><tr><td id="cell2"></td></tr></table>
2
+
3
+ <div id="table_display" class="control-group optional">
4
+ <div class="controls">
5
+ <table border="1" cellspacing="0">
6
+ <tr>
7
+ <td id="cell1">&nbsp;</td>
8
+ </tr>
9
+ <tr>
10
+ <td id="cell2">&nbsp;</td>
11
+ </tr>
12
+ </table>
13
+ </div>
4
14
  </div>
5
15
 
6
- <input class="action" name="insertRowBefore" type="button" value="Add Before">
7
- <input class="action" name="insertRowAfter" type="button" value="Add After">
8
- <input class="action" name="deleteRow" type="button" value="Remove">
9
- <input class="action" name="insertColumnBefore" type="button" value="Add Before">
10
- <input class="action" name="insertColumnAfter" type="button" value="Add After">
11
- <input class="action" name="deleteColumn" type="button" value="Remove">
12
- <input class="action" name="increaseRowspan" type="button" value="+">
13
- <input class="action" name="decreaseRowspan" type="button" value="-">
14
- <input class="action" name="increaseColspan" type="button" value="+">
15
- <input class="action" name="decreaseColspan" type="button" value="-">
16
+ <div class="control-group buttons optional">
17
+ <label class="buttons optional control-label">Rows</label>
18
+ <div class="controls btn-group">
19
+ <button class="btn" data-action="addRowBefore">Add Before</button>
20
+ <button class="btn" data-action="addRow">Add After</button>
21
+ <button class="btn" data-action="removeRow">Remove</button>
22
+ </div>
23
+ </div>
24
+ <div class="control-group buttons optional">
25
+ <label class="buttons optional control-label">Columns</label>
26
+ <div class="controls btn-group">
27
+ <button class="btn" data-action="addColumnBefore">Add Before</button>
28
+ <button class="btn" data-action="addColumn">Add After</button>
29
+ <button class="btn" data-action="removeColumn">Remove</button>
30
+ </div>
31
+ </div>
32
+ <hr/>
33
+ <div class="control-group buttons optional">
34
+ <label class="buttons optional control-label">Row Span</label>
35
+ <div class="controls btn-group">
36
+ <button class="btn" data-action="increaseRowspan">+</button>
37
+ <button class="btn" data-action="decreaseRowspan">-</button>
38
+ </div>
39
+ </div>
40
+ <div class="control-group buttons optional">
41
+ <label class="buttons optional control-label">Column Span</label>
42
+ <div class="controls btn-group">
43
+ <button class="btn" data-action="increaseColspan">+</button>
44
+ <button class="btn" data-action="decreaseColspan">-</button>
45
+ </div>
46
+ </div>
16
47
 
17
- <select id="table_alignment" name="table[alignment]">
18
- <option value="">None</option>
19
- <option value="left">Left</option>
20
- <option value="right" id="right_option">Right</option>
21
- </select>
48
+ <div class="control-group select optional">
49
+ <label class="select optional control-label" for="table_alignment">Alignment</label>
50
+ <div class="controls">
51
+ <select class="select optional" id="table_alignment" name="table[alignment]">
52
+ <option value="">None</option>
53
+ <option value="right">Right</option>
54
+ <option value="left">Left</option>
55
+ </select>
56
+ </div>
57
+ </div>
58
+ <div class="control-group number optional">
59
+ <label class="number optional control-label" for="table_border">Border</label>
60
+ <div class="controls">
61
+ <input class="number optional" id="table_border" name="table[border]" size="50" type="number" value="1">
62
+ </div>
63
+ </div>
64
+ <div class="control-group number optional">
65
+ <label class="number optional control-label" for="table_spacing">Spacing</label>
66
+ <div class="controls">
67
+ <input class="number optional" id="table_spacing" name="table[spacing]" size="50" type="number" value="0">
68
+ </div>
69
+ </div>
22
70
 
23
- <input id="table_border" type="text" value="1"/>
24
- <input id="table_spacing" type="text" value="0"/>
71
+ <input class="submit" name="commit" type="submit" value="Insert Table"/>
25
72
 
26
- <input id="submit" type="submit"/>
27
73
  </form>