mercury-rails 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/app/assets/images/mercury/toolbar/{snippetable → snippets}/buttons.png +0 -0
  2. data/app/assets/javascripts/mercury.js +58 -84
  3. data/app/assets/javascripts/mercury/lightview.js.coffee +1 -1
  4. data/app/assets/javascripts/mercury/mercury.js.coffee +1 -1
  5. data/app/assets/javascripts/mercury/modal.js.coffee +1 -1
  6. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +13 -9
  7. data/app/assets/javascripts/mercury/native_extensions.js.coffee +0 -6
  8. data/app/assets/javascripts/mercury/page_editor.js.coffee +19 -19
  9. data/app/assets/javascripts/mercury/region.js.coffee +11 -10
  10. data/app/assets/javascripts/mercury/regions/{editable.js.coffee → full.coffee} +18 -18
  11. data/app/assets/javascripts/mercury/regions/image.js.coffee +13 -34
  12. data/app/assets/javascripts/mercury/regions/{markupable.js.coffee → markdown.coffee} +21 -22
  13. data/app/assets/javascripts/mercury/regions/simple.js.coffee +10 -39
  14. data/app/assets/javascripts/mercury/regions/{snippetable.js.coffee → snippets.js.coffee} +8 -7
  15. data/app/assets/javascripts/mercury/snippet.js.coffee +1 -1
  16. data/app/assets/javascripts/mercury/snippet_toolbar.js.coffee +3 -2
  17. data/app/assets/javascripts/mercury/toolbar.button.js.coffee +2 -2
  18. data/app/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  19. data/app/assets/javascripts/mercury/toolbar.js.coffee +2 -2
  20. data/app/assets/javascripts/mercury/uploader.js.coffee +2 -1
  21. data/app/assets/stylesheets/mercury/all_images.css.erb +2 -2
  22. data/app/assets/stylesheets/mercury/dialog.css +2 -2
  23. data/app/assets/stylesheets/mercury/lightview.css +14 -14
  24. data/app/assets/stylesheets/mercury/modal.css +1 -1
  25. data/app/assets/stylesheets/mercury/toolbar.css +1 -1
  26. data/features/generators/install.feature +1 -1
  27. data/features/loading/loading.feature +2 -2
  28. data/features/regions/{editable → full}/advanced_editing.feature +0 -0
  29. data/features/regions/full/basic_editing.feature +196 -0
  30. data/features/regions/{editable → full}/inserting_links.feature +12 -12
  31. data/features/regions/{editable → full}/inserting_media.feature +15 -15
  32. data/features/regions/{editable → full}/inserting_snippets.feature +15 -15
  33. data/features/regions/{editable → full}/inserting_special_characters.feature +2 -2
  34. data/features/regions/full/inserting_tables.feature +109 -0
  35. data/features/regions/{editable → full}/pasting.feature +0 -0
  36. data/features/regions/{editable → full}/uploading_images.feature +0 -0
  37. data/features/regions/{markupable → markdown}/advanced_editing.feature +0 -0
  38. data/features/regions/{markupable → markdown}/basic_editing.feature +0 -0
  39. data/features/regions/{markupable → markdown}/inserting_links.feature +0 -0
  40. data/features/regions/{markupable → markdown}/inserting_media.feature +0 -0
  41. data/features/regions/{markupable → markdown}/inserting_snippets.feature +0 -0
  42. data/features/regions/{markupable → markdown}/inserting_special_characters.feature +0 -0
  43. data/features/regions/{markupable → markdown}/inserting_tables.feature +0 -0
  44. data/features/regions/{markupable → markdown}/uploading_images.feature +0 -0
  45. data/features/regions/{snippetable → snippets}/advanced_editing.feature +0 -0
  46. data/features/regions/{snippetable → snippets}/basic_editing.feature +0 -0
  47. data/features/regions/{snippetable → snippets}/inserting_snippets.feature +0 -0
  48. data/features/saving/saving.feature +8 -8
  49. data/features/step_definitions/mercury_steps.rb +13 -13
  50. data/features/support/mercury_selectors.rb +3 -3
  51. data/lib/generators/mercury/install/images/images_generator.rb +3 -0
  52. data/lib/generators/mercury/install/install_generator.rb +5 -5
  53. data/lib/mercury/version.rb +1 -1
  54. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  55. data/spec/dummy/{public → app/assets/javascripts}/prototype.js +0 -0
  56. data/spec/dummy/app/assets/stylesheets/application.css.scss +110 -0
  57. data/spec/dummy/public/frame.html +1 -1
  58. data/spec/dummy/public/index.html +92 -216
  59. data/spec/javascripts/mercury/lightview_spec.js.coffee +1 -1
  60. data/spec/javascripts/mercury/modal_spec.js.coffee +1 -1
  61. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +41 -2
  62. data/spec/javascripts/mercury/page_editor_spec.js.coffee +19 -18
  63. data/spec/javascripts/mercury/region_spec.js.coffee +12 -14
  64. data/spec/javascripts/mercury/regions/{editable_spec.js.coffee → full_spec.js.coffee} +16 -16
  65. data/spec/javascripts/mercury/regions/image_spec.js.coffee +3 -3
  66. data/spec/javascripts/mercury/regions/{markupable_spec.js.coffee → markdown_spec.js.coffee} +18 -18
  67. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +3 -3
  68. data/spec/javascripts/mercury/regions/{snippetable_spec.js.coffee → snippets_spec.js.coffee} +53 -53
  69. data/spec/javascripts/mercury/snippet_spec.js.coffee +1 -1
  70. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +2 -2
  71. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +5 -5
  72. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +6 -6
  73. data/spec/javascripts/mercury/toolbar_spec.js.coffee +4 -4
  74. data/spec/javascripts/mercury/uploader_spec.js.coffee +5 -5
  75. data/spec/javascripts/templates/mercury/page_editor.html +4 -4
  76. data/spec/javascripts/templates/mercury/region.html +1 -1
  77. data/spec/javascripts/templates/mercury/regions/full.html +1 -0
  78. data/spec/javascripts/templates/mercury/regions/image.html +1 -1
  79. data/spec/javascripts/templates/mercury/regions/markdown.html +1 -0
  80. data/spec/javascripts/templates/mercury/regions/simple.html +1 -3
  81. data/spec/javascripts/templates/mercury/regions/snippets.html +4 -0
  82. metadata +65 -75
  83. data/app/assets/javascripts/mercury_loader.js +0 -193
  84. data/app/assets/javascripts/mercury_overrides.js +0 -6
  85. data/app/assets/stylesheets/mercury_overrides.css +0 -17
  86. data/features/regions/editable/basic_editing.feature +0 -196
  87. data/features/regions/editable/inserting_tables.feature +0 -109
  88. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  89. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  90. data/spec/dummy/public/404.html +0 -26
  91. data/spec/dummy/public/422.html +0 -26
  92. data/spec/dummy/public/canvastest.html +0 -103
  93. data/spec/javascripts/templates/mercury/regions/editable.html +0 -3
  94. data/spec/javascripts/templates/mercury/regions/snippetable.html +0 -4
