mercury-rails 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. data/POST_INSTALL +15 -0
  2. data/{vendor → app}/assets/images/mercury/button.png +0 -0
  3. data/{vendor → app}/assets/images/mercury/close.png +0 -0
  4. data/app/assets/images/mercury/default-snippet.png +0 -0
  5. data/{vendor → app}/assets/images/mercury/loading-dark.gif +0 -0
  6. data/{vendor → app}/assets/images/mercury/loading-light.gif +0 -0
  7. data/{vendor → app}/assets/images/mercury/missing-image.png +0 -0
  8. data/{vendor → app}/assets/images/mercury/search-icon.png +0 -0
  9. data/{vendor → app}/assets/images/mercury/temp-logo.png +0 -0
  10. data/app/assets/images/mercury/toolbar/editable/buttons.png +0 -0
  11. data/app/assets/images/mercury/toolbar/primary/_expander.png +0 -0
  12. data/app/assets/images/mercury/toolbar/primary/_pressed.png +0 -0
  13. data/app/assets/images/mercury/toolbar/primary/action.png +0 -0
  14. data/app/assets/images/mercury/toolbar/primary/historypanel.png +0 -0
  15. data/app/assets/images/mercury/toolbar/primary/insertcharacter.png +0 -0
  16. data/app/assets/images/mercury/toolbar/primary/insertlink.png +0 -0
  17. data/app/assets/images/mercury/toolbar/primary/insertmedia.png +0 -0
  18. data/app/assets/images/mercury/toolbar/primary/inserttable.png +0 -0
  19. data/app/assets/images/mercury/toolbar/primary/inspectorpanel.png +0 -0
  20. data/app/assets/images/mercury/toolbar/primary/notespanel.png +0 -0
  21. data/app/assets/images/mercury/toolbar/primary/preview.png +0 -0
  22. data/app/assets/images/mercury/toolbar/primary/redo.png +0 -0
  23. data/app/assets/images/mercury/toolbar/primary/save.png +0 -0
  24. data/app/assets/images/mercury/toolbar/primary/snippetpanel.png +0 -0
  25. data/app/assets/images/mercury/toolbar/primary/undo.png +0 -0
  26. data/app/assets/images/mercury/toolbar/snippetable/buttons.png +0 -0
  27. data/{vendor → app}/assets/javascripts/mercury.js +4 -0
  28. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery-1.7.js +0 -0
  29. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +0 -0
  30. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.additions.js +0 -0
  31. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +0 -0
  32. data/{vendor → app}/assets/javascripts/mercury/dependencies/liquidmetal.js +0 -0
  33. data/{vendor → app}/assets/javascripts/mercury/dependencies/showdown.js +0 -0
  34. data/{vendor → app}/assets/javascripts/mercury/dialog.js.coffee +0 -0
  35. data/{vendor → app}/assets/javascripts/mercury/dialogs/backcolor.js.coffee +0 -0
  36. data/{vendor → app}/assets/javascripts/mercury/dialogs/forecolor.js.coffee +0 -0
  37. data/{vendor → app}/assets/javascripts/mercury/dialogs/formatblock.js.coffee +0 -0
  38. data/{vendor → app}/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +0 -0
  39. data/{vendor → app}/assets/javascripts/mercury/dialogs/style.js.coffee +0 -0
  40. data/{vendor → app}/assets/javascripts/mercury/finalize.js.coffee +0 -0
  41. data/{vendor → app}/assets/javascripts/mercury/history_buffer.js.coffee +0 -0
  42. data/{vendor → app}/assets/javascripts/mercury/lightview.js.coffee +0 -0
  43. data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +207 -0
  44. data/{vendor → app}/assets/javascripts/mercury/locales/da.locale.js.coffee +7 -7
  45. data/{vendor → app}/assets/javascripts/mercury/locales/de.locale.js.coffee +0 -0
  46. data/{vendor → app}/assets/javascripts/mercury/locales/es.locale.js.coffee +0 -0
  47. data/{vendor → app}/assets/javascripts/mercury/locales/example.local.js.coffee +0 -0
  48. data/{vendor → app}/assets/javascripts/mercury/locales/fr.locale.js.coffee +0 -0
  49. data/{vendor → app}/assets/javascripts/mercury/locales/it.locale.js.coffee +0 -0
  50. data/{vendor → app}/assets/javascripts/mercury/locales/ko.local.js.coffee +0 -0
  51. data/{vendor → app}/assets/javascripts/mercury/locales/nl.locale.js.coffee +0 -0
  52. data/{vendor → app}/assets/javascripts/mercury/locales/pt.locale.js.coffee +0 -0
  53. data/{vendor → app}/assets/javascripts/mercury/locales/sv.local.js.coffee +0 -0
  54. data/{vendor → app}/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +0 -0
  55. data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +209 -0
  56. data/{vendor → app}/assets/javascripts/mercury/mercury.js.coffee +9 -1
  57. data/{vendor → app}/assets/javascripts/mercury/modal.js.coffee +0 -0
  58. data/{vendor → app}/assets/javascripts/mercury/modals/htmleditor.js.coffee +0 -0
  59. data/{vendor → app}/assets/javascripts/mercury/modals/insertcharacter.js.coffee +0 -0
  60. data/{vendor → app}/assets/javascripts/mercury/modals/insertlink.js.coffee +0 -0
  61. data/{vendor → app}/assets/javascripts/mercury/modals/insertmedia.js.coffee +0 -0
  62. data/{vendor → app}/assets/javascripts/mercury/modals/insertsnippet.js.coffee +1 -0
  63. data/{vendor → app}/assets/javascripts/mercury/modals/inserttable.js.coffee +0 -0
  64. data/{vendor → app}/assets/javascripts/mercury/native_extensions.js.coffee +0 -0
  65. data/{vendor → app}/assets/javascripts/mercury/page_editor.js.coffee +46 -19
  66. data/{vendor → app}/assets/javascripts/mercury/palette.js.coffee +0 -0
  67. data/{vendor → app}/assets/javascripts/mercury/panel.js.coffee +2 -2
  68. data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +2 -2
  69. data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +0 -0
  70. data/{vendor → app}/assets/javascripts/mercury/region.js.coffee +0 -0
  71. data/{vendor → app}/assets/javascripts/mercury/regions/editable.js.coffee +5 -5
  72. data/app/assets/javascripts/mercury/regions/image.js.coffee +114 -0
  73. data/{vendor → app}/assets/javascripts/mercury/regions/markupable.js.coffee +0 -0
  74. data/app/assets/javascripts/mercury/regions/simple.js.coffee +325 -0
  75. data/{vendor → app}/assets/javascripts/mercury/regions/snippetable.js.coffee +0 -0
  76. data/{vendor → app}/assets/javascripts/mercury/select.js.coffee +0 -0
  77. data/{vendor → app}/assets/javascripts/mercury/snippet.js.coffee +23 -7
  78. data/{vendor → app}/assets/javascripts/mercury/snippet_toolbar.js.coffee +16 -4
  79. data/{vendor → app}/assets/javascripts/mercury/statusbar.js.coffee +0 -0
  80. data/{vendor → app}/assets/javascripts/mercury/support/history.js +0 -0
  81. data/{vendor → app}/assets/javascripts/mercury/table_editor.js.coffee +0 -0
  82. data/{vendor → app}/assets/javascripts/mercury/toolbar.button.js.coffee +8 -8
  83. data/{vendor → app}/assets/javascripts/mercury/toolbar.button_group.js.coffee +0 -0
  84. data/{vendor → app}/assets/javascripts/mercury/toolbar.expander.js.coffee +0 -0
  85. data/{vendor → app}/assets/javascripts/mercury/toolbar.js.coffee +0 -0
  86. data/{vendor → app}/assets/javascripts/mercury/tooltip.js.coffee +0 -0
  87. data/{vendor → app}/assets/javascripts/mercury/uploader.js.coffee +35 -17
  88. data/{vendor → app}/assets/javascripts/mercury_loader.js +0 -0
  89. data/{vendor → app}/assets/javascripts/mercury_overrides.js +0 -0
  90. data/{vendor → app}/assets/stylesheets/mercury.css +0 -0
  91. data/{vendor → app}/assets/stylesheets/mercury/all_images.css.erb +0 -0
  92. data/app/assets/stylesheets/mercury/buttons.css +73 -0
  93. data/{vendor → app}/assets/stylesheets/mercury/dialog.css +13 -4
  94. data/app/assets/stylesheets/mercury/form.css +125 -0
  95. data/{vendor → app}/assets/stylesheets/mercury/lightview.css +0 -0
  96. data/app/assets/stylesheets/mercury/mercury.css +45 -0
  97. data/{vendor → app}/assets/stylesheets/mercury/modal.css +1 -1
  98. data/{vendor → app}/assets/stylesheets/mercury/statusbar.css +0 -0
  99. data/{vendor → app}/assets/stylesheets/mercury/toolbar.css +0 -0
  100. data/{vendor → app}/assets/stylesheets/mercury/tooltip.css +0 -0
  101. data/{vendor → app}/assets/stylesheets/mercury/uploader.css +0 -0
  102. data/{vendor → app}/assets/stylesheets/mercury_overrides.css +0 -0
  103. data/app/views/mercury/modals/character.html +1 -1
  104. data/app/views/mercury/modals/htmleditor.html +1 -1
  105. data/app/views/mercury/modals/link.html +1 -1
  106. data/app/views/mercury/modals/media.html +1 -1
  107. data/app/views/mercury/modals/table.html +1 -1
  108. data/app/views/mercury/snippets/example/options.html.erb +1 -1
  109. data/features/generators/authentication.feature +10 -0
  110. data/features/generators/images.feature +41 -0
  111. data/features/generators/install.feature +21 -0
  112. data/features/loading/loading.feature +4 -1
  113. data/features/loading/user_interface.feature +9 -7
  114. data/features/regions/editable/basic_editing.feature +27 -26
  115. data/features/regions/editable/inserting_links.feature +8 -7
  116. data/features/regions/editable/inserting_snippets.feature +7 -7
  117. data/features/regions/image/uploading_images.feature +0 -0
  118. data/features/regions/simple/basic_editing.feature +5 -0
  119. data/features/step_definitions/generator_steps.rb +27 -0
  120. data/features/step_definitions/mercury_steps.rb +1 -0
  121. data/features/support/aruba.rb +28 -0
  122. data/features/support/env.rb +12 -2
  123. data/features/support/mercury_contents.rb +2 -2
  124. data/lib/generators/mercury/install/authentication/authentication_generator.rb +15 -0
  125. data/lib/generators/mercury/install/images/images_generator.rb +44 -0
  126. data/{app/models/mercury/image.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image.rb} +3 -1
  127. data/{db/migrate/20110526035601_create_mercury_images.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image_migration.rb} +0 -0
  128. data/{app/controllers/mercury → lib/generators/mercury/install/images/templates}/images_controller.rb +0 -0
  129. data/lib/generators/mercury/install/{templates → images/templates}/mongoid_paperclip_image.rb +0 -0
  130. data/lib/generators/mercury/install/install_generator.rb +3 -20
  131. data/lib/mercury-rails.rb +1 -2
  132. data/lib/mercury/authentication.rb +1 -0
  133. data/lib/mercury/engine.rb +17 -0
  134. data/lib/mercury/rails.rb +4 -0
  135. data/lib/mercury/version.rb +3 -0
  136. data/spec/dummy/Rakefile +7 -0
  137. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  138. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  139. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  140. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  141. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  142. data/spec/dummy/config.ru +4 -0
  143. data/spec/dummy/config/application.rb +57 -0
  144. data/spec/dummy/config/boot.rb +10 -0
  145. data/spec/dummy/config/database.example.yml +25 -0
  146. data/spec/dummy/config/database.travisci.yml +4 -0
  147. data/spec/dummy/config/environment.rb +5 -0
  148. data/spec/dummy/config/environments/development.rb +37 -0
  149. data/spec/dummy/config/environments/production.rb +67 -0
  150. data/spec/dummy/config/environments/test.rb +37 -0
  151. data/spec/dummy/config/evergreen.rb +47 -0
  152. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  153. data/spec/dummy/config/initializers/inflections.rb +15 -0
  154. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  155. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  156. data/spec/dummy/config/initializers/session_store.rb +8 -0
  157. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  158. data/spec/dummy/config/locales/en.yml +5 -0
  159. data/spec/dummy/config/routes.rb +5 -0
  160. data/spec/dummy/public/404.html +26 -0
  161. data/spec/dummy/public/422.html +26 -0
  162. data/spec/dummy/public/500.html +25 -0
  163. data/spec/dummy/public/blank.html +1 -0
  164. data/spec/dummy/public/canvastest.html +103 -0
  165. data/spec/dummy/public/distro.html +349 -0
  166. data/spec/dummy/public/favicon.ico +0 -0
  167. data/spec/dummy/public/frame.html +15 -0
  168. data/spec/dummy/public/images/bunny.gif +0 -0
  169. data/spec/dummy/public/images/bunny2.jpg +0 -0
  170. data/spec/dummy/public/index.html +392 -0
  171. data/spec/dummy/public/prototype.js +6082 -0
  172. data/spec/dummy/script/rails +6 -0
  173. data/spec/javascripts/mercury/page_editor_spec.js.coffee +55 -16
  174. data/spec/javascripts/mercury/panel_spec.js.coffee +2 -4
  175. data/spec/javascripts/mercury/regions/image_spec.js.coffee +34 -0
  176. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +33 -0
  177. data/spec/javascripts/mercury/regions/snippetable_spec.js.coffee +1 -1
  178. data/spec/javascripts/mercury/snippet_spec.js.coffee +27 -2
  179. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +20 -4
  180. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +30 -0
  181. data/spec/javascripts/mercury/uploader_spec.js.coffee +16 -0
  182. data/spec/javascripts/templates/mercury/regions/image.html +1 -0
  183. data/spec/javascripts/templates/mercury/regions/simple.html +3 -0
  184. metadata +310 -158
  185. data/config/engine.rb +0 -41
  186. data/vendor/assets/images/mercury/default-snippet.png +0 -0
  187. data/vendor/assets/images/mercury/toolbar/editable/buttons.png +0 -0
  188. data/vendor/assets/images/mercury/toolbar/primary/_expander.png +0 -0
  189. data/vendor/assets/images/mercury/toolbar/primary/_pressed.png +0 -0
  190. data/vendor/assets/images/mercury/toolbar/primary/historypanel.png +0 -0
  191. data/vendor/assets/images/mercury/toolbar/primary/insertcharacter.png +0 -0
  192. data/vendor/assets/images/mercury/toolbar/primary/insertlink.png +0 -0
  193. data/vendor/assets/images/mercury/toolbar/primary/insertmedia.png +0 -0
  194. data/vendor/assets/images/mercury/toolbar/primary/inserttable.png +0 -0
  195. data/vendor/assets/images/mercury/toolbar/primary/inspectorpanel.png +0 -0
  196. data/vendor/assets/images/mercury/toolbar/primary/notespanel.png +0 -0
  197. data/vendor/assets/images/mercury/toolbar/primary/preview.png +0 -0
  198. data/vendor/assets/images/mercury/toolbar/primary/redo.png +0 -0
  199. data/vendor/assets/images/mercury/toolbar/primary/save.png +0 -0
  200. data/vendor/assets/images/mercury/toolbar/primary/snippetpanel.png +0 -0
  201. data/vendor/assets/images/mercury/toolbar/primary/undo.png +0 -0
  202. data/vendor/assets/images/mercury/toolbar/snippetable/buttons.png +0 -0
  203. data/vendor/assets/stylesheets/mercury/mercury.css +0 -151
