kiteditor 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. data/{lib/generators/mercury/install/images/templates → app/controllers/mercury}/images_controller.rb +0 -0
  2. data/{lib/generators/mercury/install/images/templates/ar_paperclip_image.rb → app/models/mercury/image.rb} +0 -7
  3. data/app/views/layouts/mercury.html.erb +20 -10
  4. data/app/views/mercury/modals/character.html +1 -1
  5. data/app/views/mercury/modals/htmleditor.html +7 -3
  6. data/app/views/mercury/modals/link.html +51 -37
  7. data/app/views/mercury/modals/media.html +0 -102
  8. data/app/views/mercury/modals/table.html +73 -79
  9. data/app/views/mercury/panels/snippets.html +1 -6
  10. data/app/views/mercury/snippets/example/options.html.erb +27 -23
  11. data/{lib/generators/mercury/install/images/templates/ar_paperclip_image_migration.rb → db/migrate/20110526035601_create_mercury_images.rb} +0 -0
  12. data/features/loading/loading.feature +2 -5
  13. data/features/loading/user_interface.feature +7 -9
  14. data/features/regions/{full → editable}/advanced_editing.feature +0 -0
  15. data/features/regions/editable/basic_editing.feature +195 -0
  16. data/features/regions/{full → editable}/inserting_links.feature +19 -20
  17. data/features/regions/{full → editable}/inserting_media.feature +18 -36
  18. data/features/regions/{full → editable}/inserting_snippets.feature +18 -28
  19. data/features/regions/{full → editable}/inserting_special_characters.feature +2 -2
  20. data/features/regions/editable/inserting_tables.feature +109 -0
  21. data/features/regions/{full → editable}/pasting.feature +0 -0
  22. data/features/regions/{full → editable}/uploading_images.feature +0 -0
  23. data/features/regions/{markdown → markupable}/advanced_editing.feature +0 -0
  24. data/features/regions/{markdown → markupable}/basic_editing.feature +0 -0
  25. data/features/regions/{markdown → markupable}/inserting_links.feature +0 -0
  26. data/features/regions/{markdown → markupable}/inserting_media.feature +0 -0
  27. data/features/regions/{markdown → markupable}/inserting_snippets.feature +0 -0
  28. data/features/regions/{markdown → markupable}/inserting_special_characters.feature +0 -0
  29. data/features/regions/{markdown → markupable}/inserting_tables.feature +0 -0
  30. data/features/regions/{image → markupable}/uploading_images.feature +0 -0
  31. data/features/regions/{snippets → snippetable}/advanced_editing.feature +0 -0
  32. data/features/regions/{snippets → snippetable}/basic_editing.feature +0 -0
  33. data/features/regions/{snippets → snippetable}/inserting_snippets.feature +0 -0
  34. data/features/saving/saving.feature +8 -8
  35. data/features/step_definitions/mercury_steps.rb +438 -1
  36. data/features/support/env.rb +1 -11
  37. data/{lib/mercury/cucumber → features}/support/mercury_contents.rb +3 -3
  38. data/{lib/mercury/cucumber → features}/support/mercury_selectors.rb +20 -0
  39. data/features/support/selectors.rb +0 -23
  40. data/lib/generators/mercury/install/install_generator.rb +23 -12
  41. data/lib/generators/mercury/install/{images/templates → templates}/mongoid_paperclip_image.rb +0 -0
  42. data/lib/mercury/authentication.rb +0 -1
  43. data/lib/mercury-rails.rb +2 -1
  44. data/spec/javascripts/mercury/{dialog_spec.coffee → dialog_spec.js.coffee} +12 -11
  45. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +3 -2
  46. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +4 -3
  47. data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +3 -2
  48. data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +3 -2
  49. data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +3 -2
  50. data/spec/javascripts/mercury/lightview_spec.js.coffee +142 -180
  51. data/spec/javascripts/mercury/mercury_spec.js.coffee +13 -19
  52. data/spec/javascripts/mercury/modal_spec.js.coffee +148 -192
  53. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +5 -4
  54. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +3 -2
  55. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +34 -107
  56. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +26 -106
  57. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +3 -2
  58. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +40 -50
  59. data/spec/javascripts/mercury/page_editor_spec.js.coffee +80 -124
  60. data/spec/javascripts/mercury/palette_spec.js.coffee +5 -4
  61. data/spec/javascripts/mercury/panel_spec.js.coffee +12 -9
  62. data/spec/javascripts/mercury/region_spec.js.coffee +17 -22
  63. data/spec/javascripts/mercury/regions/{full_spec.js.coffee → editable_spec.js.coffee} +28 -26
  64. data/spec/javascripts/mercury/regions/{markdown_spec.js.coffee → markupable_spec.js.coffee} +34 -32
  65. data/spec/javascripts/mercury/regions/{snippets_spec.js.coffee → snippetable_spec.js.coffee} +55 -54
  66. data/spec/javascripts/mercury/select_spec.js.coffee +5 -4
  67. data/spec/javascripts/mercury/snippet_spec.js.coffee +16 -92
  68. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +16 -31
  69. data/spec/javascripts/mercury/statusbar_spec.js.coffee +10 -9
  70. data/spec/javascripts/mercury/table_editor_spec.js.coffee +2 -1
  71. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +9 -7
  72. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +26 -55
  73. data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +13 -13
  74. data/spec/javascripts/mercury/toolbar_spec.js.coffee +14 -43
  75. data/spec/javascripts/mercury/tooltip_spec.js.coffee +2 -1
  76. data/spec/javascripts/mercury/uploader_spec.js.coffee +33 -47
  77. data/spec/javascripts/{support/event_simulation.js → spec_helper.js} +2 -0
  78. data/spec/javascripts/{fixtures → templates}/mercury/dialog.html +0 -0
  79. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/backcolor.html +0 -0
  80. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/forecolor.html +0 -0
  81. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/formatblock.html +0 -0
  82. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/snippetpanel.html +0 -0
  83. data/spec/javascripts/{fixtures → templates}/mercury/dialogs/style.html +0 -0
  84. data/spec/javascripts/{fixtures → templates}/mercury/lightview.html +0 -0
  85. data/spec/javascripts/{fixtures → templates}/mercury/modal.html +0 -0
  86. data/spec/javascripts/{fixtures → templates}/mercury/modals/htmleditor.html +0 -0
  87. data/spec/javascripts/{fixtures → templates}/mercury/modals/insertcharacter.html +0 -0
  88. data/spec/javascripts/templates/mercury/modals/insertlink.html +30 -0
  89. data/spec/javascripts/templates/mercury/modals/insertmedia.html +35 -0
  90. data/spec/javascripts/{fixtures → templates}/mercury/modals/insertsnippet.html +0 -0
  91. data/spec/javascripts/templates/mercury/modals/inserttable.html +27 -0
  92. data/spec/javascripts/{fixtures → templates}/mercury/page_editor.html +4 -4
  93. data/spec/javascripts/{fixtures → templates}/mercury/palette.html +0 -0
  94. data/spec/javascripts/{fixtures → templates}/mercury/panel.html +0 -0
  95. data/spec/javascripts/templates/mercury/region.html +2 -0
  96. data/spec/javascripts/templates/mercury/regions/editable.html +3 -0
  97. data/spec/javascripts/templates/mercury/regions/snippetable.html +4 -0
  98. data/spec/javascripts/{fixtures → templates}/mercury/select.html +0 -0
  99. data/spec/javascripts/{fixtures → templates}/mercury/snippet.html +0 -0
  100. data/spec/javascripts/{fixtures → templates}/mercury/snippet_toolbar.html +0 -0
  101. data/spec/javascripts/{fixtures → templates}/mercury/statusbar.html +0 -0
  102. data/spec/javascripts/{fixtures → templates}/mercury/table_editor.html +0 -0
  103. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.button.html +0 -0
  104. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.button_group.html +0 -0
  105. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.expander.html +0 -0
  106. data/spec/javascripts/{fixtures → templates}/mercury/toolbar.html +0 -0
  107. data/spec/javascripts/{fixtures → templates}/mercury/tooltip.html +0 -0
  108. data/spec/javascripts/{fixtures → templates}/mercury/uploader.html +0 -0
  109. data/{app → vendor}/assets/images/mercury/button.png +0 -0
  110. data/{app → vendor}/assets/images/mercury/close.png +0 -0
  111. data/{app → vendor}/assets/images/mercury/loading-dark.gif +0 -0
  112. data/{app → vendor}/assets/images/mercury/loading-light.gif +0 -0
  113. data/{app → vendor}/assets/images/mercury/missing-image.png +0 -0
  114. data/{app → vendor}/assets/images/mercury/search-icon.png +0 -0
  115. data/{app → vendor}/assets/images/mercury/temp-logo.png +0 -0
  116. data/{app/assets/javascripts → vendor/assets/javascripts/mercury/dependencies}/jquery-1.7.js +0 -0
  117. data/{app → vendor}/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +0 -0
  118. data/{app → vendor}/assets/javascripts/mercury/dependencies/jquery.additions.js +13 -103
  119. data/{app → vendor}/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +0 -0
  120. data/{app → vendor}/assets/javascripts/mercury/dependencies/liquidmetal.js +0 -0
  121. data/{app → vendor}/assets/javascripts/mercury/dependencies/showdown.js +0 -0
  122. data/{app → vendor}/assets/javascripts/mercury/dialog.js.coffee +0 -0
  123. data/{app → vendor}/assets/javascripts/mercury/dialogs/backcolor.js.coffee +0 -0
  124. data/{app → vendor}/assets/javascripts/mercury/dialogs/forecolor.js.coffee +1 -1
  125. data/{app → vendor}/assets/javascripts/mercury/dialogs/formatblock.js.coffee +0 -0
  126. data/{app → vendor}/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +1 -1
  127. data/{app → vendor}/assets/javascripts/mercury/dialogs/style.js.coffee +0 -0
  128. data/{app → vendor}/assets/javascripts/mercury/finalize.js.coffee +0 -0
  129. data/{app → vendor}/assets/javascripts/mercury/history_buffer.js.coffee +0 -0
  130. data/{app → vendor}/assets/javascripts/mercury/lightview.js.coffee +17 -38
  131. data/{features/regions/markdown/uploading_images.feature → vendor/assets/javascripts/mercury/locales/da.locale.js.coffee} +0 -0
  132. data/{app → vendor}/assets/javascripts/mercury/locales/de.locale.js.coffee +10 -4
  133. data/{app → vendor}/assets/javascripts/mercury/locales/es.locale.js.coffee +9 -3
  134. data/{app → vendor}/assets/javascripts/mercury/locales/example.local.js.coffee +5 -3
  135. data/{app → vendor}/assets/javascripts/mercury/locales/fr.locale.js.coffee +9 -3
  136. data/{app → vendor}/assets/javascripts/mercury/locales/it.locale.js.coffee +9 -3
  137. data/{app → vendor}/assets/javascripts/mercury/locales/ko.local.js.coffee +10 -4
  138. data/{app → vendor}/assets/javascripts/mercury/locales/nl.locale.js.coffee +9 -3
  139. data/{app → vendor}/assets/javascripts/mercury/locales/pt.locale.js.coffee +9 -3
  140. data/{app → vendor}/assets/javascripts/mercury/locales/sv.local.js.coffee +9 -3
  141. data/{app → vendor}/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +9 -3
  142. data/{app → vendor}/assets/javascripts/mercury/mercury.js.coffee +1 -10
  143. data/{app → vendor}/assets/javascripts/mercury/modal.js.coffee +40 -62
  144. data/{app → vendor}/assets/javascripts/mercury/modals/htmleditor.js.coffee +2 -3
  145. data/{app → vendor}/assets/javascripts/mercury/modals/insertcharacter.js.coffee +0 -1
  146. data/{app → vendor}/assets/javascripts/mercury/modals/insertsnippet.js.coffee +0 -2
  147. data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +54 -0
  148. data/{app → vendor}/assets/javascripts/mercury/native_extensions.js.coffee +6 -0
  149. data/{app → vendor}/assets/javascripts/mercury/page_editor.js.coffee +50 -84
  150. data/{app → vendor}/assets/javascripts/mercury/palette.js.coffee +1 -1
  151. data/{app → vendor}/assets/javascripts/mercury/panel.js.coffee +2 -3
  152. data/{app → vendor}/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +2 -2
  153. data/{app → vendor}/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +0 -0
  154. data/{app → vendor}/assets/javascripts/mercury/region.js.coffee +17 -18
  155. data/{app/assets/javascripts/mercury/regions/full.js.coffee → vendor/assets/javascripts/mercury/regions/editable.js.coffee} +31 -41
  156. data/{app/assets/javascripts/mercury/regions/markdown.js.coffee → vendor/assets/javascripts/mercury/regions/markupable.js.coffee} +24 -29
  157. data/{app → vendor}/assets/javascripts/mercury/regions/simple.js.coffee +54 -11
  158. data/{app/assets/javascripts/mercury/regions/snippets.js.coffee → vendor/assets/javascripts/mercury/regions/snippetable.js.coffee} +9 -10
  159. data/{app → vendor}/assets/javascripts/mercury/select.js.coffee +1 -1
  160. data/{app → vendor}/assets/javascripts/mercury/snippet_toolbar.js.coffee +6 -19
  161. data/{app → vendor}/assets/javascripts/mercury/statusbar.js.coffee +0 -0
  162. data/{app → vendor}/assets/javascripts/mercury/support/history.js +0 -0
  163. data/{app → vendor}/assets/javascripts/mercury/table_editor.js.coffee +0 -16
  164. data/{app → vendor}/assets/javascripts/mercury/toolbar.button.js.coffee +30 -45
  165. data/{app → vendor}/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  166. data/{app → vendor}/assets/javascripts/mercury/toolbar.expander.js.coffee +4 -4
  167. data/{app → vendor}/assets/javascripts/mercury/toolbar.js.coffee +6 -10
  168. data/{app → vendor}/assets/javascripts/mercury/tooltip.js.coffee +0 -0
  169. data/{app → vendor}/assets/javascripts/mercury/uploader.js.coffee +19 -37
  170. data/{app → vendor}/assets/javascripts/mercury.js +87 -60
  171. data/vendor/assets/javascripts/mercury_loader.js +193 -0
  172. data/vendor/assets/javascripts/mercury_overrides.js +6 -0
  173. data/{app → vendor}/assets/stylesheets/mercury/all_images.css.erb +2 -6
  174. data/{app → vendor}/assets/stylesheets/mercury/dialog.css +8 -21
  175. data/{app → vendor}/assets/stylesheets/mercury/lightview.css +56 -6
  176. data/vendor/assets/stylesheets/mercury/mercury.css +151 -0
  177. data/{app → vendor}/assets/stylesheets/mercury/modal.css +32 -15
  178. data/{app → vendor}/assets/stylesheets/mercury/statusbar.css +0 -0
  179. data/{app → vendor}/assets/stylesheets/mercury/toolbar.css +1 -4
  180. data/{app → vendor}/assets/stylesheets/mercury/tooltip.css +0 -0
  181. data/{app → vendor}/assets/stylesheets/mercury/uploader.css +4 -4
  182. data/{app → vendor}/assets/stylesheets/mercury.css +5 -1
  183. data/vendor/assets/stylesheets/mercury_overrides.css +17 -0
  184. metadata +197 -367
  185. data/POST_INSTALL +0 -21
  186. data/app/assets/images/mercury/default-snippet.png +0 -0
  187. data/app/assets/images/mercury/toolbar/editable/buttons.png +0 -0
  188. data/app/assets/images/mercury/toolbar/primary/_expander.png +0 -0
  189. data/app/assets/images/mercury/toolbar/primary/_pressed.png +0 -0
  190. data/app/assets/images/mercury/toolbar/primary/action.png +0 -0
  191. data/app/assets/images/mercury/toolbar/primary/historypanel.png +0 -0
  192. data/app/assets/images/mercury/toolbar/primary/insertcharacter.png +0 -0
  193. data/app/assets/images/mercury/toolbar/primary/insertlink.png +0 -0
  194. data/app/assets/images/mercury/toolbar/primary/insertmedia.png +0 -0
  195. data/app/assets/images/mercury/toolbar/primary/inserttable.png +0 -0
  196. data/app/assets/images/mercury/toolbar/primary/inspectorpanel.png +0 -0
  197. data/app/assets/images/mercury/toolbar/primary/notespanel.png +0 -0
  198. data/app/assets/images/mercury/toolbar/primary/preview.png +0 -0
  199. data/app/assets/images/mercury/toolbar/primary/redo.png +0 -0
  200. data/app/assets/images/mercury/toolbar/primary/save.png +0 -0
  201. data/app/assets/images/mercury/toolbar/primary/snippetpanel.png +0 -0
  202. data/app/assets/images/mercury/toolbar/primary/tools.png +0 -0
  203. data/app/assets/images/mercury/toolbar/primary/undo.png +0 -0
  204. data/app/assets/images/mercury/toolbar/primary/user.png +0 -0
  205. data/app/assets/images/mercury/toolbar/snippets/buttons.png +0 -0
  206. data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +0 -201
  207. data/app/assets/javascripts/mercury/locales/da.locale.js.coffee +0 -208
  208. data/app/assets/javascripts/mercury/locales/hu.locale.js.coffee +0 -209
  209. data/app/assets/javascripts/mercury/locales/pl.locale.js.coffee +0 -213
  210. data/app/assets/javascripts/mercury/locales/ru.locale.js.coffee +0 -200
  211. data/app/assets/javascripts/mercury/locales/uk.locale.js.coffee +0 -200
  212. data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +0 -203
  213. data/app/assets/javascripts/mercury/mercury-compiled.js +0 -10720
  214. data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +0 -152
  215. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +0 -132
  216. data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +0 -68
  217. data/app/assets/javascripts/mercury/regions/image.js.coffee +0 -93
  218. data/app/assets/javascripts/mercury/snippet.js.coffee +0 -136
  219. data/app/assets/stylesheets/_mercury-bootstrap-overrides.scss +0 -61
  220. data/app/assets/stylesheets/_mercury-sass.scss +0 -33
  221. data/app/assets/stylesheets/mercury/bootstrap-ish.css +0 -1367
  222. data/app/assets/stylesheets/mercury/bootstrap-overrides.css +0 -61
  223. data/app/assets/stylesheets/mercury/mercury.css +0 -43
  224. data/app/helpers/mercury_helper.rb +0 -7
  225. data/app/views/layouts/mercury.html.haml +0 -19
  226. data/app/views/layouts/mercury.html.slim +0 -19
  227. data/app/views/mercury/snippets/no_options/preview.html.erb +0 -1
  228. data/config/routes.rb +0 -9
  229. data/features/generators/authentication.feature +0 -10
  230. data/features/generators/images.feature +0 -41
  231. data/features/generators/install.feature +0 -21
  232. data/features/regions/full/basic_editing.feature +0 -198
  233. data/features/regions/full/inserting_tables.feature +0 -109
  234. data/features/regions/simple/basic_editing.feature +0 -5
  235. data/features/step_definitions/custom_web_steps.rb +0 -22
  236. data/features/step_definitions/generator_steps.rb +0 -23
  237. data/features/support/aruba.rb +0 -28
  238. data/lib/generators/mercury/install/authentication/authentication_generator.rb +0 -17
  239. data/lib/generators/mercury/install/images/images_generator.rb +0 -47
  240. data/lib/mercury/cucumber/step_definitions/mercury_steps.rb +0 -408
  241. data/lib/mercury/cucumber/step_definitions.rb +0 -13
  242. data/lib/mercury/engine.rb +0 -19
  243. data/lib/mercury/rails.rb +0 -5
  244. data/lib/mercury/version.rb +0 -3
  245. data/spec/dummy/Rakefile +0 -7
  246. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  247. data/spec/dummy/app/assets/javascripts/prototype.js +0 -6082
  248. data/spec/dummy/app/assets/stylesheets/application.css.scss +0 -110
  249. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  250. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  251. data/spec/dummy/app/views/layouts/mercury.html.erb +0 -28
  252. data/spec/dummy/config/application.rb +0 -58
  253. data/spec/dummy/config/boot.rb +0 -10
  254. data/spec/dummy/config/database.yml +0 -10
  255. data/spec/dummy/config/environment.rb +0 -5
  256. data/spec/dummy/config/environments/development.rb +0 -37
  257. data/spec/dummy/config/environments/production.rb +0 -67
  258. data/spec/dummy/config/environments/test.rb +0 -37
  259. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  260. data/spec/dummy/config/initializers/inflections.rb +0 -15
  261. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  262. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  263. data/spec/dummy/config/initializers/session_store.rb +0 -8
  264. data/spec/dummy/config/initializers/teabag.rb +0 -9
  265. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  266. data/spec/dummy/config/locales/en.yml +0 -5
  267. data/spec/dummy/config/routes.rb +0 -5
  268. data/spec/dummy/config.ru +0 -4
  269. data/spec/dummy/db/.gitkeep +0 -0
  270. data/spec/dummy/public/500.html +0 -25
  271. data/spec/dummy/public/blank.html +0 -1
  272. data/spec/dummy/public/favicon.ico +0 -0
  273. data/spec/dummy/public/images/bunny.gif +0 -0
  274. data/spec/dummy/public/images/bunny2.jpg +0 -0
  275. data/spec/dummy/public/index.html +0 -279
  276. data/spec/dummy/script/rails +0 -6
  277. data/spec/javascripts/fixtures/mercury/modals/insertlink.html +0 -67
  278. data/spec/javascripts/fixtures/mercury/modals/insertmedia.html +0 -87
  279. data/spec/javascripts/fixtures/mercury/modals/inserttable.html +0 -73
  280. data/spec/javascripts/fixtures/mercury/region.html +0 -6
  281. data/spec/javascripts/fixtures/mercury/regions/full.html +0 -1
  282. data/spec/javascripts/fixtures/mercury/regions/image.html +0 -1
  283. data/spec/javascripts/fixtures/mercury/regions/markdown.html +0 -1
  284. data/spec/javascripts/fixtures/mercury/regions/simple.html +0 -1
  285. data/spec/javascripts/fixtures/mercury/regions/snippets.html +0 -4
  286. data/spec/javascripts/mercury/regions/image_spec.js.coffee +0 -33
  287. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +0 -32
  288. data/spec/javascripts/spec_helper.coffee +0 -4
  289. data/spec/teabag_env.rb +0 -32