@@ -288,27 +288,27 @@ describe "Mercury.uploader", ->
288
288
  @setTimeoutSpy.andCallFake(=>)
289
289
  Mercury.uploader.hide(1)
290
290
  expect(@setTimeoutSpy.callCount).toEqual(1)
291
- expect(@setTimeoutSpy.argsForCall[0][0]).toEqual(1000)
291
+ expect(@setTimeoutSpy.argsForCall[0][1]).toEqual(1000)
292
292
 
293
293
  it "hides the overlay and element", ->
294
- @setTimeoutSpy.andCallFake((timeout, callback) => callback())
294
+ @setTimeoutSpy.andCallFake((callback, timeout) => callback())
295
295
  Mercury.uploader.hide()
296
296
  expect($('#test .mercury-uploader').css('opacity')).toEqual('0')
297
297
  expect($('#test .mercury-uploader-overlay').css('opacity')).toEqual('0')
298
298
 
299
299
  it "calls reset", ->
300
- @setTimeoutSpy.andCallFake((timeout, callback) => callback())
300
+ @setTimeoutSpy.andCallFake((callback, timeout) => callback())
301
301
  spy = spyOn(Mercury.uploader, 'reset').andCallFake(=>)
302
302
  Mercury.uploader.hide()
303
303
  expect(spy.callCount).toEqual(1)
304
304
 
305
305
  it "sets visible to false", ->
306
- @setTimeoutSpy.andCallFake((timeout, callback) => callback())
306
+ @setTimeoutSpy.andCallFake((callback, timeout) => callback())
307
307
  Mercury.uploader.hide()
308
308
  expect(Mercury.uploader.visible).toEqual(false)
309
309
 
310
310
  it "focuses the frame", ->
