kiteditor 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. data/POST_INSTALL +21 -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/tools.png +0 -0
  26. data/app/assets/images/mercury/toolbar/primary/undo.png +0 -0
  27. data/app/assets/images/mercury/toolbar/primary/user.png +0 -0
  28. data/app/assets/images/mercury/toolbar/snippets/buttons.png +0 -0
  29. data/{vendor/assets/javascripts/mercury/dependencies → app/assets/javascripts}/jquery-1.7.js +0 -0
  30. data/{vendor → app}/assets/javascripts/mercury.js +60 -87
  31. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery-ui-1.8.13.custom.js +0 -0
  32. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.additions.js +103 -13
  33. data/{vendor → app}/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +0 -0
  34. data/{vendor → app}/assets/javascripts/mercury/dependencies/liquidmetal.js +0 -0
  35. data/{vendor → app}/assets/javascripts/mercury/dependencies/showdown.js +0 -0
  36. data/{vendor → app}/assets/javascripts/mercury/dialog.js.coffee +0 -0
  37. data/{vendor → app}/assets/javascripts/mercury/dialogs/backcolor.js.coffee +0 -0
  38. data/{vendor → app}/assets/javascripts/mercury/dialogs/forecolor.js.coffee +1 -1
  39. data/{vendor → app}/assets/javascripts/mercury/dialogs/formatblock.js.coffee +0 -0
  40. data/{vendor → app}/assets/javascripts/mercury/dialogs/snippetpanel.js.coffee +1 -1
  41. data/{vendor → app}/assets/javascripts/mercury/dialogs/style.js.coffee +0 -0
  42. data/{vendor → app}/assets/javascripts/mercury/finalize.js.coffee +0 -0
  43. data/{vendor → app}/assets/javascripts/mercury/history_buffer.js.coffee +0 -0
  44. data/{vendor → app}/assets/javascripts/mercury/lightview.js.coffee +38 -17
  45. data/app/assets/javascripts/mercury/locales/ar.locale.js.coffee +201 -0
  46. data/app/assets/javascripts/mercury/locales/da.locale.js.coffee +208 -0
  47. data/{vendor → app}/assets/javascripts/mercury/locales/de.locale.js.coffee +4 -10
  48. data/{vendor → app}/assets/javascripts/mercury/locales/es.locale.js.coffee +3 -9
  49. data/{vendor → app}/assets/javascripts/mercury/locales/example.local.js.coffee +3 -5
  50. data/{vendor → app}/assets/javascripts/mercury/locales/fr.locale.js.coffee +3 -9
  51. data/app/assets/javascripts/mercury/locales/hu.locale.js.coffee +209 -0
  52. data/{vendor → app}/assets/javascripts/mercury/locales/it.locale.js.coffee +3 -9
  53. data/{vendor → app}/assets/javascripts/mercury/locales/ko.local.js.coffee +4 -10
  54. data/{vendor → app}/assets/javascripts/mercury/locales/nl.locale.js.coffee +3 -9
  55. data/app/assets/javascripts/mercury/locales/pl.locale.js.coffee +213 -0
  56. data/{vendor → app}/assets/javascripts/mercury/locales/pt.locale.js.coffee +3 -9
  57. data/app/assets/javascripts/mercury/locales/ru.locale.js.coffee +200 -0
  58. data/{vendor → app}/assets/javascripts/mercury/locales/sv.local.js.coffee +3 -9
  59. data/{vendor → app}/assets/javascripts/mercury/locales/swedish_chef.locale.js.coffee +3 -9
  60. data/app/assets/javascripts/mercury/locales/uk.locale.js.coffee +200 -0
  61. data/app/assets/javascripts/mercury/locales/zh.local.js.coffee +203 -0
  62. data/app/assets/javascripts/mercury/mercury-compiled.js +10720 -0
  63. data/{vendor → app}/assets/javascripts/mercury/mercury.js.coffee +10 -1
  64. data/{vendor → app}/assets/javascripts/mercury/modal.js.coffee +62 -40
  65. data/{vendor → app}/assets/javascripts/mercury/modals/htmleditor.js.coffee +1 -0
  66. data/{vendor → app}/assets/javascripts/mercury/modals/insertcharacter.js.coffee +1 -0
  67. data/app/assets/javascripts/mercury/modals/insertlink.js.coffee +152 -0
  68. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +132 -0
  69. data/{vendor → app}/assets/javascripts/mercury/modals/insertsnippet.js.coffee +2 -0
  70. data/app/assets/javascripts/mercury/modals/inserttable.js.coffee +68 -0
  71. data/{vendor → app}/assets/javascripts/mercury/native_extensions.js.coffee +0 -6
  72. data/{vendor → app}/assets/javascripts/mercury/page_editor.js.coffee +84 -50
  73. data/{vendor → app}/assets/javascripts/mercury/palette.js.coffee +1 -1
  74. data/{vendor → app}/assets/javascripts/mercury/panel.js.coffee +3 -2
  75. data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +2 -2
  76. data/{vendor → app}/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +0 -0
  77. data/{vendor → app}/assets/javascripts/mercury/region.js.coffee +18 -17
  78. data/{vendor/assets/javascripts/mercury/regions/editable.js.coffee → app/assets/javascripts/mercury/regions/full.js.coffee} +41 -31
  79. data/app/assets/javascripts/mercury/regions/image.js.coffee +93 -0
  80. data/{vendor/assets/javascripts/mercury/regions/markupable.js.coffee → app/assets/javascripts/mercury/regions/markdown.js.coffee} +29 -24
  81. data/{vendor → app}/assets/javascripts/mercury/regions/simple.js.coffee +11 -54
  82. data/{vendor/assets/javascripts/mercury/regions/snippetable.js.coffee → app/assets/javascripts/mercury/regions/snippets.js.coffee} +10 -9
  83. data/{vendor → app}/assets/javascripts/mercury/select.js.coffee +1 -1
  84. data/app/assets/javascripts/mercury/snippet.js.coffee +136 -0
  85. data/{vendor → app}/assets/javascripts/mercury/snippet_toolbar.js.coffee +19 -6
  86. data/{vendor → app}/assets/javascripts/mercury/statusbar.js.coffee +0 -0
  87. data/{vendor → app}/assets/javascripts/mercury/support/history.js +0 -0
  88. data/{vendor → app}/assets/javascripts/mercury/table_editor.js.coffee +16 -0
  89. data/{vendor → app}/assets/javascripts/mercury/toolbar.button.js.coffee +45 -30
  90. data/{vendor → app}/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  91. data/{vendor → app}/assets/javascripts/mercury/toolbar.expander.js.coffee +4 -4
  92. data/{vendor → app}/assets/javascripts/mercury/toolbar.js.coffee +10 -6
  93. data/{vendor → app}/assets/javascripts/mercury/tooltip.js.coffee +0 -0
  94. data/{vendor → app}/assets/javascripts/mercury/uploader.js.coffee +37 -19
  95. data/app/assets/stylesheets/_mercury-bootstrap-overrides.scss +61 -0
  96. data/app/assets/stylesheets/_mercury-sass.scss +33 -0
  97. data/{vendor → app}/assets/stylesheets/mercury.css +1 -5
  98. data/{vendor → app}/assets/stylesheets/mercury/all_images.css.erb +6 -2
  99. data/app/assets/stylesheets/mercury/bootstrap-ish.css +1367 -0
  100. data/app/assets/stylesheets/mercury/bootstrap-overrides.css +61 -0
  101. data/{vendor → app}/assets/stylesheets/mercury/dialog.css +21 -8
  102. data/{vendor → app}/assets/stylesheets/mercury/lightview.css +6 -56
  103. data/app/assets/stylesheets/mercury/mercury.css +43 -0
  104. data/{vendor → app}/assets/stylesheets/mercury/modal.css +15 -32
  105. data/{vendor → app}/assets/stylesheets/mercury/statusbar.css +0 -0
  106. data/{vendor → app}/assets/stylesheets/mercury/toolbar.css +4 -1
  107. data/{vendor → app}/assets/stylesheets/mercury/tooltip.css +0 -0
  108. data/{vendor → app}/assets/stylesheets/mercury/uploader.css +4 -4
  109. data/app/helpers/mercury_helper.rb +7 -0
  110. data/app/views/layouts/mercury.html.erb +10 -20
  111. data/app/views/layouts/mercury.html.haml +19 -0
  112. data/app/views/layouts/mercury.html.slim +19 -0
  113. data/app/views/mercury/modals/character.html +1 -1
  114. data/app/views/mercury/modals/htmleditor.html +3 -7
  115. data/app/views/mercury/modals/link.html +37 -51
  116. data/app/views/mercury/modals/media.html +102 -0
  117. data/app/views/mercury/modals/table.html +79 -73
  118. data/app/views/mercury/panels/snippets.html +6 -1
  119. data/app/views/mercury/snippets/example/options.html.erb +23 -27
  120. data/app/views/mercury/snippets/no_options/preview.html.erb +1 -0
  121. data/config/routes.rb +9 -0
  122. data/features/generators/authentication.feature +10 -0
  123. data/features/generators/images.feature +41 -0
  124. data/features/generators/install.feature +21 -0
  125. data/features/loading/loading.feature +5 -2
  126. data/features/loading/user_interface.feature +9 -7
  127. data/features/regions/{editable → full}/advanced_editing.feature +0 -0
  128. data/features/regions/full/basic_editing.feature +198 -0
  129. data/features/regions/{editable → full}/inserting_links.feature +20 -19
  130. data/features/regions/{editable → full}/inserting_media.feature +36 -18
  131. data/features/regions/{editable → full}/inserting_snippets.feature +28 -18
  132. data/features/regions/{editable → full}/inserting_special_characters.feature +2 -2
  133. data/features/regions/full/inserting_tables.feature +109 -0
  134. data/features/regions/{editable → full}/pasting.feature +0 -0
  135. data/features/regions/{editable → full}/uploading_images.feature +0 -0
  136. data/features/regions/{markupable → image}/uploading_images.feature +0 -0
  137. data/features/regions/{markupable → markdown}/advanced_editing.feature +0 -0
  138. data/features/regions/{markupable → markdown}/basic_editing.feature +0 -0
  139. data/features/regions/{markupable → markdown}/inserting_links.feature +0 -0
  140. data/features/regions/{markupable → markdown}/inserting_media.feature +0 -0
  141. data/features/regions/{markupable → markdown}/inserting_snippets.feature +0 -0
  142. data/features/regions/{markupable → markdown}/inserting_special_characters.feature +0 -0
  143. data/features/regions/{markupable → markdown}/inserting_tables.feature +0 -0
  144. data/features/regions/{snippetable/advanced_editing.feature → markdown/uploading_images.feature} +0 -0
  145. data/features/regions/simple/basic_editing.feature +5 -0
  146. data/features/regions/{snippetable/basic_editing.feature → snippets/advanced_editing.feature} +0 -0
  147. data/features/regions/{snippetable/inserting_snippets.feature → snippets/basic_editing.feature} +0 -0
  148. data/{vendor/assets/javascripts/mercury/locales/da.locale.js.coffee → features/regions/snippets/inserting_snippets.feature} +0 -0
  149. data/features/saving/saving.feature +8 -8
  150. data/features/step_definitions/custom_web_steps.rb +22 -0
  151. data/features/step_definitions/generator_steps.rb +23 -0
  152. data/features/step_definitions/mercury_steps.rb +1 -438
  153. data/features/support/aruba.rb +28 -0
  154. data/features/support/env.rb +11 -1
  155. data/features/support/selectors.rb +23 -0
  156. data/lib/generators/mercury/install/authentication/authentication_generator.rb +17 -0
  157. data/lib/generators/mercury/install/images/images_generator.rb +47 -0
  158. data/{app/models/mercury/image.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image.rb} +7 -0
  159. data/{db/migrate/20110526035601_create_mercury_images.rb → lib/generators/mercury/install/images/templates/ar_paperclip_image_migration.rb} +0 -0
  160. data/{app/controllers/mercury → lib/generators/mercury/install/images/templates}/images_controller.rb +0 -0
  161. data/lib/generators/mercury/install/{templates → images/templates}/mongoid_paperclip_image.rb +0 -0
  162. data/lib/generators/mercury/install/install_generator.rb +12 -23
  163. data/lib/mercury-rails.rb +1 -2
  164. data/lib/mercury/authentication.rb +1 -0
  165. data/lib/mercury/cucumber/step_definitions.rb +13 -0
  166. data/lib/mercury/cucumber/step_definitions/mercury_steps.rb +408 -0
  167. data/{features → lib/mercury/cucumber}/support/mercury_contents.rb +3 -3
  168. data/{features → lib/mercury/cucumber}/support/mercury_selectors.rb +0 -20
  169. data/lib/mercury/engine.rb +19 -0
  170. data/lib/mercury/rails.rb +5 -0
  171. data/lib/mercury/version.rb +3 -0
  172. data/spec/dummy/Rakefile +7 -0
  173. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  174. data/spec/dummy/app/assets/javascripts/prototype.js +6082 -0
  175. data/spec/dummy/app/assets/stylesheets/application.css.scss +110 -0
  176. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  177. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  178. data/spec/dummy/app/views/layouts/mercury.html.erb +28 -0
  179. data/spec/dummy/config.ru +4 -0
  180. data/spec/dummy/config/application.rb +58 -0
  181. data/spec/dummy/config/boot.rb +10 -0
  182. data/spec/dummy/config/database.yml +10 -0
  183. data/spec/dummy/config/environment.rb +5 -0
  184. data/spec/dummy/config/environments/development.rb +37 -0
  185. data/spec/dummy/config/environments/production.rb +67 -0
  186. data/spec/dummy/config/environments/test.rb +37 -0
  187. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  188. data/spec/dummy/config/initializers/inflections.rb +15 -0
  189. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  190. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  191. data/spec/dummy/config/initializers/session_store.rb +8 -0
  192. data/spec/dummy/config/initializers/teabag.rb +9 -0
  193. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  194. data/spec/dummy/config/locales/en.yml +5 -0
  195. data/spec/dummy/config/routes.rb +5 -0
  196. data/spec/dummy/db/.gitkeep +0 -0
  197. data/spec/dummy/public/500.html +25 -0
  198. data/spec/dummy/public/blank.html +1 -0
  199. data/spec/dummy/public/favicon.ico +0 -0
  200. data/spec/dummy/public/images/bunny.gif +0 -0
  201. data/spec/dummy/public/images/bunny2.jpg +0 -0
  202. data/spec/dummy/public/index.html +279 -0
  203. data/spec/dummy/script/rails +6 -0
  204. data/spec/javascripts/{templates → fixtures}/mercury/dialog.html +0 -0
  205. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/backcolor.html +0 -0
  206. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/forecolor.html +0 -0
  207. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/formatblock.html +0 -0
  208. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/snippetpanel.html +0 -0
  209. data/spec/javascripts/{templates → fixtures}/mercury/dialogs/style.html +0 -0
  210. data/spec/javascripts/{templates → fixtures}/mercury/lightview.html +0 -0
  211. data/spec/javascripts/{templates → fixtures}/mercury/modal.html +0 -0
  212. data/spec/javascripts/{templates → fixtures}/mercury/modals/htmleditor.html +0 -0
  213. data/spec/javascripts/{templates → fixtures}/mercury/modals/insertcharacter.html +0 -0
  214. data/spec/javascripts/fixtures/mercury/modals/insertlink.html +67 -0
  215. data/spec/javascripts/fixtures/mercury/modals/insertmedia.html +87 -0
  216. data/spec/javascripts/{templates → fixtures}/mercury/modals/insertsnippet.html +0 -0
  217. data/spec/javascripts/fixtures/mercury/modals/inserttable.html +73 -0
  218. data/spec/javascripts/{templates → fixtures}/mercury/page_editor.html +4 -4
  219. data/spec/javascripts/{templates → fixtures}/mercury/palette.html +0 -0
  220. data/spec/javascripts/{templates → fixtures}/mercury/panel.html +0 -0
  221. data/spec/javascripts/fixtures/mercury/region.html +6 -0
  222. data/spec/javascripts/fixtures/mercury/regions/full.html +1 -0
  223. data/spec/javascripts/fixtures/mercury/regions/image.html +1 -0
  224. data/spec/javascripts/fixtures/mercury/regions/markdown.html +1 -0
  225. data/spec/javascripts/fixtures/mercury/regions/simple.html +1 -0
  226. data/spec/javascripts/fixtures/mercury/regions/snippets.html +4 -0
  227. data/spec/javascripts/{templates → fixtures}/mercury/select.html +0 -0
  228. data/spec/javascripts/{templates → fixtures}/mercury/snippet.html +0 -0
  229. data/spec/javascripts/{templates → fixtures}/mercury/snippet_toolbar.html +0 -0
  230. data/spec/javascripts/{templates → fixtures}/mercury/statusbar.html +0 -0
  231. data/spec/javascripts/{templates → fixtures}/mercury/table_editor.html +0 -0
  232. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.button.html +0 -0
  233. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.button_group.html +0 -0
  234. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.expander.html +0 -0
  235. data/spec/javascripts/{templates → fixtures}/mercury/toolbar.html +0 -0
  236. data/spec/javascripts/{templates → fixtures}/mercury/tooltip.html +0 -0
  237. data/spec/javascripts/{templates → fixtures}/mercury/uploader.html +0 -0
  238. data/spec/javascripts/mercury/{dialog_spec.js.coffee → dialog_spec.coffee} +11 -12
  239. data/spec/javascripts/mercury/dialogs/backcolor_spec.js.coffee +2 -3
  240. data/spec/javascripts/mercury/dialogs/forecolor_spec.js.coffee +3 -4
  241. data/spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee +2 -3
  242. data/spec/javascripts/mercury/dialogs/snippetpanel_spec.js.coffee +2 -3
  243. data/spec/javascripts/mercury/dialogs/style_spec.js.coffee +2 -3
  244. data/spec/javascripts/mercury/lightview_spec.js.coffee +180 -142
  245. data/spec/javascripts/mercury/mercury_spec.js.coffee +19 -13
  246. data/spec/javascripts/mercury/modal_spec.js.coffee +192 -148
  247. data/spec/javascripts/mercury/modals/htmleditor_spec.js.coffee +4 -5
  248. data/spec/javascripts/mercury/modals/insertcharacter_spec.js.coffee +2 -3
  249. data/spec/javascripts/mercury/modals/insertlink_spec.js.coffee +107 -34
  250. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +106 -26
  251. data/spec/javascripts/mercury/modals/insertsnippet_spec.js.coffee +2 -3
  252. data/spec/javascripts/mercury/modals/inserttable_spec.js.coffee +50 -40
  253. data/spec/javascripts/mercury/page_editor_spec.js.coffee +124 -80
  254. data/spec/javascripts/mercury/palette_spec.js.coffee +4 -5
  255. data/spec/javascripts/mercury/panel_spec.js.coffee +9 -12
  256. data/spec/javascripts/mercury/region_spec.js.coffee +22 -17
  257. data/spec/javascripts/mercury/regions/{editable_spec.js.coffee → full_spec.js.coffee} +26 -28
  258. data/spec/javascripts/mercury/regions/image_spec.js.coffee +33 -0
  259. data/spec/javascripts/mercury/regions/{markupable_spec.js.coffee → markdown_spec.js.coffee} +32 -34
  260. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +32 -0
  261. data/spec/javascripts/mercury/regions/{snippetable_spec.js.coffee → snippets_spec.js.coffee} +54 -55
  262. data/spec/javascripts/mercury/select_spec.js.coffee +4 -5
  263. data/spec/javascripts/mercury/snippet_spec.js.coffee +92 -16
  264. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +31 -16
  265. data/spec/javascripts/mercury/statusbar_spec.js.coffee +9 -10
  266. data/spec/javascripts/mercury/table_editor_spec.js.coffee +1 -2
  267. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +7 -9
  268. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +55 -26
  269. data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +13 -13
  270. data/spec/javascripts/mercury/toolbar_spec.js.coffee +43 -14
  271. data/spec/javascripts/mercury/tooltip_spec.js.coffee +1 -2
  272. data/spec/javascripts/mercury/uploader_spec.js.coffee +47 -33
  273. data/spec/javascripts/spec_helper.coffee +4 -0
  274. data/spec/javascripts/{spec_helper.js → support/event_simulation.js} +0 -2
  275. data/spec/teabag_env.rb +32 -0
  276. metadata +366 -196
  277. data/features/regions/editable/basic_editing.feature +0 -195
  278. data/features/regions/editable/inserting_tables.feature +0 -109
  279. data/spec/javascripts/templates/mercury/modals/insertlink.html +0 -30
  280. data/spec/javascripts/templates/mercury/modals/insertmedia.html +0 -35
  281. data/spec/javascripts/templates/mercury/modals/inserttable.html +0 -27
  282. data/spec/javascripts/templates/mercury/region.html +0 -2
  283. data/spec/javascripts/templates/mercury/regions/editable.html +0 -3
  284. data/spec/javascripts/templates/mercury/regions/snippetable.html +0 -4
  285. data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +0 -54
  286. data/vendor/assets/javascripts/mercury_loader.js +0 -193
  287. data/vendor/assets/javascripts/mercury_overrides.js +0 -6
  288. data/vendor/assets/stylesheets/mercury/mercury.css +0 -151
  289. data/vendor/assets/stylesheets/mercury_overrides.css +0 -17
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,9 @@
1
+ Teabag.setup do |config|
2
+
3
+ config.root = Mercury::Engine.root
4
+
5
+ config.suite do |suite|
6
+ suite.javascripts = ["teabag/jasmine"]
7
+ end
8
+
9
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ match 'mercury/test_page' => "mercury#test_page"
3
+
4
+ mount Mercury::Engine => "/"
5
+ end
File without changes
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
@@ -0,0 +1 @@
1
+ blank
File without changes
Binary file
Binary file
@@ -0,0 +1,279 @@
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
+ <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0">
6
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
7
+
8
+ <!-- include prototype so we know we can use any other javascript framework -->
9
+ <script src="/assets/prototype.js" type="text/javascript"></script>
10
+
11
+ <!-- include the loader -->
12
+ <script src="/assets/prototype.js" type="text/javascript"></script>
13
+ <script src="/assets/mercury/support/history.js" type="text/javascript"></script>
14
+ <script src="/mercury/javascripts/mercury_loader.js" type="text/javascript"></script>
15
+
16
+ <!-- custom implementation examples -->
17
+ <script type="text/javascript">
18
+ History.Adapter.bind(window, 'statechange', function() {
19
+ var state = History.getState();
20
+ console.debug(state.data, state.title, state.url);
21
+ });
22
+
23
+ // preload snippets
24
+ Event.observe(window, "mercury:ready", function() {
25
+ Mercury.config.regions.dataAttributes = ['information'];
26
+
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
+ Mercury.PageEditor.prototype.save = function() {
46
+ var data = this.serialize();
47
+ var lightview = Mercury.lightview(null, {title: 'Saving', closeButton: true});
48
+ setTimeout(function() {
49
+ var textarea = '<textarea style="width:100%;height:300px" wrap="off">' + top.JSON.stringify(data, null, ' ') + '</textarea>';
50
+ lightview.loadContent('<div style="width:500px">Saving in the demo is disabled, but you can see what would be sent to the server below.' + textarea + '</div>');
51
+ }, 500);
52
+ };
53
+ });
54
+
55
+ var newRegionIndex = 1;
56
+ var newRegionType = 0;
57
+ var regionTypes = ['full', 'simple', 'snippets', 'markdown'];
58
+ function addRegion() {
59
+ if (newRegionType >= regionTypes.length) newRegionType = 0;
60
+ var container = new Element('div', {style: 'position:relative;margin-bottom:20px;'});
61
+ container.update('<div class="remove" onclick="this.up().remove()">&times;</div><div data-mercury="' + regionTypes[newRegionType] + '" id="new_' + regionTypes[newRegionType] + '_' + newRegionIndex + '">new <b>' + regionTypes[newRegionType] + '</b> region ' + newRegionIndex + '</div>');
62
+ $('dynamic_regions').insert(container, {position: 'top'});
63
+ newRegionIndex += 1;
64
+ newRegionType += 1;
65
+ Mercury.trigger('reinitialize');
66
+ }
67
+ </script>
68
+ </head>
69
+ <body>
70
+
71
+ <ul id="controls">
72
+ <li><a href="javascript:Mercury.trigger('toggle:interface')">Toggle Interface</a></li>
73
+ <li><a href="javascript:var num = 1; History.pushState({state: num}, 'Mercury Editor -- With history.pushState!', '?pushstate=' + num);">history.pushState</a></li>
74
+ <li><a href="javascript:History.go(-1);">History.go(-1)</a></li>
75
+ <li><a href="javascript:History.back();">History.back()</a></li>
76
+ <li><a href="javascript:History.forward();">History.forward()</a></li>
77
+ </ul>
78
+
79
+ <!-- begin forms -->
80
+ <h1>Forms (with various methods and targets)</h1>
81
+ <div id="forms">
82
+ <form id="form1" action="/mercury/test_page" method="post" target="_top">
83
+ <input type="submit" name="commit" value="post _top">
84
+ </form>
85
+ <form id="form2" action="/mercury/test_page" method="get" target="_blank">
86
+ <input type="submit" name="commit" value="post _blank">
87
+ </form>
88
+ <form id="form3" action="/mercury/test_page" method="post" target="_self">
89
+ <input type="submit" name="commit" value="post _self">
90
+ </form>
91
+ <form id="form4" action="/mercury/test_page" method="get">
92
+ <input type="submit" name="commit" value="get [none]">
93
+ </form>
94
+ <form id="form5" action="/mercury/test_page" method="post" class="lightview" target="_self">
95
+ <input type="submit" name="commit" value="post _self .lightview">
96
+ </form>
97
+ <form id="form6" action="/mercury/test_page" method="get" target="foo">
98
+ <input type="submit" name="commit" value="get foo">
99
+ </form>
100
+ </div>
101
+ <!-- end forms -->
102
+
103
+ <!-- begin links -->
104
+ <h1>Links (With various targets)</h1>
105
+ <div id="links">
106
+ <a id="anchor1" href="/mercury/test_page" target="_top">_top</a>
107
+ <a id="anchor2" href="/mercury/test_page" target="_blank">_blank</a>
108
+ <a id="anchor3" href="/mercury/test_page" target="_self">_self</a>
109
+ <a id="anchor4" href="/mercury/test_page">[none]</a>
110
+ <a id="anchor5" href="/mercury/test_page" class="lightview" target="_self">_self .lightview</a>
111
+ <a id="anchor6" href="/mercury/test_page" target="foo">foo</a>
112
+ </div>
113
+ <!-- end links -->
114
+
115
+ <!-- begin dynamic regions -->
116
+ <h1>Dynamic Regions (<a href="javascript:addRegion()">Add a Region</a>)</h1>
117
+ <div id="dynamic_regions">
118
+ </div>
119
+ <!-- end dynamic -->
120
+
121
+ <!-- begin full region 1 -->
122
+ <h1>Full region</h1>
123
+ <div id="full_1" data-mercury="full" data-information="foo">
124
+ If the first line of content isn't wrapped in an element you can't set justification (mozilla only bug).
125
+
126
+ <h2>text with a meta tag (that will be removed)</h2>
127
+ 123<meta>editable content
128
+
129
+ <h2>anchor with a div inside</h2>
130
+ <a href="/foo1">l<div>ink with a div in</div> it</a>
131
+
132
+ <h2>image wrapped in an anchor</h2>
133
+ <a href="/foo2"><img alt="logo" src="/assets/mercury/temp-logo.png"></a>123
134
+
135
+ <h2>table with header and definition cells</h2>
136
+ <table border="1">
137
+ <tbody>
138
+ <tr><th>R1C1</th><th colspan="5">R1C2</th></tr>
139
+ <tr><th colspan="2">R2C1</th><th rowspan="2">R2C2</th><th>R2C3</th><th rowspan="5">R2C4</th><th>R2C5</th></tr>
140
+ <tr><td colspan="2">R3C1</td><td>R3C2</td><td>R3C3</td></tr>
141
+ <tr><td>R4C1</td><td>R4C2</td><td rowspan="4">R4C3</td><td>R4C4</td><td>R4C5</td></tr>
142
+ <tr><td>R5C1</td><td>R5C2</td><td>R5C3</td><td>R5C4</td></tr>
143
+ <tr><th rowspan="2">R6C1</th><th rowspan="2">R6C2</th><th>R6C3</th><th>R6C4</th></tr>
144
+ <tr><td>R7C1</td><td>R7C2</td><td>R7C3</td></tr>
145
+ <tr><td colspan="2">R8C1</td><td colspan="4">R7C2</td></tr>
146
+ </tbody>
147
+ </table>
148
+
149
+ <h2>table without tbody or border</h2>
150
+ <table>
151
+ <tr><th>R1C1</th><th colspan="2">R1C2</th></tr>
152
+ <tr><td rowspan="2">R2C1</td><td>R2C2</td><td>R2C3</td></tr>
153
+ <tr><td>R3C1</td><td>R3C2</td></tr>
154
+ </table>
155
+
156
+ <h2>fixed width table (column where all colspans > 1, row where all rowspans > 1)</h2>
157
+ <table border="1" width="200">
158
+ <tbody>
159
+ <tr><td rowspan="2">R1C1</td><td colspan="2" rowspan="2">R1C2</td></tr>
160
+ <tr></tr>
161
+ <tr><td>R3C1</td><td colspan="2">R3C2</td></tr>
162
+ </tr>
163
+ </tbody>
164
+ </table>
165
+
166
+ <h2>paragraph with an overline wrapped in an underline</h2>
167
+ <p>123 <u>under <span style="text-decoration:overline">overline</span> line</u> 123</p>
168
+
169
+ <h2>paragraph with an underline wrapped in an overline</h2>
170
+ <p>123 <span style="text-decoration:overline">over <u>underline</u> line</span> 123</p>
171
+
172
+ <h2>style tag that styles images with a border</h2>
173
+ <style type="text/css">img { border: 2px solid red}</style>
174
+
175
+ <h2>image next to content wrapped in an anchor</h2>
176
+ <img alt="clippy" src="/assets/mercury/temp-logo.png"><a href="#bookmark1">link for #bookmark1</a>
177
+
178
+ <h2>snippet that's pre-loaded</h2>
179
+ <div data-snippet="snippet_0">snippet0</div>
180
+
181
+ <h2>bookmark links</h2>
182
+ <a name="bookmark1">Bookmark1</a><br/><a name="bookmark2">Bookmark2</a>
183
+
184
+ <br/><br/>
185
+ Additional content not wrapped in anything
186
+ </div>
187
+ <!-- end full region 1 -->
188
+
189
+ <!-- begin full region 2 -->
190
+ <h1>Full region (single snippet and no content)</h1>
191
+ <div id="full_2" data-mercury="full">
192
+ <div data-snippet="snippet_1">snippet1</div>
193
+ </div>
194
+ <!-- end full region 2 -->
195
+
196
+ <!-- begin full region 3 -->
197
+ <h1>Full region (fixed width/height and overflow)</h1>
198
+ <div id="full_3" data-mercury="full" style="width:200px;height:90px;">
199
+ wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
200
+ <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
201
+ </div>
202
+ <!-- end full region 3 -->
203
+
204
+ <!-- begin simple region 1 -->
205
+ <h1>Simple region (h1 tag)</h1>
206
+ <h1 id="simple_1" data-mercury="simple" data-information="foo">This is a simple region</h1>
207
+ <!-- end simple region 1 -->
208
+
209
+ <!-- begin simple region 2 -->
210
+ <h1>Simple region (h2 tag with fixed width)</h1>
211
+ <h2 id="simple_2" data-mercury="simple" style="width:200px">This is a simple region which is much longer. It should wrap when displaying, and when editing.</h2>
212
+ <!-- end simple region 2 -->
213
+
214
+ <!-- begin snippets region 1 -->
215
+ <h1>Snippets region</h1>
216
+ <div id="snippets_1" data-mercury="snippets">
217
+ <div class="example-snippet" data-snippet="snippet_2">snippet2</div>
218
+ <div class="example-snippet" data-snippet="snippet_3">snippet3</div>
219
+ <div class="example-snippet" data-snippet="snippet_4">snippet4</div>
220
+ <div class="example-snippet" data-snippet="snippet_5">snippet5</div>
221
+ <div class="example-snippet" data-snippet="snippet_6">snippet6</div>
222
+ </div>
223
+ <br clear="both"/>
224
+ <!-- end snippets region 1 -->
225
+
226
+ <!-- begin snippets region 2 -->
227
+ <h1>Snippets region (iframe snippet that contains flash)</h1>
228
+ <div id="snippets_2" data-mercury="snippets">
229
+ <div class="example-snippet" data-snippet="snippet_7">snippet7</div>
230
+ <div class="example-snippet" data-snippet="snippet_8">snippet8</div>
231
+ <iframe class="example-snippet" data-snippet="snippet_9" width="560" height="349" src="http://www.youtube.com/embed/0pXYp72dwl0?wmode=transparent" frameborder="0" allowfullscreen="true"></iframe>
232
+ </div>
233
+ <!-- end snippets region 2 -->
234
+
235
+ <!-- begin markdown region 1 -->
236
+ <h1>Markdown region</h1>
237
+ <div id="markdown_1" data-mercury="markdown">
238
+ ## notes ##
239
+ **whitespace** in markdown regions is _important_.
240
+
241
+ ## ordered list ##
242
+ 1. list item 1
243
+ 2. list item 2
244
+
245
+ ## unordered list ##
246
+ - list item 1
247
+ - list item 2
248
+
249
+ ## horizontal rule ##
250
+ - - -
251
+
252
+ ## anchor ##
253
+ [this is a link](foo 'optional title')
254
+
255
+ ## image ##
256
+ ![add alt text](/assets/mercury/temp-logo.png)
257
+
258
+ ## snippet that's pre-loaded ##
259
+ [--snippet_1--]
260
+
261
+ ## code ##
262
+ <a href="/foo">this html will not be escaped</a>
263
+ and whitespace will be retained
264
+
265
+ ## blockquote ##
266
+ > this is indented one level
267
+
268
+ ## paragraph with bold, italics, etc. ##
269
+ 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.
270
+ </div>
271
+ <!-- end markdown region 1 -->
272
+
273
+ <!-- begin image region 1 -->
274
+ <h1>Image region</h1>
275
+ <img id="image_1" data-mercury="image" src="/images/bunny.gif" alt=""/>
276
+ <!-- end image region 1 -->
277
+
278
+ </body>
279
+ </html>
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,67 @@
1
+ <form>
2
+
3
+ <div id="link_text_container" class="control-group string optional">
4
+ <label class="string optional control-label" for="link_text">Link Content</label>
5
+ <div class="controls">
6
+ <input class="string optional" id="link_text" name="link[text]" size="50" type="text">
7
+ </div>
8
+ </div>
9
+
10
+ <div class="control-group url optional">
11
+ <label class="url optional control-label" for="link_external_url">
12
+ <input name="link_type" type="radio" value="external_url" checked="checked"/>URL
13
+ </label>
14
+ <div class="controls">
15
+ <input class="string url optional" id="link_external_url" name="link[external_url]" size="50" type="text">
16
+ </div>
17
+ </div>
18
+
19
+ <div class="control-group select optional">
20
+ <label class="select optional control-label" for="link_existing_bookmark">
21
+ <input name="link_type" type="radio" value="existing_bookmark"/>Existing Links
22
+ </label>
23
+ <div class="controls">
24
+ <select class="select optional" id="link_existing_bookmark" name="link[existing_bookmark]"></select>
25
+ </div>
26
+ </div>
27
+ <div class="control-group string optional">
28
+ <label class="string optional control-label" for="link_new_bookmark">
29
+ <input name="link_type" type="radio" value="new_bookmark"/>Bookmark
30
+ </label>
31
+ <div class="controls">
32
+ <input class="string optional" id="link_new_bookmark" name="link[new_bookmark]" size="50" type="text">
33
+ </div>
34
+ </div>
35
+
36
+ <div class="control-group select optional">
37
+ <label class="select optional control-label" for="link_target">Link Target</label>
38
+ <div class="controls">
39
+ <select class="select optional" id="link_target" name="link[target]">
40
+ <option value="">Self (the same window or tab)</option>
41
+ <option value="_blank">Blank (a new window or tab)</option>
42
+ <option value="_top">Top (removes any frames)</option>
43
+ <option value="popup">Popup Window (javascript new window popup)</option>
44
+ </select>
45
+ </div>
46
+ </div>
47
+ <div id="popup_options" class="link-target-options" style="display:none">
48
+ <div class="control-group number optional">
49
+ <label class="number optional control-label" for="link_popup_width">Popup Width</label>
50
+ <div class="controls">
51
+ <input class="number optional" id="link_popup_width" name="link[popup_width]" size="50" type="number">
52
+ </div>
53
+ </div>
54
+ <div class="control-group number optional">
55
+ <label class="number optional control-label" for="link_popup_height">Popup Height</label>
56
+ <div class="controls">
57
+ <input class="number optional" id="link_popup_height" name="link[popup_height]" size="50" type="number">
58
+ </div>
59
+ </div>
60
+ </div>
61
+
62
+ <input name="commit" type="submit" value="Insert Link">
63
+
64
+ </form>
65
+
66
+ <a name="link1">Link One</a>
67
+ <a name="link2">Link Two</a>