@@ -1,7 +1,8 @@
1
1
  describe "Mercury.Toolbar.Expander", ->
2
2
 
3
+ template 'mercury/toolbar.expander.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/toolbar.expander.html')
5
6
  @container = $('#expander_container')
6
7
 
7
8
  afterEach ->
@@ -12,20 +13,20 @@ describe "Mercury.Toolbar.Expander", ->
12
13
  describe "constructor", ->
13
14
 
14
15
  beforeEach ->
15
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
16
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
16
17
 
17
18
  it "expects a name, and options", ->
18
19
  html = $('<div>').html(@expander).html()
19
20
  expect(html).toContain('class="mercury-palette mercury-expander mercury-foo-expander"')
20
21
  expect(html).toMatch(/style="display:\s?none/)
21
- expect($('.mercury-toolbar-expander', fixture.el).length).toEqual(1)
22
+ expect($('#test .mercury-toolbar-expander').length).toEqual(1)
22
23
 
23
24
 
24
25
  describe "#build", ->
25
26
 
26
27
  beforeEach ->
27
28
  @resizeSpy = spyOn(Mercury.Toolbar.Expander.prototype, 'windowResize').andCallFake(=>)
28
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
29
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
29
30
 
30
31
  it "sets the whitespace of the container to normal", ->
31
32
  expect(@container.css('whiteSpace')).toEqual('normal')
@@ -36,7 +37,7 @@ describe "Mercury.Toolbar.Expander", ->
36
37
  expect(html).toMatch(/style="display:\s?none/)
37
38
 
38
39
  it "builds a trigger button", ->
39
- expect($('.mercury-toolbar-expander', fixture.el).length).toEqual(1)
40
+ expect($('#test .mercury-toolbar-expander').length).toEqual(1)
40
41
 
41
42
  it "calls windowResize", ->
42
43
  expect(@resizeSpy.callCount).toEqual(1)
@@ -46,7 +47,7 @@ describe "Mercury.Toolbar.Expander", ->
46
47
 
47
48
  beforeEach ->
48
49
  $('.mercury-button').data('expander', '<div data-button="test">expander</div>')
49
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
50
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
50
51
 
51
52
  describe "custom event: hide:dialogs", ->
52
53
 
@@ -80,30 +81,29 @@ describe "Mercury.Toolbar.Expander", ->
80
81
  button = $('#button2')
81
82
  spy = spyOn(button, 'click').andCallFake(=>)
82
83
  @container.find = -> button
83
- @expander.appendTo(fixture.el)
84
+ @expander.appendTo('#test')
84
85
 
85
86
  jasmine.simulate.click($('.mercury-toolbar-expander').get(0))
86
87
  jasmine.simulate.click($('[data-button=test]').get(0))
87
88
  expect(spy.callCount).toEqual(1)
88
89
 
89
-
90
90
  describe "#windowResize", ->
91
91
 
92
92
  it "hides", ->
93
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
93
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
94
94
  @expander.css({display: 'block'})
95
95
 
96
96
  Mercury.trigger('resize')
97
97
  expect(@expander.css('display')).toEqual('none')
98
98
 
99
99
  it "shows the trigger if the container is wider than the window", ->
100
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
100
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
101
101
  Mercury.trigger('resize')
102
- expect($('.mercury-toolbar-expander').css('display')).toEqual('none')
102
+ expect($('.mercury-toolbar-expander').css('display')).toEqual('block')
103
103
 
104
104
  it "hides the trigger if the container is narrower than the window", ->
105
105
  @container.css({width: '1px'})
106
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
106
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
107
107
  Mercury.trigger('resize')
108
108
  expect($('.mercury-toolbar-expander').css('display')).toEqual('none')
109
109
 
@@ -111,7 +111,7 @@ describe "Mercury.Toolbar.Expander", ->
111
111
  describe "#position", ->
112
112
 
113
113
  it "positions the element", ->
114
- @expander = new Mercury.Toolbar.Expander('foo', {appendTo: fixture.el, for: @container})
114
+ @expander = new Mercury.Toolbar.Expander('foo', {appendTo: '#test', for: @container})
115
115
  @expander.appendTo('#positioned_container')
116
116
  jasmine.simulate.click($('.mercury-toolbar-expander').get(0))
117
117
 
@@ -1,7 +1,8 @@
1
1
  describe "Mercury.Toolbar", ->
2
2
 
3
+ template 'mercury/toolbar.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/toolbar.html')
5
6
  $.fx.off = true
6
7
  spyOn($, 'ajax').andCallFake (url, options) =>
7
8
  options.success('data') if options.success
@@ -15,10 +16,10 @@ describe "Mercury.Toolbar", ->
15
16
  beforeEach ->
16
17
  @buildSpy = spyOn(Mercury.Toolbar.prototype, 'build').andCallFake(=>)
17
18
  @bindEventsSpy = spyOn(Mercury.Toolbar.prototype, 'bindEvents').andCallFake(=>)
18
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, foo: true})
19
+ @toolbar = new Mercury.Toolbar({appendTo: '#test', foo: true})
19
20
 