311
- @setTimeoutSpy.andCallFake((timeout, callback) => callback())
311
+ @setTimeoutSpy.andCallFake((callback, timeout) => callback())
312
312
  spy = spyOn(Mercury, 'trigger').andCallFake(=>)
313
313
  Mercury.uploader.hide()
314
314
  expect(spy.callCount).toEqual(1)
@@ -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" 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">
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">
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" class="custom-region-class"></div>
22
+ <div id="region4" custom-region-attribute=""></div>
23
23
 
24
24
  <a id="anchor1" href="#" target="_top">1</a>
25
25
  <a id="anchor2" href="#" target="_blank">2</a>
@@ -1,2 +1,2 @@
1
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>
2
+ <div id="region_with_snippet">contents<div class="example-snippet" data-snippet="snippet_1" data-version="1">snippet</div></div>
@@ -0,0 +1 @@
1
+ <div id="full_region1"></div>
@@ -1 +1 @@
1
- <img id="editable_region1" src="foo.jpg" />
1
+ <img id="image_region1" src="foo.jpg" />
@@ -0,0 +1 @@
1
+ <div id="markdown_region1"></div>
@@ -1,3 +1 @@
1
- <div id="editable_region1">
2
-
3
- </div>
1
+ <div id="simple_region1"></div>
@@ -0,0 +1,4 @@
1
+ <div id="snippets_region1" data-mercury="snippets"></div>
2
+ <div id="snippets_region2" data-mercury="snippets">
3
+ <div class="example-snippet" data-snippet="snippet_1">12</div>
4
+ </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercury-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -220,7 +220,7 @@ dependencies:
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  description: A fully featured and advanced HTML5 WYSIWYG editor written in CoffeeScript
223
- on top of the Rails 3.1 asset stack
223
+ on top of the Rails asset pipeline
224
224
  email:
225
225
  - jejacks0n@gmail.com
226
226
  executables: []
@@ -265,7 +265,7 @@ files:
265
265
  - app/assets/images/mercury/toolbar/primary/save.png
266
266
  - app/assets/images/mercury/toolbar/primary/snippetpanel.png
267
267
  - app/assets/images/mercury/toolbar/primary/undo.png
268
- - app/assets/images/mercury/toolbar/snippetable/buttons.png
268
+ - app/assets/images/mercury/toolbar/snippets/buttons.png
269
269
  - app/assets/javascripts/mercury/dependencies/jquery-1.7.js
270
270
  - app/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js
271
271
  - app/assets/javascripts/mercury/dependencies/jquery.additions.js
@@ -309,11 +309,11 @@ files:
309
309
  - app/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee
310
310
  - app/assets/javascripts/mercury/plugins/save_as_xml/plugin.js
311
311
  - app/assets/javascripts/mercury/region.js.coffee
312
- - app/assets/javascripts/mercury/regions/editable.js.coffee
312
+ - app/assets/javascripts/mercury/regions/full.coffee
313
313
  - app/assets/javascripts/mercury/regions/image.js.coffee
314
- - app/assets/javascripts/mercury/regions/markupable.js.coffee
314
+ - app/assets/javascripts/mercury/regions/markdown.coffee
315
315
  - app/assets/javascripts/mercury/regions/simple.js.coffee
316
- - app/assets/javascripts/mercury/regions/snippetable.js.coffee
316
+ - app/assets/javascripts/mercury/regions/snippets.js.coffee
317
317
  - app/assets/javascripts/mercury/select.js.coffee
318
318
  - app/assets/javascripts/mercury/snippet.js.coffee
319
319
  - app/assets/javascripts/mercury/snippet_toolbar.js.coffee
@@ -327,8 +327,6 @@ files:
327
327
  - app/assets/javascripts/mercury/tooltip.js.coffee
328
328
  - app/assets/javascripts/mercury/uploader.js.coffee
329
329
  - app/assets/javascripts/mercury.js
330
- - app/assets/javascripts/mercury_loader.js
331
- - app/assets/javascripts/mercury_overrides.js
332
330
  - app/assets/stylesheets/mercury/all_images.css.erb
333
331
  - app/assets/stylesheets/mercury/buttons.css
334
332
  - app/assets/stylesheets/mercury/dialog.css
@@ -341,7 +339,6 @@ files:
341
339
  - app/assets/stylesheets/mercury/tooltip.css
342
340
  - app/assets/stylesheets/mercury/uploader.css
343
341
  - app/assets/stylesheets/mercury.css
344
- - app/assets/stylesheets/mercury_overrides.css
345
342
  - app/controllers/mercury_controller.rb