@@ -0,0 +1,349 @@
1
+ <html>
2
+ <head>
3
+ <!-- add prototype and styles to ensure that libraries don't collide and css doesn't conflict -->
4
+ <title>Mercury Editor Regression Testing</title>
5
+ <script src="/prototype.js" type="text/javascript"></script>
6
+ <style type="text/css">
7
+ body { border: 1px dotted #000; padding: 10px; }
8
+ input { padding: 20px !important }
9
+ .mercury-toolbar-container { display: none !important }
10
+ </style>
11
+
12
+ <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0">
13
+
14
+ <!-- include the loader -->
15
+ <script src="/assets/mercury/support/history.js" type="text/javascript"></script>
16
+ <script src="/mercury/javascripts/mercury_loader.js?pack=bundled&src=/mercury" type="text/javascript"></script>
17
+
18
+ <!-- preload snippets -->
19
+ <script type="text/javascript">
20
+ // it's worth mentioning that mercury is not loaded in the first request, but should be loaded in the second.
21
+ History.Adapter.bind(window, 'statechange', function() {
22
+ var state = History.getState();
23
+ console.debug(state.data, state.title, state.url);
24
+ });
25
+
26
+ Event.observe(window, "mercury:ready", function() {
27
+ Mercury.saveURL = '/contents';
28
+ Mercury.Snippet.load({
29
+ snippet_0: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "00"}},
30
+ snippet_1: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "01"}},
31
+ snippet_2: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "02"}},
32
+ snippet_3: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "03"}},
33
+ snippet_4: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "04"}},
34
+ snippet_5: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "05"}},
35
+ snippet_6: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "06"}},
36
+ snippet_7: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "07"}},
37
+ snippet_8: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "08"}},
38
+ snippet_9: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "09"}},
39
+ snippet_10: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "10"}},
40
+ snippet_11: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "11"}},
41
+ snippet_12: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "12"}},
42
+ snippet_13: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "13"}}
43
+ });
44
+ })
45
+ </script>
46
+
47
+ <!-- styles for the content layout -->
48
+ <style type="text/css">
49
+ body, td {
50
+ font: normal normal normal 100%/normal 'Helvetica Neue', Helvetica, Arial, sans-serif;
51
+ }
52
+ h1 {
53
+ color: #09F;
54
+ margin: 20px 0 0 0;
55
+ font-weight: 200;
56
+ }
57
+ h2 {
58
+ font-weight: 200;
59
+ margin: 15px 0 0 0;
60
+ border-bottom: 1px solid #CCC;
61
+ }
62
+ #forms form {
63
+ display: inline;
64
+ }
65
+ #content {
66
+ min-width: 500px;
67
+ width: 70%;
68
+ margin: 20px auto;
69
+ }
70
+ #controls {
71
+ position: absolute;
72
+ top: 20px;
73
+ left: 20px;
74
+ padding: 10px;
75
+ margin: 0;
76
+ border: 1px solid #999;
77
+ background: rgba(255, 255, 255, 0.8);
78
+ border-radius: 3px;
79
+ -moz-border-radius: 3px;
80
+ -webkit-border-radius: 3px;
81
+ list-style-type: none;
82
+ }
83
+ #controls div {
84
+ color: #333;
85
+ text-transform: lowercase;
86
+ text-decoration: none;
87
+ cursor: pointer;
88
+ }
89
+ .mercury-snippet {
90
+ background: rgba(0, 0, 0, 0.5);
91
+ color: #FFF;
92
+ width: 300px;
93
+ height: 100px;
94
+ margin: 1px 0;
95
+ border-radius: 3px;
96
+ -moz-border-radius: 3px;
97
+ -webkit-border-radius: 3px;
98
+ }
99
+ #snippetable1 {
100
+ float: left;
101
+ width: 100%;
102
+ margin-bottom: 20px;
103
+ }
104
+ #snippetable1 .mercury-snippet {
105
+ float: left;
106
+ width: 33%;
107
+ border: 1px solid #000;
108
+ }
109
+ </style>
110
+ </head>
111
+ <body>
112
+
113
+ <div id="content">
114
+
115
+ <ul id="controls">
116
+ <li><div onclick="alert(Mercury.version)">Mercury Version</div></li>
117
+ <li><div onclick="Mercury.trigger('toggle:interface')">Toggle Interface</div></li>
118
+ <li><div onclick="var num = 1; History.pushState({state: num}, 'Mercury Editor -- With history.pushState!', '?pushstate=' + num);">history.pushState</div></li>
119
+ <li><div onclick="History.go(-1);">History.go(-1)</div></li>
120
+ <li><div onclick="History.back();">History.back()</div></li>
121
+ <li><div onclick="History.forward();">History.forward()</div></li>
122
+ </ul>
123
+
124
+ <h1>Forms (with various methods and targets)</h1>
125
+ <div id="forms">
126
+ <form id="form1" action="/mercury/test_page" method="post" target="_top">
127
+ <input type="submit" name="commit" value="post _top">
128
+ </form>
129
+ <form id="form2" action="/mercury/test_page" method="get" target="_blank">
130
+ <input type="submit" name="commit" value="post _blank">
131
+ </form>
132
+ <form id="form3" action="/mercury/test_page" method="post" target="_self">
133
+ <input type="submit" name="commit" value="post _self">
134
+ </form>
135
+ <form id="form4" action="/mercury/test_page" method="get">
136
+ <input type="submit" name="commit" value="get [none]">
137
+ </form>
138
+ <form id="form5" action="/mercury/test_page" method="post" class="lightview" target="_self">
139
+ <input type="submit" name="commit" value="post _self .lightview">
140
+ </form>
141
+ <form id="form6" action="/mercury/test_page" method="get" target="foo">
142
+ <input type="submit" name="commit" value="get foo">
143
+ </form>
144
+ </div>
145
+
146
+ <h1>Links (With various targets)</h1>
147
+ <div id="links">
148
+ <a id="anchor1" href="/mercury/test_page" target="_top">_top</a>
149
+ <a id="anchor2" href="/mercury/test_page" target="_blank">_blank</a>
150
+ <a id="anchor3" href="/mercury/test_page" target="_self">_self</a>
151
+ <a id="anchor4" href="/mercury/test_page">[none]</a>
152
+ <a id="anchor5" href="/mercury/test_page" class="lightview" target="_self">_self .lightview</a>
153
+ <a id="anchor6" href="/mercury/test_page" target="foo">foo</a>
154
+ </div>
155
+
156
+ <h1>Editable region</h1>
157
+ <div id="editable1" class="mercury-region" data-type="editable">
158
+ If the first line of content isn't wrapped in an element you can't set justification (mozilla only bug).
159
+
160
+ <h2>text with a meta tag (that will be removed)</h2>
161
+ 123<meta>editable content
162
+
163
+ <h2>anchor with a div inside</h2>
164
+ <a href="/foo1">l<div>ink with a div in</div> it</a>
165
+
166
+ <h2>image wrapped in an anchor</h2>
167
+ <a href="/foo2"><img alt="logo" src="/assets/mercury/temp-logo.png"></a>123
168
+
169
+ <h2>table with header and definition cells</h2>
170
+ <table border="1">
171
+ <tbody>
172
+ <tr>
173
+ <th>R1C1</th>
174
+ <th colspan="5">R1C2</th>
175
+ </tr>
176
+ <tr>
177
+ <th colspan="2">R2C1</th>
178
+ <th rowspan="2">R2C2</th>
179
+ <th>R2C3</th>
180
+ <th rowspan="5">R2C4</th>
181
+ <th>R2C5</th>
182
+ </tr>
183
+ <tr>
184
+ <td colspan="2">R3C1</td>
185
+ <td>R3C2</td>
186
+ <td>R3C3</td>
187
+ </tr>
188
+ <tr>
189
+ <td>R4C1</td>
190
+ <td>R4C2</td>
191
+ <td rowspan="4">R4C3</td>
192
+ <td>R4C4</td>
193
+ <td>R4C5</td>
194
+ </tr>
195
+ <tr>
196
+ <td>R5C1</td>
197
+ <td>R5C2</td>
198
+ <td>R5C3</td>
199
+ <td>R5C4</td>
200
+ </tr>
201
+ <tr>
202
+ <th rowspan="2">R6C1</th>
203
+ <th rowspan="2">R6C2</th>
204
+ <th>R6C3</th>
205
+ <th>R6C4</th>
206
+ </tr>
207
+ <tr>
208
+ <td>R7C1</td>
209
+ <td>R7C2</td>
210
+ <td>R7C3</td>
211
+ </tr>
212
+ <tr>
213
+ <td colspan="2">R8C1</td>
214
+ <td colspan="4">R7C2</td>
215
+ </tr>
216
+ </tbody>
217
+ </table>
218
+
219
+ <h2>table without tbody or border</h2>
220
+ <table>
221
+ <tr>
222
+ <th>R1C1</th>
223
+ <th colspan="2">R1C2</th>
224
+ </tr>
225
+ <tr>
226
+ <td rowspan="2">R2C1</td>
227
+ <td>R2C2</td>
228
+ <td>R2C3</td>
229
+ </tr>
230
+ <tr>
231
+ <td>R3C1</td>
232
+ <td>R3C2</td>
233
+ </tr>
234
+ </table>
235
+
236
+ <h2>fixed width table (column where all colspans > 1, row where all rowspans > 1)</h2>
237
+ <table border="1" width="200">
238
+ <tbody>
239
+ <tr>
240
+ <td rowspan="2">R1C1</td>
241
+ <td colspan="2" rowspan="2">R1C2</td>
242
+ </tr>
243
+ <tr></tr>
244
+ <tr>
245
+ <td>R3C1</td>
246
+ <td colspan="2">R3C2</td>
247
+ </tr>
248
+ <tr>
249
+ <td>R4C1</td>
250
+ <td colspan="2">R4C3</td>
251
+ </tr>
252
+ </tbody>
253
+ </table>
254
+
255
+ <h2>paragraph with an overline wrapped in an underline</h2>
256
+ <p>123 <u>under <span style="text-decoration:overline">overline</span> line</u> 123</p>
257
+
258
+ <h2>paragraph with an underline wrapped in an overline</h2>
259
+ <p>123 <span style="text-decoration:overline">over <u>underline</u> line</span> 123</p>
260
+
261
+ <h2>style tag that styles images with a border</h2>
262
+ <style type="text/css">img { border: 2px solid red}</style>
263
+
264
+ <h2>image next to content wrapped in an anchor</h2>
265
+ <img alt="logo" src="/assets/mercury/temp-logo.png"><a href="#bookmark1">link for #bookmark1</a>
266
+
267
+ <h2>snippet that's pre-loaded</h2>
268
+ <div class="mercury-snippet" data-snippet="snippet_0">snippet0</div>
269
+
270
+ <h2>bookmark links</h2>
271
+ <a name="bookmark1">Bookmark1</a><br/><a name="bookmark2">Bookmark2</a>
272
+
273
+ <br/><br/>
274
+ Additional content not wrapped in anything
275
+
276
+ <h2>youtube and vimeo iframes with content surrounding it</h2>
277
+ <!--123<iframe style="width: 560px; height: 349px; " src="http://www.youtube.com/embed/0pXYp72dwl0?wmode=transparent" frameborder="0" allowfullscreen="true"></iframe>123321-->
278
+ <!--<iframe style="width: 400px; height: 225px; " src="http://player.vimeo.com/video/615344?title=1&amp;byline=1&amp;portrait=0&amp;color=ffffff" frameborder="0"></iframe>123-->
279
+ </div>
280
+
281
+ <h1>Markupable region (with markdown)</h1>
282
+ <div id="markupable1" class="mercury-region" data-type="markupable">
283
+ ## notes ##
284
+ **whitespace** in markupable regions is _important_.
285
+
286
+ ## ordered list ##
287
+ 1. list item 1
288
+ 2. list item 2
289
+
290
+ ## unordered list ##
291
+ - list item 1
292
+ - list item 2
293
+
294
+ ## horizontal rule ##
295
+ - - -
296
+
297
+ ## anchor ##
298
+ [this is a link](foo 'optional title')
299
+
300
+ ## image ##
301
+ ![add alt text](/assets/mercury/temp-logo.png)
302
+
303
+ ## snippet that's pre-loaded ##
304
+ [--snippet_1--]
305
+
306
+ ## code ##
307
+ <a href="/foo">this html will not be escaped</a>
308
+ and whitespace will be retained
309
+
310
+ ## blockquote ##
311
+ > this is indented one level
312
+
313
+ ## paragraph with bold, italics, etc. ##
314
+ Turkey corned beef ham, chuck ham hock **venison _drumstick_ ** tongue ribeye. Beef tongue pancetta, short ribs meatball headcheese jowl bacon swine t-bone shoulder venison. Hamburger short loin turkey flank short ribs tail. Chicken tri-tip sausage, bresaola sirloin turkey hamburger <sub>headcheese</sub> shank rump. Pork ground round t-bone, ham hock sirloin biltong chicken fatback pork belly pastrami pancetta jowl tail. Cow ribeye pork chop, flank sirloin tail short loin pork loin chicken boudin pastrami. Boudin chuck shankle, spare ribs pancetta <sup>fatback</sup> bresaola.
315
+ </div>
316
+
317
+ <h1>Snippetable region</h1>
318
+ <div id="snippetable1" class="mercury-region" data-type="snippetable">
319
+ <div class="mercury-snippet" data-snippet="snippet_2">snippet2</div>
320
+ <div class="mercury-snippet" data-snippet="snippet_3">snippet3</div>
321
+ <div class="mercury-snippet" data-snippet="snippet_4">snippet4</div>
322
+ <div class="mercury-snippet" data-snippet="snippet_5">snippet5</div>
323
+ <div class="mercury-snippet" data-snippet="snippet_6">snippet6</div>
324
+ <div class="mercury-snippet" data-snippet="snippet_7">snippet7</div>
325
+ <div class="mercury-snippet" data-snippet="snippet_8">snippet8</div>
326
+ <div class="mercury-snippet" data-snippet="snippet_9">snippet9</div>
327
+ </div>
328
+
329
+ <h1>Editable region (single snippet and no content)</h1>
330
+ <div id="editable2" class="mercury-region" data-type="editable">
331
+ <div class="mercury-snippet" data-snippet="snippet_10">snippet10</div>
332
+ </div>
333
+
334
+ <h1>Editable region (fixed width/height and overflow)</h1>
335
+ <div id="editable3" class="mercury-region" data-type="editable" style="width:200px;height:90px;">
336
+ wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
337
+ <br/>1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/><a href="#offset_test">8</a><br/>9<br/>10<br/>11<br/>12<br/>13<br/>14<br/>15
338
+ </div>
339
+
340
+ <h1>Snippetable region (iframe snippet that contains flash)</h1>
341
+ <div id="snippetable2" class="mercury-region" data-type="snippetable">
342
+ <div class="mercury-snippet" data-snippet="snippet_11">snippet11</div>
343
+ <div class="mercury-snippet" data-snippet="snippet_12">snippet12</div>
344
+ <iframe class="mercury-snippet" data-snippet="snippet_13" width="560" height="349" src="http://www.youtube.com/embed/0pXYp72dwl0?wmode=transparent" frameborder="0" allowfullscreen="true"></iframe>
345
+ </div>
346
+ </div>
347
+
348
+ </body>
349
+ </html>
File without changes
@@ -0,0 +1,15 @@
1
+ <html>
2
+ <head>
3
+ <!-- add prototype and styles to ensure that libraries don't collide and css doesn't conflict -->
4
+ <title>Mercury Editor Regression Testing</title>
5
+ <style type="text/css">
6
+ html, body {
7
+ padding: 0;
8
+ margin: 0;
9
+ }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <iframe src="/editor" width="100%" height="300"></iframe>
14
+ </body>
15
+ </html>
Binary file
Binary file
@@ -0,0 +1,392 @@
1
+ <html>
2
+ <head>
3
+ <!-- add prototype and styles to ensure that libraries don't collide and css doesn't conflict -->
4
+ <title>Mercury Editor Regression Testing</title>
5
+ <script src="/prototype.js" type="text/javascript"></script>
6
+ <style type="text/css">
7
+ body { border: 1px dotted #000; padding: 10px; }
8
+ input { padding: 20px !important }
9
+ .mercury-toolbar-container { display: none !important }
10
+ </style>
11
+
12
+ <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0">
13
+
14
+ <!-- include the loader -->
15
+ <script src="/assets/mercury/support/history.js" type="text/javascript"></script>
16
+ <script src="/assets/mercury_loader.js" type="text/javascript"></script>
17
+
18
+ <!-- preload snippets -->
19
+ <script type="text/javascript">
20
+ // it's worth mentioning that mercury is not loaded in the first request, but should be loaded in the second.
21
+ History.Adapter.bind(window, 'statechange', function() {
22
+ var state = History.getState();
23
+ console.debug(state.data, state.title, state.url);
24
+ });
25
+
26
+ Event.observe(window, "mercury:ready", function() {
27
+ Mercury.saveURL = '/contents';
28
+ Mercury.Snippet.load({
29
+ snippet_0: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "00"}},
30
+ snippet_1: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "01"}},
31
+ snippet_2: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "02"}},
32
+ snippet_3: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "03"}},
33
+ snippet_4: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "04"}},
34
+ snippet_5: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "05"}},
35
+ snippet_6: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "06"}},
36
+ snippet_7: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "07"}},
37
+ snippet_8: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "08"}},
38
+ snippet_9: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "09"}},
39
+ snippet_10: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "10"}},
40
+ snippet_11: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "11"}},
41
+ snippet_12: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "12"}},
42
+ snippet_13: {name: 'example', options: {'options[favorite_beer]': "Bells Hopslam", 'options[first_name]': "13"}}
43
+ });
44
+ });
45
+
46
+ var newRegionIndex = 1;
47
+ var newRegionType = 0;
48
+ var regionTypes = ['editable', 'markupable', 'snippetable'];
49
+ function addRegion() {
50
+ if (newRegionType >= regionTypes.length) newRegionType = 0;
51
+ var container = new Element('div', {style: 'position:relative;margin-bottom:20px;'});
52
+ container.update('<div class="remove" onclick="this.up().remove()">&times;</div><div class="mercury-region" id="new_' + regionTypes[newRegionType] + '_' + newRegionIndex + '" data-type="' + regionTypes[newRegionType] + '">new <b>' + regionTypes[newRegionType] + '</b> region ' + newRegionIndex + '</div>');
53
+ $('content').insertBefore(container, $('dynamic_regions'));
54
+ Mercury.trigger('reinitialize');
55
+ newRegionIndex += 1;
56
+ newRegionType += 1;
57
+ }
58
+ </script>
59
+
60
+ <!-- styles for the content layout -->
61
+ <style type="text/css">
62
+ body, td {
63
+ font: normal normal normal 100%/normal 'Helvetica Neue', Helvetica, Arial, sans-serif;
64
+ }
65
+ h1 {
66
+ color: #09F;
67
+ margin: 20px 0 0 0;
68
+ font-weight: 200;
69
+ }
70
+ h2 {
71
+ font-weight: 200;
72
+ margin: 15px 0 0 0;
73
+ border-bottom: 1px solid #CCC;
74
+ }
75
+ #forms form {
76
+ display: inline;
77
+ }
78
+ #content {
79
+ min-width: 500px;
80
+ width: 70%;
81
+ margin: 20px auto;
82
+ }
83
+ #controls {
84
+ position: absolute;
85
+ top: 20px;
86
+ left: 20px;
87
+ padding: 10px;
88
+ margin: 0;
89
+ border: 1px solid #999;
90
+ background: rgba(255, 255, 255, 0.8);
91
+ border-radius: 3px;
92
+ -moz-border-radius: 3px;
93
+ -webkit-border-radius: 3px;
94
+ list-style-type: none;
95
+ }
96
+ #controls div {
97
+ color: #333;
98
+ text-transform: lowercase;
99
+ text-decoration: none;
100
+ cursor: pointer;
101
+ }
102
+ .mercury-snippet {
103
+ background: rgba(0, 0, 0, 0.5);
104
+ color: #FFF;
105
+ width: 300px;
106
+ height: 100px;
107
+ margin: 1px 0;
108
+ border-radius: 3px;
109
+ -moz-border-radius: 3px;
110
+ -webkit-border-radius: 3px;
111
+ }
112
+ #snippetable1 {
113
+ float: left;
114
+ width: 100%;
115
+ margin-bottom: 20px;
116
+ }
117
+ #snippetable1 .mercury-snippet {
118
+ float: left;
119
+ width: 33%;
120
+ border: 1px solid #000;
121
+ }
122
+ div.remove {
123
+ position: absolute;
124
+ right: 0;
125
+ top: -10px;
126
+ border: 1px solid red;
127
+ border-radius: 50px;
128
+ -moz-border-radius: 50px;
129
+ -webkit-border-radius: 50px;
130
+ background: #600;
131
+ color: #FFF;
132
+ width: 20px;
133
+ height: 20px;
134
+ line-height: 18px;
135
+ text-align: center;
136
+ cursor: pointer;
137
+ }
138
+ </style>
139
+ </head>
140
+ <body>
141
+
142
+ <div id="content">
143
+
144
+ <ul id="controls">
145
+ <li><div onclick="alert(Mercury.version)">Mercury Version</div></li>
146
+ <li><div onclick="Mercury.trigger('toggle:interface')">Toggle Interface</div></li>
147
+ <li><div onclick="addRegion()">Add & Reinitialize Regions</div></li>
148
+ <li><div onclick="var num = 1; History.pushState({state: num}, 'Mercury Editor -- With history.pushState!', '?pushstate=' + num);">history.pushState</div></li>
149
+ <li><div onclick="History.go(-1);">History.go(-1)</div></li>
150
+ <li><div onclick="History.back();">History.back()</div></li>
151
+ <li><div onclick="History.forward();">History.forward()</div></li>
152
+ </ul>
153
+
154
+ <h1>Forms (with various methods and targets)</h1>
155
+ <div id="forms">
156
+ <form id="form1" action="/mercury/test_page" method="post" target="_top">
157
+ <input type="submit" name="commit" value="post _top">
158
+ </form>
159
+ <form id="form2" action="/mercury/test_page" method="get" target="_blank">
160
+ <input type="submit" name="commit" value="post _blank">
161
+ </form>
162
+ <form id="form3" action="/mercury/test_page" method="post" target="_self">
163
+ <input type="submit" name="commit" value="post _self">
164
+ </form>
165
+ <form id="form4" action="/mercury/test_page" method="get">
166
+ <input type="submit" name="commit" value="get [none]">
167
+ </form>
168
+ <form id="form5" action="/mercury/test_page" method="post" class="lightview" target="_self">
169
+ <input type="submit" name="commit" value="post _self .lightview">
170
+ </form>
171
+ <form id="form6" action="/mercury/test_page" method="get" target="foo">
172
+ <input type="submit" name="commit" value="get foo">
173
+ </form>
174
+ </div>
175
+
176
+ <h1>Links (With various targets)</h1>
177
+ <div id="links">
178
+ <a id="anchor1" href="/mercury/test_page" target="_top">_top</a>
179
+ <a id="anchor2" href="/mercury/test_page" target="_blank">_blank</a>
180
+ <a id="anchor3" href="/mercury/test_page" target="_self">_self</a>
181
+ <a id="anchor4" href="/mercury/test_page">[none]</a>
182
+ <a id="anchor5" href="/mercury/test_page" class="lightview" target="_self">_self .lightview</a>
183
+ <a id="anchor6" href="/mercury/test_page" target="foo">foo</a>
184
+ </div>
185
+
186
+ <h1>Dynamic Regions</h1>
187
+ <div id="dynamic_regions"></div>
188
+
189
+ <h1>Editable region</h1>
190
+ <div id="editable1" class="mercury-region" data-type="editable">
191
+ If the first line of content isn't wrapped in an element you can't set justification (mozilla only bug).
192
+
193
+ <h2>text with a meta tag (that will be removed)</h2>
194
+ 123<meta>editable content
195
+
196
+ <h2>anchor with a div inside</h2>
197
+ <a href="/foo1">l<div>ink with a div in</div> it</a>
198
+
199
+ <h2>image wrapped in an anchor</h2>
200
+ <a href="/foo2"><img alt="logo" src="/assets/mercury/temp-logo.png"></a>123
201
+
202
+ <h2>table with header and definition cells</h2>
203
+ <table border="1">
204
+ <tbody>
205
+ <tr>
206
+ <th>R1C1</th>
207
+ <th colspan="5">R1C2</th>
208
+ </tr>
209
+ <tr>
210
+ <th colspan="2">R2C1</th>
211
+ <th rowspan="2">R2C2</th>
212
+ <th>R2C3</th>
213
+ <th rowspan="5">R2C4</th>
214
+ <th>R2C5</th>
215
+ </tr>
216
+ <tr>
217
+ <td colspan="2">R3C1</td>
218
+ <td>R3C2</td>
219
+ <td>R3C3</td>
220
+ </tr>
221
+ <tr>
222
+ <td>R4C1</td>
223
+ <td>R4C2</td>
224
+ <td rowspan="4">R4C3</td>
225
+ <td>R4C4</td>
226
+ <td>R4C5</td>
227
+ </tr>
228
+ <tr>
229
+ <td>R5C1</td>
230
+ <td>R5C2</td>
231
+ <td>R5C3</td>
232
+ <td>R5C4</td>
233
+ </tr>
234
+ <tr>
235
+ <th rowspan="2">R6C1</th>
236
+ <th rowspan="2">R6C2</th>
237
+ <th>R6C3</th>
238
+ <th>R6C4</th>
239
+ </tr>
240
+ <tr>
241
+ <td>R7C1</td>
242
+ <td>R7C2</td>
243
+ <td>R7C3</td>
244
+ </tr>
245
+ <tr>
246
+ <td colspan="2">R8C1</td>
247
+ <td colspan="4">R7C2</td>
248
+ </tr>
249
+ </tbody>
250
+ </table>
251
+
252
+ <h2>table without tbody or border</h2>
253
+ <table>
254
+ <tr>
255
+ <th>R1C1</th>
256
+ <th colspan="2">R1C2</th>
257
+ </tr>
258
+ <tr>
259
+ <td rowspan="2">R2C1</td>
260
+ <td>R2C2</td>
261
+ <td>R2C3</td>
262
+ </tr>
263
+ <tr>
264
+ <td>R3C1</td>
265
+ <td>R3C2</td>
266
+ </tr>
267
+ </table>
268
+
269
+ <h2>fixed width table (column where all colspans > 1, row where all rowspans > 1)</h2>
270
+ <table border="1" width="200">
271
+ <tbody>
272
+ <tr>
273
+ <td rowspan="2">R1C1</td>
274
+ <td colspan="2" rowspan="2">R1C2</td>
275
+ </tr>
276
+ <tr></tr>
277
+ <tr>
278
+ <td>R3C1</td>
279
+ <td colspan="2">R3C2</td>
280
+ </tr>
281
+ <tr>
282
+ <td>R4C1</td>
283
+ <td colspan="2">R4C3</td>
284
+ </tr>
285
+ </tbody>
286
+ </table>
287
+
288
+ <h2>paragraph with an overline wrapped in an underline</h2>
289
+ <p>123 <u>under <span style="text-decoration:overline">overline</span> line</u> 123</p>
290
+
291
+ <h2>paragraph with an underline wrapped in an overline</h2>
292
+ <p>123 <span style="text-decoration:overline">over <u>underline</u> line</span> 123</p>
293
+
294
+ <h2>style tag that styles images with a border</h2>
295
+ <style type="text/css">img { border: 2px solid red}</style>
296
+
297
+ <h2>image next to content wrapped in an anchor</h2>
298
+ <img alt="clippy" src="/assets/mercury/temp-logo.png"><a href="#bookmark1">link for #bookmark1</a>
299
+
300
+ <h2>snippet that's pre-loaded</h2>
301
+ <div class="mercury-snippet" data-snippet="snippet_0">snippet0</div>
302
+
303
+ <h2>bookmark links</h2>
304
+ <a name="bookmark1">Bookmark1</a><br/><a name="bookmark2">Bookmark2</a>
305
+
306
+ <br/><br/>
307
+ Additional content not wrapped in anything
308
+
309
+ <h2>youtube and vimeo iframes with content surrounding it</h2>
310
+ <!--123<iframe style="width: 560px; height: 349px; " src="http://www.youtube.com/embed/0pXYp72dwl0?wmode=transparent" frameborder="0" allowfullscreen="true"></iframe>123321-->
311
+ <!--<iframe style="width: 400px; height: 225px; " src="http://player.vimeo.com/video/615344?title=1&amp;byline=1&amp;portrait=0&amp;color=ffffff" frameborder="0"></iframe>123-->
312
+ </div>
313
+
314
+ <h1>Snippetable region</h1>
315
+ <div id="snippetable1" class="mercury-region" data-type="snippetable">
316
+ <div class="mercury-snippet" data-snippet="snippet_2">snippet2</div>
317
+ <div class="mercury-snippet" data-snippet="snippet_3">snippet3</div>
318
+ <div class="mercury-snippet" data-snippet="snippet_4">snippet4</div>
319
+ <div class="mercury-snippet" data-snippet="snippet_5">snippet5</div>
320
+ <div class="mercury-snippet" data-snippet="snippet_6">snippet6</div>
321
+ <div class="mercury-snippet" data-snippet="snippet_7">snippet7</div>
322
+ <div class="mercury-snippet" data-snippet="snippet_8">snippet8</div>
323
+ <div class="mercury-snippet" data-snippet="snippet_9">snippet9</div>
324
+ </div>
325
+
326
+ <h1>Editable region (single snippet and no content)</h1>
327
+ <div id="editable2" class="mercury-region" data-type="editable">
328
+ <div class="mercury-snippet" data-snippet="snippet_10">snippet10</div>
329
+ </div>
330
+
331
+ <h1>Snippetable region (iframe snippet that contains flash)</h1>
332
+ <div id="snippetable2" class="mercury-region" data-type="snippetable">
333
+ <div class="mercury-snippet" data-snippet="snippet_11">snippet11</div>
334
+ <div class="mercury-snippet" data-snippet="snippet_12">snippet12</div>
335
+ <iframe class="mercury-snippet" data-snippet="snippet_13" width="560" height="349" src="http://www.youtube.com/embed/0pXYp72dwl0?wmode=transparent" frameborder="0" allowfullscreen="true"></iframe>
336
+ </div>
337
+
338
+ <h1>Markupable region (with markdown)</h1>
339
+ <div id="markupable1" class="mercury-region" data-type="markupable">
340
+ ## notes ##
341
+ **whitespace** in markupable regions is _important_.
342
+
343
+ ## ordered list ##
344
+ 1. list item 1
345
+ 2. list item 2
346
+
347
+ ## unordered list ##
348
+ - list item 1
349
+ - list item 2
350
+
351
+ ## horizontal rule ##
352
+ - - -
353
+
354
+ ## anchor ##
355
+ [this is a link](foo 'optional title')
356
+
357
+ ## image ##
358
+ ![add alt text](/assets/mercury/temp-logo.png)
359
+
360
+ ## snippet that's pre-loaded ##
361
+ [--snippet_1--]
362
+
363
+ ## code ##
364
+ <a href="/foo">this html will not be escaped</a>
365
+ and whitespace will be retained
366
+
367
+ ## blockquote ##
368
+ > this is indented one level
369
+
370
+ ## paragraph with bold, italics, etc. ##
371
+ Turkey corned beef ham, chuck ham hock **venison _drumstick_ ** tongue ribeye. Beef tongue pancetta, short ribs meatball headcheese jowl bacon swine t-bone shoulder venison. Hamburger short loin turkey flank short ribs tail. Chicken tri-tip sausage, bresaola sirloin turkey hamburger <sub>headcheese</sub> shank rump. Pork ground round t-bone, ham hock sirloin biltong chicken fatback pork belly pastrami pancetta jowl tail. Cow ribeye pork chop, flank sirloin tail short loin pork loin chicken boudin pastrami. Boudin chuck shankle, spare ribs pancetta <sup>fatback</sup> bresaola.
372
+ </div>
373
+
374
+ <h1>Editable region (fixed width/height and overflow)</h1>
375
+ <div id="editable3" class="mercury-region" data-type="editable" style="width:200px;height:90px;">
376
+ wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
377
+ <br/>1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/><a href="#offset_test">8</a><br/>9<br/>10<br/>11<br/>12<br/>13<br/>14<br/>15
378
+ </div>
379
+
380
+ <h1>Simple region (h1 tag)</h1>
381
+ <h1 id="simple-field" class="mercury-region" data-type="simple">This is a simple editable field</h1>
382
+
383
+ <h1>Simple region (h2 tag with wrapping)</h1>
384
+ <h2 id="simple-field-wrapping" class="mercury-region" data-type="simple" style="width:200px">This is a simple editable field which is much longer. It should wrap when displaying, and when editing.</h2>
385
+
386
+ <h1>Image region</h1>
387
+ <img id="bunny-image" class="mercury-region" data-type="image" src="/images/bunny.gif" />
388
+
389
+ </div>
390
+
391
+ </body>
392
+ </html>