20
21
  it "accepts options as an argument", ->
21
- expect(@toolbar.options).toEqual({appendTo: fixture.el, foo: true})
22
+ expect(@toolbar.options).toEqual({appendTo: '#test', foo: true})
22
23
 
23
24
  it "calls build", ->
24
25
  expect(@buildSpy.callCount).toEqual(1)
@@ -47,7 +48,7 @@ describe "Mercury.Toolbar", ->
47
48
  it "builds out toolbar elements from the configuration", ->
48
49
  expect($('.mercury-primary-toolbar').length).toEqual(1)
49
50
  expect($('.mercury-editable-toolbar').length).toEqual(1)
50
- expect($('.mercury-editable-toolbar').data('regions')).toEqual('full,markdown')
51
+ expect($('.mercury-editable-toolbar').data('regions')).toEqual('editable,markupable')
51
52
 
52
53
  it "builds buttons etc.", ->
53
54
  expect(@buildButtonSpy.callCount).toBeGreaterThan(10)
@@ -81,7 +82,7 @@ describe "Mercury.Toolbar", ->
81
82
  describe "#buildButton", ->
82
83
 
83
84
  beforeEach ->
84
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el})
85
+ @toolbar = new Mercury.Toolbar({appendTo: '#test'})
85
86
 
86
87
  it "throws an exception when invalid options are passed", ->