346
343
  - app/views/layouts/mercury.html.erb
347
344
  - app/views/mercury/lightviews/about.html
@@ -367,28 +364,28 @@ files:
367
364
  - features/loading/loading.feature
368
365
  - features/loading/navigating.feature
369
366
  - features/loading/user_interface.feature
370
- - features/regions/editable/advanced_editing.feature
371
- - features/regions/editable/basic_editing.feature
372
- - features/regions/editable/inserting_links.feature
373
- - features/regions/editable/inserting_media.feature
374
- - features/regions/editable/inserting_snippets.feature
375
- - features/regions/editable/inserting_special_characters.feature
376
- - features/regions/editable/inserting_tables.feature
377
- - features/regions/editable/pasting.feature
378
- - features/regions/editable/uploading_images.feature
367
+ - features/regions/full/advanced_editing.feature
368
+ - features/regions/full/basic_editing.feature
369
+ - features/regions/full/inserting_links.feature
370
+ - features/regions/full/inserting_media.feature
371
+ - features/regions/full/inserting_snippets.feature
372
+ - features/regions/full/inserting_special_characters.feature
373
+ - features/regions/full/inserting_tables.feature
374
+ - features/regions/full/pasting.feature
375
+ - features/regions/full/uploading_images.feature
379
376
  - features/regions/image/uploading_images.feature
380
- - features/regions/markupable/advanced_editing.feature
381
- - features/regions/markupable/basic_editing.feature
382
- - features/regions/markupable/inserting_links.feature
383
- - features/regions/markupable/inserting_media.feature
384
- - features/regions/markupable/inserting_snippets.feature
385
- - features/regions/markupable/inserting_special_characters.feature
386
- - features/regions/markupable/inserting_tables.feature
387
- - features/regions/markupable/uploading_images.feature
377
+ - features/regions/markdown/advanced_editing.feature
378
+ - features/regions/markdown/basic_editing.feature
379
+ - features/regions/markdown/inserting_links.feature
380
+ - features/regions/markdown/inserting_media.feature
381
+ - features/regions/markdown/inserting_snippets.feature
382
+ - features/regions/markdown/inserting_special_characters.feature
383
+ - features/regions/markdown/inserting_tables.feature
384
+ - features/regions/markdown/uploading_images.feature
388
385
  - features/regions/simple/basic_editing.feature
389
- - features/regions/snippetable/advanced_editing.feature
390
- - features/regions/snippetable/basic_editing.feature
391
- - features/regions/snippetable/inserting_snippets.feature
386
+ - features/regions/snippets/advanced_editing.feature
387
+ - features/regions/snippets/basic_editing.feature
388
+ - features/regions/snippets/inserting_snippets.feature
392
389
  - features/saving/saving.feature
393
390
  - features/step_definitions/debug_steps.rb
394
391
  - features/step_definitions/generator_steps.rb
@@ -402,9 +399,9 @@ files:
402
399
  - features/support/selectors.rb
403
400
  - spec/dummy/Rakefile
404
401
  - spec/dummy/app/assets/javascripts/application.js
405
- - spec/dummy/app/assets/stylesheets/application.css
402
+ - spec/dummy/app/assets/javascripts/prototype.js
403
+ - spec/dummy/app/assets/stylesheets/application.css.scss
406
404
  - spec/dummy/app/controllers/application_controller.rb
407
- - spec/dummy/app/helpers/application_helper.rb
408
405
  - spec/dummy/app/views/layouts/application.html.erb
409
406
  - spec/dummy/config.ru
410
407
  - spec/dummy/config/application.rb
@@ -424,18 +421,14 @@ files:
424
421
  - spec/dummy/config/initializers/wrap_parameters.rb
425
422
  - spec/dummy/config/locales/en.yml
426
423
  - spec/dummy/config/routes.rb
427
- - spec/dummy/public/404.html
428
- - spec/dummy/public/422.html
429
424
  - spec/dummy/public/500.html
430
425
  - spec/dummy/public/blank.html
431
- - spec/dummy/public/canvastest.html
432
426
  - spec/dummy/public/distro.html
433
427
  - spec/dummy/public/favicon.ico
434
428
  - spec/dummy/public/frame.html
435
429
  - spec/dummy/public/images/bunny.gif
436
430
  - spec/dummy/public/images/bunny2.jpg
437
431
  - spec/dummy/public/index.html
438
- - spec/dummy/public/prototype.js
439
432
  - spec/dummy/script/rails
440
433
  - spec/javascripts/mercury/dialog_spec.js.coffee
441
434
  - spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee
@@ -458,11 +451,11 @@ files:
458
451
  - spec/javascripts/mercury/palette_spec.js.coffee
459
452
  - spec/javascripts/mercury/panel_spec.js.coffee
460
453
  - spec/javascripts/mercury/region_spec.js.coffee
461
- - spec/javascripts/mercury/regions/editable_spec.js.coffee
454
+ - spec/javascripts/mercury/regions/full_spec.js.coffee
462
455
  - spec/javascripts/mercury/regions/image_spec.js.coffee
463
- - spec/javascripts/mercury/regions/markupable_spec.js.coffee
456
+ - spec/javascripts/mercury/regions/markdown_spec.js.coffee
464
457
  - spec/javascripts/mercury/regions/simple_spec.js.coffee
465
- - spec/javascripts/mercury/regions/snippetable_spec.js.coffee
458
+ - spec/javascripts/mercury/regions/snippets_spec.js.coffee
466
459
  - spec/javascripts/mercury/select_spec.js.coffee
467
460
  - spec/javascripts/mercury/snippet_spec.js.coffee
468
461
  - spec/javascripts/mercury/snippet_toolbar_spec.js.coffee
@@ -493,10 +486,11 @@ files:
493
486
  - spec/javascripts/templates/mercury/palette.html
494
487
  - spec/javascripts/templates/mercury/panel.html
495
488
  - spec/javascripts/templates/mercury/region.html
496
- - spec/javascripts/templates/mercury/regions/editable.html
489
+ - spec/javascripts/templates/mercury/regions/full.html
497
490
  - spec/javascripts/templates/mercury/regions/image.html
491
+ - spec/javascripts/templates/mercury/regions/markdown.html
498
492
  - spec/javascripts/templates/mercury/regions/simple.html
499
- - spec/javascripts/templates/mercury/regions/snippetable.html
493
+ - spec/javascripts/templates/mercury/regions/snippets.html
500
494
  - spec/javascripts/templates/mercury/select.html
501
495
  - spec/javascripts/templates/mercury/snippet.html
502
496
  - spec/javascripts/templates/mercury/snippet_toolbar.html
@@ -523,7 +517,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
523
517
  version: '0'
524
518
  segments:
525
519
  - 0
526
- hash: -1621862695583781512
520
+ hash: -1612885216118549362
527
521
  required_rubygems_version: !ruby/object:Gem::Requirement
528
522
  none: false
529
523
  requirements:
@@ -532,14 +526,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
532
526
  version: '0'
533
527
  segments:
534
528
  - 0
535
- hash: -1621862695583781512
529
+ hash: -1612885216118549362
536
530
  requirements: []
537
531
  rubyforge_project:
538
532
  rubygems_version: 1.8.21
539
533
  signing_key:
540
534
  specification_version: 3
541
- summary: A fully featured and advanced HTML5 WYSIWYG editor written in CoffeeScript
542
- on top of Rails 3.1
535
+ summary: ! 'Mercury Editor: The Rails HTML5 WYSIWYG editor'
543
536
  test_files:
544
537
  - features/generators/authentication.feature
545
538
  - features/generators/images.feature
@@ -547,28 +540,28 @@ test_files:
547
540
  - features/loading/loading.feature
548
541
  - features/loading/navigating.feature
549
542
  - features/loading/user_interface.feature
550
- - features/regions/editable/advanced_editing.feature
551
- - features/regions/editable/basic_editing.feature
552
- - features/regions/editable/inserting_links.feature
553
- - features/regions/editable/inserting_media.feature
554
- - features/regions/editable/inserting_snippets.feature
555
- - features/regions/editable/inserting_special_characters.feature
556
- - features/regions/editable/inserting_tables.feature
557
- - features/regions/editable/pasting.feature
558
- - features/regions/editable/uploading_images.feature
543
+ - features/regions/full/advanced_editing.feature
544
+ - features/regions/full/basic_editing.feature
545
+ - features/regions/full/inserting_links.feature
546
+ - features/regions/full/inserting_media.feature
547
+ - features/regions/full/inserting_snippets.feature
548
+ - features/regions/full/inserting_special_characters.feature
549
+ - features/regions/full/inserting_tables.feature
550
+ - features/regions/full/pasting.feature
551
+ - features/regions/full/uploading_images.feature
559
552
  - features/regions/image/uploading_images.feature