87
88
  expect(=> @toolbar.buildButton('foo', false)).toThrow('Unknown button structure -- please provide an array, object, or string for "foo".')
@@ -126,24 +127,24 @@ describe "Mercury.Toolbar", ->
126
127
  describe "observed events", ->
127
128
 
128
129
  beforeEach ->
129
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el})
130
+ @toolbar = new Mercury.Toolbar({appendTo: '#test'})
130
131
 
131
132
  describe "custom event: region:focused", ->
132
133
 
133
134
  it "enables toolbars based on the region type", ->
134
135
  $('.mercury-editable-toolbar').addClass('disabled')
135
- Mercury.trigger('region:focused', {region: {type: -> 'full'}})
136
+ Mercury.trigger('region:focused', {region: {type: 'editable'}})
136
137
  expect($('.mercury.editable-toolbar').hasClass('disabled')).toEqual(false)
137
138
 
138
139
  $('.mercury-editable-toolbar').addClass('disabled')
139
- Mercury.trigger('region:focused', {region: {type: -> 'markdown'}})
140
+ Mercury.trigger('region:focused', {region: {type: 'markupable'}})
140
141
  expect($('.mercury.editable-toolbar').hasClass('disabled')).toEqual(false)
141
142
 
142
143
  describe "custom event: region:blurred", ->
143
144
 
144
145
  it "disables toolbars for the region type", ->
145
146
  $('.mercury-editable-toolbar').removeClass('disabled')
146
- Mercury.trigger('region:blurred', {region: {type: -> 'full'}})
147
+ Mercury.trigger('region:blurred', {region: {type: 'editable'}})
147
148
  expect($('.mercury-editable-toolbar').hasClass('disabled')).toEqual(true)
148
149
 
149
150
  describe "click", ->
@@ -166,7 +167,7 @@ describe "Mercury.Toolbar", ->
166
167
  describe "when visible", ->
167
168
 
168
169
  beforeEach ->
169
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: true})
170
+ @toolbar = new Mercury.Toolbar({appendTo: '#test', visible: true})
170
171
 
171
172
  it "returns the element outerheight", ->
172
173
  expect(@toolbar.height()).toEqual($('.mercury-toolbar-container').outerHeight())
@@ -174,48 +175,18 @@ describe "Mercury.Toolbar", ->
174
175
  describe "when not visible", ->
175
176
 
176
177
  beforeEach ->
177
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: false})
178
+ @toolbar = new Mercury.Toolbar({appendTo: '#test', visible: false})
178
179
 
179
180
  it "returns 0", ->
180
181
  expect(@toolbar.height()).toEqual(0)