560
- - features/regions/markupable/advanced_editing.feature
561
- - features/regions/markupable/basic_editing.feature
562
- - features/regions/markupable/inserting_links.feature
563
- - features/regions/markupable/inserting_media.feature
564
- - features/regions/markupable/inserting_snippets.feature
565
- - features/regions/markupable/inserting_special_characters.feature
566
- - features/regions/markupable/inserting_tables.feature
567
- - features/regions/markupable/uploading_images.feature
553
+ - features/regions/markdown/advanced_editing.feature
554
+ - features/regions/markdown/basic_editing.feature
555
+ - features/regions/markdown/inserting_links.feature
556
+ - features/regions/markdown/inserting_media.feature
557
+ - features/regions/markdown/inserting_snippets.feature
558
+ - features/regions/markdown/inserting_special_characters.feature
559
+ - features/regions/markdown/inserting_tables.feature
560
+ - features/regions/markdown/uploading_images.feature
568
561
  - features/regions/simple/basic_editing.feature
569
- - features/regions/snippetable/advanced_editing.feature
570
- - features/regions/snippetable/basic_editing.feature
571
- - features/regions/snippetable/inserting_snippets.feature
562
+ - features/regions/snippets/advanced_editing.feature
563
+ - features/regions/snippets/basic_editing.feature
564
+ - features/regions/snippets/inserting_snippets.feature
572
565
  - features/saving/saving.feature
573
566
  - features/step_definitions/debug_steps.rb
574
567
  - features/step_definitions/generator_steps.rb
@@ -582,9 +575,9 @@ test_files:
582
575
  - features/support/selectors.rb
583
576
  - spec/dummy/Rakefile
584
577
  - spec/dummy/app/assets/javascripts/application.js
585
- - spec/dummy/app/assets/stylesheets/application.css
578
+ - spec/dummy/app/assets/javascripts/prototype.js
579
+ - spec/dummy/app/assets/stylesheets/application.css.scss
586
580
  - spec/dummy/app/controllers/application_controller.rb
587
- - spec/dummy/app/helpers/application_helper.rb
588
581
  - spec/dummy/app/views/layouts/application.html.erb
589
582
  - spec/dummy/config.ru
590
583
  - spec/dummy/config/application.rb
@@ -604,18 +597,14 @@ test_files:
604
597
  - spec/dummy/config/initializers/wrap_parameters.rb
605
598
  - spec/dummy/config/locales/en.yml
606
599
  - spec/dummy/config/routes.rb
607
- - spec/dummy/public/404.html
608
- - spec/dummy/public/422.html
609
600
  - spec/dummy/public/500.html
610
601
  - spec/dummy/public/blank.html
611
- - spec/dummy/public/canvastest.html
612
602
  - spec/dummy/public/distro.html
613
603
  - spec/dummy/public/favicon.ico
614
604
  - spec/dummy/public/frame.html
615
605
  - spec/dummy/public/images/bunny.gif
616
606
  - spec/dummy/public/images/bunny2.jpg
617
607
  - spec/dummy/public/index.html
618
- - spec/dummy/public/prototype.js
619
608
  - spec/dummy/script/rails
620
609
  - spec/javascripts/mercury/dialog_spec.js.coffee
621
610
  - spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee
@@ -638,11 +627,11 @@ test_files:
638
627
  - spec/javascripts/mercury/palette_spec.js.coffee
639
628
  - spec/javascripts/mercury/panel_spec.js.coffee
640
629
  - spec/javascripts/mercury/region_spec.js.coffee
641
- - spec/javascripts/mercury/regions/editable_spec.js.coffee
630
+ - spec/javascripts/mercury/regions/full_spec.js.coffee
642
631
  - spec/javascripts/mercury/regions/image_spec.js.coffee
643
- - spec/javascripts/mercury/regions/markupable_spec.js.coffee
632
+ - spec/javascripts/mercury/regions/markdown_spec.js.coffee
644
633
  - spec/javascripts/mercury/regions/simple_spec.js.coffee
645
- - spec/javascripts/mercury/regions/snippetable_spec.js.coffee
634
+ - spec/javascripts/mercury/regions/snippets_spec.js.coffee
646
635
  - spec/javascripts/mercury/select_spec.js.coffee
647
636
  - spec/javascripts/mercury/snippet_spec.js.coffee
648
637
  - spec/javascripts/mercury/snippet_toolbar_spec.js.coffee
@@ -673,10 +662,11 @@ test_files:
673
662
  - spec/javascripts/templates/mercury/palette.html
674
663
  - spec/javascripts/templates/mercury/panel.html