181
182
 
182
- describe "when forced", ->
183
-
184
- beforeEach ->
185
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: false})
186
-
187
- it "returns the element outerheight", ->
188
- expect(@toolbar.height(true)).toEqual($('.mercury-toolbar-container').outerHeight())
189
-
190
- describe "#top", ->
191
-
192
- beforeEach ->
193
- spyOn(Mercury.Toolbar.prototype, 'buildButton').andCallFake(=> $('<div>'))
194
- spyOn(Mercury.Toolbar.prototype, 'bindEvents').andCallFake(=>)
195
-
196
- describe "when visible", ->
197
-
198
- beforeEach ->
199
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: true})
200
-
201
- it "returns the element offests top", ->
202
- expect(@toolbar.top()).toEqual($('.mercury-toolbar-container').offset().top)
203
-
204
- describe "when not visible", ->
205
-
206
- beforeEach ->
207
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: false})
208
-
209
- it "returns the element offests top", ->
210
- expect(@toolbar.top()).toEqual(0)
211
-
212
183
 
213
184
  describe "#show", ->
214
185
 
215
186
  beforeEach ->
216
187
  spyOn(Mercury.Toolbar.prototype, 'buildButton').andCallFake(=> $('<div>'))
217
188
  spyOn(Mercury.Toolbar.prototype, 'bindEvents').andCallFake(=>)
218
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: false})
189
+ @toolbar = new Mercury.Toolbar({appendTo: '#test', visible: false})
219
190
 
220
191
  it "sets visible to true", ->
221
192
  @toolbar.visible = false
@@ -238,7 +209,7 @@ describe "Mercury.Toolbar", ->
238
209
  beforeEach ->
239
210
  spyOn(Mercury.Toolbar.prototype, 'buildButton').andCallFake(=> $('<div>'))
240
211
  spyOn(Mercury.Toolbar.prototype, 'bindEvents').andCallFake(=>)
241
- @toolbar = new Mercury.Toolbar({appendTo: fixture.el, visible: true})
212
+ @toolbar = new Mercury.Toolbar({appendTo: '#test', visible: true})
242
213
 
243
214
  it "sets visible to false", ->
244
215
  @toolbar.visible = true
@@ -1,7 +1,8 @@
1
1
  describe "Mercury.tooltip", ->
2
2
 
3
+ template 'mercury/tooltip.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/tooltip.html')
5
6
  @forElement = $('#for_element')
6
7
  $.fx.off = true
7
8
 
@@ -1,10 +1,9 @@
1
1
  describe "Mercury.uploader", ->
2
2
 
3
+ template 'mercury/uploader.html'
4
+
3
5
  beforeEach ->
4
- fixture.load('mercury/uploader.html')
5
6
  Mercury.config.uploading.enabled = true
6
- @fileReaderSupport = spyOn(Mercury.uploader, 'fileReaderSupported')
7
- @fileReaderSupport.andCallFake(=> true)
8
7
  $.fx.off = true
9
8
  @mockFile = {
10
9
  size: 1024
@@ -121,7 +120,7 @@ describe "Mercury.uploader", ->
121
120
  describe "#build", ->
122
121
 
123
122
  beforeEach ->
124
- Mercury.uploader.options = {appendTo: fixture.el}
123
+ Mercury.uploader.options = {appendTo: '#test'}
125
124
 
126
125
  it "builds an element structure", ->
127
126
  Mercury.uploader.build()
@@ -159,7 +158,7 @@ describe "Mercury.uploader", ->
159
158
  describe "#appear", ->
160
159
 
161
160
  beforeEach ->
162
- Mercury.uploader.options = {appendTo: fixture.el}
161
+ Mercury.uploader.options = {appendTo: '#test'}
163
162
  Mercury.uploader.build()
164
163
  @fillDisplaySpy = spyOn(Mercury.uploader, 'fillDisplay').andCallFake(=>)
165
164
  @positionSpy = spyOn(Mercury.uploader, 'position').andCallFake(=>)
@@ -175,8 +174,8 @@ describe "Mercury.uploader", ->
175
174
 
176
175
  it "displays the overlay, and the element", ->
177
176
  Mercury.uploader.appear()
178
- expect($('.mercury-uploader', fixture.el).css('display')).toEqual('block')
179
- expect($('.mercury-uploader-overlay', fixture.el).css('display')).toEqual('block')
177
+ expect($('#test .mercury-uploader').css('display')).toEqual('block')
178
+ expect($('#test .mercury-uploader-overlay').css('display')).toEqual('block')
180
179
 
181
180
  it "sets visible to true", ->
182
181
  Mercury.uploader.appear()
@@ -190,7 +189,7 @@ describe "Mercury.uploader", ->
190
189
  describe "#position", ->
191
190
 
192
191
  beforeEach ->
193
- Mercury.uploader.options = {appendTo: fixture.el}
192
+ Mercury.uploader.options = {appendTo: '#test'}
194
193
  Mercury.uploader.build()
195
194
  @fillDisplaySpy = spyOn(Mercury.uploader, 'fillDisplay').andCallFake(=>)
196
195
  @positionSpy = spyOn(Mercury.uploader, 'position').andCallFake(=>)
@@ -199,29 +198,28 @@ describe "Mercury.uploader", ->
199
198
  # todo: this isn't really being tested
200
199
  Mercury.uploader.element.css({display: 'block'})
201
200
  Mercury.uploader.position()
202
- @expect($('.mercury-uploader', fixture.el).offset()).toEqual({top: 0, left: 0})
201
+ @expect($('#test .mercury-uploader').offset()).toEqual({top: 0, left: 0})
203
202
 
204
203
 
205
204
  describe "#fillDisplay", ->
206
205
 
207
206
  beforeEach ->
208
- Mercury.uploader.options = {appendTo: fixture.el}
207
+ Mercury.uploader.options = {appendTo: '#test'}
209
208
  Mercury.uploader.file = {name: 'image.png', size: 1024, type: 'image/png'}
210
209
  Mercury.uploader.build()
211
210
 
212
211
  it "puts the file details into the element", ->
213
212
  Mercury.uploader.fillDisplay()
214
- expect($('.mercury-uploader-details', fixture.el).html()).toEqual('Name: image.png<br>Size: undefined<br>Type: image/png')
213
+ expect($('#test .mercury-uploader-details').html()).toEqual('Name: image.png<br>Size: undefined<br>Type: image/png')
215
214
 
216
215
 
217
216
  describe "#loadImage", ->
218
217
 
219
218
  beforeEach ->
220
- Mercury.uploader.options = {appendTo: fixture.el}
219
+ Mercury.uploader.options = {appendTo: '#test'}
221
220
  Mercury.uploader.file = new Mercury.uploader.File(@mockFile)
222
221
  Mercury.uploader.build()
223
222
  spyOn(FileReader.prototype, 'readAsBinaryString').andCallFake(=>)
224
- @fileReaderSupport.andCallFake(=> true)
225
223
  @readAsDataURLSpy = spyOn(Mercury.uploader.File.prototype, 'readAsDataURL').andCallFake((callback) => callback('data-url'))
226
224
 
227
225
  it "calls file.readAsDataURL", ->
@@ -230,20 +228,7 @@ describe "Mercury.uploader", ->
230
228
 
231
229
  it "sets the preview image src to the file contents", ->
232
230
  Mercury.uploader.loadImage()
233
- expect($('.mercury-uploader-preview img', fixture.el).attr('src')).toEqual('data-url')
234
-
235
- it "calls upload", ->
236
- spy = spyOn(Mercury.uploader, 'upload').andCallFake(=>)
237
- Mercury.uploader.loadImage()
238
- expect(spy.callCount).toEqual(1)
239
-
240
- describe "#loadImage without FileReader", ->
241
-
242
- beforeEach ->
243
- Mercury.uploader.options = {appendTo: fixture.el}
244
- Mercury.uploader.file = new Mercury.uploader.File(@mockFile)
245
- Mercury.uploader.build()
246
- @fileReaderSupport.andCallFake(=> false)
231
+ expect($('#test .mercury-uploader-preview img').attr('src')).toEqual('data-url')
247
232
 
248
233
  it "calls upload", ->
249
234
  spy = spyOn(Mercury.uploader, 'upload').andCallFake(=>)
@@ -253,60 +238,61 @@ describe "Mercury.uploader", ->
253
238
 
254
239
  describe "#upload", ->
255
240
 
256
- it "should build a multipart form and submit it"
241
+ # todo: test this
242
+ it "should build a multipart form and submit it", ->
257
243
 
258
244
 
259
245
  describe "#updateStatus", ->
260
246
 
261
247
  beforeEach ->
262
- Mercury.uploader.options = {appendTo: fixture.el}
248
+ Mercury.uploader.options = {appendTo: '#test'}
263
249
  Mercury.uploader.build()
264
250
 
265
251
  it "updated the message in the progress display", ->
266
252
  Mercury.uploader.updateStatus('status message')
267
- expect($('.mercury-uploader-progress span', fixture.el).html()).toEqual('status message')
253
+ expect($('#test .mercury-uploader-progress span').html()).toEqual('status message')
268
254
 
269
255
  it "updates the progress indicator width", ->
270
256
  Mercury.uploader.updateStatus('message', 512)
271
- expect($('.mercury-uploader-indicator div', fixture.el).css('width')).toEqual('50px')
257
+ expect($('#test .mercury-uploader-indicator div').css('width')).toEqual('50px')
272
258
 
273
259
  it "updates the progress indicator value", ->
274
260
  Mercury.uploader.updateStatus('message', 512)
275
- expect($('.mercury-uploader-indicator b', fixture.el).html()).toEqual('50%')
261
+ expect($('#test .mercury-uploader-indicator b').html()).toEqual('50%')
276
262
 
277
263
 
278
264
  describe "#hide", ->
279
265
 
280
266
  beforeEach ->
281
267
  @setTimeoutSpy = spyOn(window, 'setTimeout')
282
- Mercury.uploader.options = {appendTo: fixture.el}
268
+ Mercury.uploader.options = {appendTo: '#test'}
283
269
  Mercury.uploader.build()
284
270
 
285
271
  it "accepts a delay", ->
286
272
  @setTimeoutSpy.andCallFake(=>)
287
273
  Mercury.uploader.hide(1)
288
274
  expect(@setTimeoutSpy.callCount).toEqual(1)
289
- expect(@setTimeoutSpy.argsForCall[0][1]).toEqual(1000)
275
+ expect(@setTimeoutSpy.argsForCall[0][0]).toEqual(1000)
290
276
 
291
277
  it "hides the overlay and element", ->
292
- @setTimeoutSpy.andCallFake((callback, timeout) => callback())
278
+ @setTimeoutSpy.andCallFake((timeout, callback) => callback())
293
279
  Mercury.uploader.hide()
294
- expect($('.mercury-uploader', fixture.el).css('opacity')).toEqual('0')
295
- expect($('.mercury-uploader-overlay', fixture.el).css('opacity')).toEqual('0')
280
+ expect($('#test .mercury-uploader').css('opacity')).toEqual('0')
281
+ expect($('#test .mercury-uploader-overlay').css('opacity')).toEqual('0')
296
282
 
297
283
  it "calls reset", ->
298
- @setTimeoutSpy.andCallFake((callback, timeout) => callback())
284
+ @setTimeoutSpy.andCallFake((timeout, callback) => callback())
299
285
  spy = spyOn(Mercury.uploader, 'reset').andCallFake(=>)
300
286
  Mercury.uploader.hide()
301
287
  expect(spy.callCount).toEqual(1)
302
288
 
303
289
  it "sets visible to false", ->
304
- @setTimeoutSpy.andCallFake((callback, timeout) => callback())
290
+ @setTimeoutSpy.andCallFake((timeout, callback) => callback())
305
291
  Mercury.uploader.hide()
306
292
  expect(Mercury.uploader.visible).toEqual(false)
307
293
 
308
294
  it "focuses the frame", ->
309
- @setTimeoutSpy.andCallFake((callback, timeout) => callback())
295
+ @setTimeoutSpy.andCallFake((timeout, callback) => callback())
310
296
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
311
297
  Mercury.uploader.hide()
312
298
  expect(spy.callCount).toEqual(1)
@@ -316,20 +302,20 @@ describe "Mercury.uploader", ->
316
302
  describe "#reset", ->
317
303
 
318
304
  beforeEach ->
319
- Mercury.uploader.options = {appendTo: fixture.el}
305
+ Mercury.uploader.options = {appendTo: '#test'}
320
306
  Mercury.uploader.build()
321
307
 
322
308
  it "removes the preview image", ->
323
- $('.mercury-uploader-indicator div', fixture.el).html('foo')
309
+ $('#test .mercury-uploader-indicator div').html('foo')
324
310
  Mercury.uploader.reset()
325
- expect($('.mercury-uploader-preview b', fixture.el).html()).toEqual('')
311
+ expect($('#test .mercury-uploader-preview b').html()).toEqual('')
326
312
 
327
313
  it "resets the progress back to 0", ->
328
- $('.mercury-uploader-indicator div', fixture.el).css({width: '50%'})
329
- $('.mercury-uploader-indicator b', fixture.el).html('50%')
314
+ $('#test .mercury-uploader-indicator div').css({width: '50%'})
315
+ $('#test .mercury-uploader-indicator b').html('50%')
330
316
  Mercury.uploader.reset()
331
- expect($('.mercury-uploader-indicator div', fixture.el).css('width')).toEqual('0px')
332
- expect($('.mercury-uploader-indicator b', fixture.el).html()).toEqual('0%')
317
+ expect($('#test .mercury-uploader-indicator div').css('width')).toEqual('0px')
318
+ expect($('#test .mercury-uploader-indicator b').html()).toEqual('0%')
333
319
 
334
320
  it "sets the status back to 'Processing...' for next time", ->
335
321
  spy = spyOn(Mercury.uploader, 'updateStatus').andCallFake(=>)
@@ -1,3 +1,5 @@
1
+ require('/assets/mercury.js');
2
+
1
3
  jasmine.simulate = {
2
4
 
3
5
  /**
@@ -0,0 +1,30 @@
1
+ <form>
2
+ <fieldset id="link_text_container">
3
+ <input id="link_text" name="link[text]" type="text"/>
4
+ </fieldset>
5
+
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>
11
+
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"/>
14
+
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>
21
+
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"/>
25
+ </div>
26
+
27
+ <input id="submit" type="submit"/>
28
+ </form>
29
+ <a name="link1">Link One</a>
30
+ <a name="link2">Link Two</a>
@@ -0,0 +1,35 @@
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
+
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>
22
+ </div>
23
+
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"/>
27
+ </div>
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"/>
32
+ </div>
33
+
34
+ <input id="submit" type="submit"/>
35
+ </form>
@@ -0,0 +1,27 @@
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>
4
+ </div>
5
+
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
+
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>
22
+
23
+ <input id="table_border" type="text" value="1"/>
24
+ <input id="table_spacing" type="text" value="0"/>
25
+
26
+ <input id="submit" type="submit"/>
27
+ </form>
@@ -7,9 +7,9 @@
7
7
  <meta content="K6JhyfOVKJX8X2ZkiJXSf491fc1fF+k79wzrChHQa0g=" name="csrf-token" />
8
8
 
9
9
  <div id="page_editor_container"></div>
10
- <div id="region1" custom-region-attribute="full"></div>
11
- <div id="region2" custom-region-attribute="full"></div>
12
- <div id="region3" custom-region-attribute="full">
10
+ <div id="region1" class="custom-region-class" data-type="editable"></div>
11
+ <div id="region2" class="custom-region-class" data-type="editable"></div>
12
+ <div id="region3" class="custom-region-class" data-type="editable">
13
13
  <a id="anchor1r" href="#" target="_top">1</a>
14
14
  <a id="anchor2r" href="#" target="_blank">2</a>
15
15
  <a id="anchor3r" href="#" target="_self">3</a>
@@ -19,7 +19,7 @@
19
19
  <form id="form3r" action="" target="_self"></form>
20
20
  <form id="form4r" action=""></form>
21
21
  </div>
22
- <div id="region4" custom-region-attribute=""></div>
22
+ <div id="region4" class="custom-region-class"></div>
23
23
 
24
24
  <a id="anchor1" href="#" target="_top">1</a>
25
25
  <a id="anchor2" href="#" target="_blank">2</a>
@@ -0,0 +1,2 @@
1
+ <div id="region" data-scope="scope" data-version="1">contents</div>
2
+ <div id="region_with_snippet">contents<div class="mercury-snippet" data-snippet="snippet_1" data-version="1">snippet</div></div>
@@ -0,0 +1,3 @@
1
+ <div id="editable_region1">
2
+
3
+ </div>
@@ -0,0 +1,4 @@
1
+ <div id="snippetable_region1" data-type="snippetable"></div>
2
+ <div id="snippetable_region2" data-type="snippetable">
3
+ <div class="mercury-snippet" data-snippet="snippet_1">12</div>
4
+ </div>