675
664
  - spec/javascripts/templates/mercury/region.html
676
- - spec/javascripts/templates/mercury/regions/editable.html
665
+ - spec/javascripts/templates/mercury/regions/full.html
677
666
  - spec/javascripts/templates/mercury/regions/image.html
667
+ - spec/javascripts/templates/mercury/regions/markdown.html
678
668
  - spec/javascripts/templates/mercury/regions/simple.html
679
- - spec/javascripts/templates/mercury/regions/snippetable.html
669
+ - spec/javascripts/templates/mercury/regions/snippets.html
680
670
  - spec/javascripts/templates/mercury/select.html
681
671
  - spec/javascripts/templates/mercury/snippet.html
682
672
  - spec/javascripts/templates/mercury/snippet_toolbar.html
@@ -1,193 +0,0 @@
1
- /*!
2
- * Mercury Editor is a CoffeeScript and jQuery based WYSIWYG editor. Documentation and other useful information can be
3
- * found at https://github.com/jejacks0n/mercury
4
- *
5
- * Supported browsers:
6
- * - Firefox 4+
7
- * - Chrome 10+
8
- * - Safari 5+
9
- *
10
- * Copyright (c) 2011 Jeremy Jackson
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
14
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
15
- * persons to whom the Software is furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
18
- * Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
21
- * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
- *
25
- */
26
-
27
- // ## Default Packages
28
- //
29
- // Some default packages are provided for you. If you want to define your own, feel free to do so before including this
30
- // script. These, or your own packages can be specified to the loader in query params (read below for details).
31
- if (!window.mercuryPackages) window.mercuryPackages = {
32
- development: {javascripts: 'mercury.js', stylesheets: 'mercury.css'},
33
- bundled: {javascripts: 'javascripts/mercury.min.js,javascripts/mercury_dialogs.js', stylesheets: 'stylesheets/mercury.bundle.css'}
34
- };
35
-
36
-
37
- // ## Mercury Loader
38
- (function() {
39
- // Useragent detection, which we use to determine if the client is supported. We do this method instead of checking
40
- // features because many of the features are supported in IE, but aren't implemented to the W3C spec.
41
- var browser = {
42
- webkit: /(webkit)[ \/]([\w.]+)/,
43
- opera: /(opera)(?:.*version)?[ \/]([\w.]+)/,
44
- msie: /(msie) ([\w.]+)/,
45
- mozilla: /(mozilla)(?:.*? rv:([\w.]+))?/
46
- };
47
-
48
- var ua = navigator.userAgent.toLowerCase();
49
- var match = browser.webkit.exec(ua) || browser.opera.exec(ua) || browser.msie.exec(ua) || ua.indexOf("compatible") < 0 && browser.mozilla.exec(ua) || [];
50
- browser = {version: match[2] || "0" };
51
- browser[match[1] || ""] = true;
52
-
53
- // If the browser isn't supported, we don't try to do anything more. We do direct userAgent detection here because IE
54
- // thinks it's supported but isn't -- in part because it has it's own implementation of the contentEditable spec.
55
- if (document.getElementsByTagName && document.getElementById && document.designMode && !browser.konqueror && !browser.msie) {
56
- // supported
57
- } else {
58
- return;
59
- }
60
-
61
- // Default options, which can be overridden by specifying them in query params to the loader script.
62
- // You can provide any additional options to the loader, and they will be passed to the PageEditor instance when it's
63
- // created, so for instance you could put `visible=false`, and the editor be hidden after it's created.
64
- var options = {
65
- // A path or url from which the javascripts and css should be loaded.
66
- src: '/assets',
67
- // A value defined in the packages above. Development is used by default. If you want to provide your own package
68
- // you can just define one before including this script.
69
- pack: 'development'
70
- };
71
-
72
- // Hide the document during loading so there isn't a flicker while mercury is being loaded.
73
- var head = document.getElementsByTagName("head")[0];
74
- if (window == top) {
75
- var style = document.createElement('style');
76
- var rules = document.createTextNode('body{visibility:hidden;display:none}');
77
- style.type = 'text/css';
78
- if (style.styleSheet) style.styleSheet.cssText = rules.nodeValue;
79
- else style.appendChild(rules);
80
- head.appendChild(style);
81
- }
82
-
83
- // Because Mercury loads the document it's going to edit into an iframe we do some tweaks to the current document to
84
- // make that feel more seamless.
85
- function loadMercury() {
86
- if (document.mercuryLoaded) return;
87
- if (timer) window.clearTimeout(timer);
88
- document.mercuryLoaded = true;
89
-
90
- // If the current window is the top window, it means that Mercury hasn't been loaded yet. So we load it.
91
- if (window == top) {
92
- var i;
93
-
94
- // Find the loader script and determine what options were provided so the defaults can be overridden. To provide
95
- // options just pass them in as query params (eg. `mercury_loader.js?src=/asset_path&pack=bundled`)
96
- var scripts = document.getElementsByTagName('script');
97
- for (i = 0; i <= scripts.length - 1; i += 1) {
98
- var match = scripts[i].src.match(/mercury_loader\.js\??(.*)?$/);
99
- if (!match || !match[1]) continue;
100
-
101
- match[1].replace(/([^&=]*)=([^&=]*)/g, function (m, attr, value) {
102
- if (['true', 'false'].indexOf(value) >= 0) value = JSON.parse(value);
103
- options[attr] = value;
104
- });
105
- }
106
-
107
- var pack = window.mercuryPackages[options.pack];
108
- setTimeout(function() {
109
- // Once we're ready to load Mercury we clear the document contents, and add in the css and javascript tags.
110
- // Once the script has loaded we display the body again, and instantiate a new instance of Mercury.PageEditor.
111
- document.body.innerHTML = '<div style="height:0;overflow:hidden;">Mercury</div>';
112
- for (i = 0; i <= document.styleSheets.length - 1; i += 1) {
113
- document.styleSheets[i].disabled = true;
114
- }
115
-
116
- // Load all the stylesheets.
117
- var stylesheets = pack.stylesheets.split(',');
118
- for (i = 0; i <= stylesheets.length - 1; i += 1) {
119
- var link = document.createElement('link');
120
- link.href = options.src + '/' + stylesheets[i];
121
- link.media = 'screen';
122
- link.rel = 'stylesheet';
123
- link.type = 'text/css';
124
- head.appendChild(link);
125
- }
126
-
127
- // Load all the javascripts.
128
- var javascripts = pack.javascripts.split(',');
129
- var loaded = 0;
130
- function loadScript(src) {
131
- var script = document.createElement('script');
132
- script.src = options.src + '/' + src;
133
- script.type = 'text/javascript';
134
- script.charset = 'utf-8';
135
- head.appendChild(script);
136
- script.onload = function() {
137
- loaded += 1;
138
- if (loaded >= javascripts.length) {
139
- document.body.style.visibility = 'visible';
140
- document.body.style.display = 'block';
141
- // Instantiate the PageEditor, passing in the options that were provided to the loader.
142
- new Mercury.PageEditor(null, options);
143
- // If there's a mercuryLoaded function available, call it. You can provide one before the loading script
144
- // and it will be called after everything is loaded, but before everything is initialized. You can bind
145
- // to the mercury:ready event or use Mercury.bind('ready', function() {}).
146
- if (typeof(window.mercuryLoaded) == 'function') {
147
- window.mercuryLoaded();
148
- }
149
- } else {
150
- loadScript(javascripts[loaded]);
151
- }
152
- };
153
- }
154
- loadScript(javascripts[loaded]);
155
- }, 1);
156
- } else if (top.Mercury) {
157
- // Since this file will be included in the iframe as well, we use it to tell Mercury that the document is ready to
158
- // be worked on. By firing this event we're able to build the regions and get everything ready without having to
159
- // wait for assets and slow javascripts to load or complete.
160
- window.Mercury = top.Mercury;
161
- Mercury.trigger('initialize:frame');
162
- }
163
- }
164
-
165
- // This is a common technique for determining if the document has loaded yet, and is based on the methods used in
166
- // Prototype.js. The following portions just call loadMercury once it's appropriate to do so.
167
- //
168
- // Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards, John Resig,
169
- // and Diego Perini.
170
- var timer;
171
- function checkReadyState() {
172
- if (document.readyState === 'complete') {
173
- document.stopObserving('readystatechange', checkReadyState);
174
- loadMercury();
175
- }
176
- }
177
-
178
- function pollDoScroll() {
179
- try { document.documentElement.doScroll('left'); }
180
- catch(e) {
181
- timer = pollDoScroll.defer();
182
- return;
183
- }
184
- loadMercury();
185
- }
186
-
187
- if (document.addEventListener) {
188
- document.addEventListener('DOMContentLoaded', loadMercury, false);
189
- } else {
190
- document.observe('readystatechange', checkReadyState);
191
- if (window == top) { timer = pollDoScroll.defer(); }
192
- }
193
- })();