alchemy_cms 2.5.3.1 → 2.6.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. data/.gitignore +1 -1
  2. data/.travis.yml +5 -13
  3. data/Gemfile +6 -3
  4. data/README.md +3 -2
  5. data/alchemy_cms.gemspec +22 -22
  6. data/app/assets/fonts/alchemy-icons.eot +0 -0
  7. data/app/assets/fonts/alchemy-icons.svg +54 -0
  8. data/app/assets/fonts/alchemy-icons.ttf +0 -0
  9. data/app/assets/fonts/alchemy-icons.woff +0 -0
  10. data/app/assets/images/alchemy/icons.png +0 -0
  11. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +151 -0
  12. data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -2
  13. data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +31 -0
  14. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +1 -1
  15. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +98 -0
  16. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +23 -24
  17. data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +27 -0
  18. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +11 -8
  19. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +32 -0
  20. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +46 -0
  21. data/app/assets/javascripts/alchemy/alchemy.js +8 -2
  22. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +5 -4
  23. data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +49 -0
  24. data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +3 -0
  25. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +71 -0
  26. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +61 -0
  27. data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +35 -0
  28. data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +11 -0
  29. data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +278 -0
  30. data/app/assets/stylesheets/alchemy/admin.css.scss +2 -0
  31. data/app/assets/stylesheets/alchemy/archive.scss +109 -65
  32. data/app/assets/stylesheets/alchemy/base.scss +16 -188
  33. data/app/assets/stylesheets/alchemy/dashboard.scss +2 -2
  34. data/app/assets/stylesheets/alchemy/defaults.scss +2 -1
  35. data/app/assets/stylesheets/alchemy/elements.scss +58 -94
  36. data/app/assets/stylesheets/alchemy/errors.scss +2 -2
  37. data/app/assets/stylesheets/alchemy/{mixins.scss → extends.scss} +104 -80
  38. data/app/assets/stylesheets/alchemy/flash.scss +4 -6
  39. data/app/assets/stylesheets/alchemy/fonts.scss +46 -0
  40. data/app/assets/stylesheets/alchemy/form_elements.scss +46 -45
  41. data/app/assets/stylesheets/alchemy/frame.scss +20 -15
  42. data/app/assets/stylesheets/alchemy/icons.scss +22 -9
  43. data/app/assets/stylesheets/alchemy/jquery-ui.scss +476 -399
  44. data/app/assets/stylesheets/alchemy/login.scss +1 -1
  45. data/app/assets/stylesheets/alchemy/menubar.css.scss +1 -1
  46. data/app/assets/stylesheets/alchemy/notices.scss +5 -5
  47. data/app/assets/stylesheets/alchemy/pagination.scss +25 -13
  48. data/app/assets/stylesheets/alchemy/search.scss +29 -17
  49. data/app/assets/stylesheets/alchemy/sitemap.scss +41 -36
  50. data/app/assets/stylesheets/alchemy/tables.scss +102 -50
  51. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +18 -16
  52. data/app/assets/stylesheets/alchemy/toolbar.scss +84 -24
  53. data/app/assets/stylesheets/alchemy/upload.scss +14 -9
  54. data/app/assets/stylesheets/alchemy/variables.scss +1 -0
  55. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +18 -21
  56. data/app/controllers/alchemy/admin/attachments_controller.rb +29 -39
  57. data/app/controllers/alchemy/admin/base_controller.rb +3 -9
  58. data/app/controllers/alchemy/admin/clipboard_controller.rb +1 -1
  59. data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
  60. data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
  61. data/app/controllers/alchemy/admin/elements_controller.rb +3 -3
  62. data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
  63. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +5 -5
  64. data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
  65. data/app/controllers/alchemy/admin/pages_controller.rb +18 -16
  66. data/app/controllers/alchemy/admin/pictures_controller.rb +11 -10
  67. data/app/controllers/alchemy/admin/resources_controller.rb +87 -14
  68. data/app/controllers/alchemy/admin/tags_controller.rb +3 -3
  69. data/app/controllers/alchemy/admin/trash_controller.rb +3 -3
  70. data/app/controllers/alchemy/admin/users_controller.rb +6 -11
  71. data/app/controllers/alchemy/attachments_controller.rb +8 -9
  72. data/app/controllers/alchemy/base_controller.rb +17 -10
  73. data/app/controllers/alchemy/pages_controller.rb +7 -19
  74. data/app/controllers/alchemy/passwords_controller.rb +15 -3
  75. data/app/controllers/alchemy/user_sessions_controller.rb +5 -4
  76. data/app/controllers/alchemy/users_controller.rb +1 -1
  77. data/app/helpers/alchemy/admin/attachments_helper.rb +2 -2
  78. data/app/helpers/alchemy/admin/base_helper.rb +62 -90
  79. data/app/helpers/alchemy/admin/elements_helper.rb +13 -5
  80. data/app/helpers/alchemy/admin/essences_helper.rb +3 -5
  81. data/app/helpers/alchemy/admin/pages_helper.rb +6 -3
  82. data/app/helpers/alchemy/admin/tags_helper.rb +60 -0
  83. data/app/helpers/alchemy/base_helper.rb +16 -20
  84. data/app/helpers/alchemy/elements_helper.rb +7 -11
  85. data/app/helpers/alchemy/essences_helper.rb +2 -2
  86. data/app/helpers/alchemy/pages_helper.rb +31 -69
  87. data/app/helpers/alchemy/url_helper.rb +11 -3
  88. data/app/models/alchemy/attachment.rb +73 -45
  89. data/app/models/alchemy/cell.rb +1 -1
  90. data/app/models/alchemy/content.rb +20 -9
  91. data/app/models/alchemy/element.rb +9 -7
  92. data/app/models/alchemy/page.rb +15 -248
  93. data/app/models/alchemy/page/cells.rb +71 -0
  94. data/app/models/alchemy/page/elements.rb +147 -0
  95. data/app/models/alchemy/page/naming.rb +90 -0
  96. data/app/models/alchemy/picture.rb +18 -13
  97. data/app/models/alchemy/tag.rb +1 -1
  98. data/app/models/alchemy/user.rb +38 -6
  99. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +14 -7
  100. data/app/views/alchemy/admin/attachments/_attachment.html.erb +17 -12
  101. data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +3 -8
  102. data/app/views/alchemy/admin/attachments/_files_list.html.erb +20 -12
  103. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +11 -0
  104. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +31 -0
  105. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +4 -0
  106. data/app/views/alchemy/admin/attachments/edit.html.erb +8 -7
  107. data/app/views/alchemy/admin/attachments/index.html.erb +19 -12
  108. data/app/views/alchemy/admin/attachments/new.html.erb +2 -2
  109. data/app/views/alchemy/admin/attachments/show.html.erb +3 -0
  110. data/app/views/alchemy/admin/contents/_missing.html.erb +4 -4
  111. data/app/views/alchemy/admin/contents/create.js.erb +1 -1
  112. data/app/views/alchemy/admin/contents/new.html.erb +6 -3
  113. data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
  114. data/app/views/alchemy/admin/dashboard/_users.html.erb +1 -1
  115. data/app/views/alchemy/admin/dashboard/index.html.erb +3 -3
  116. data/app/views/alchemy/admin/dashboard/info.html.erb +16 -13
  117. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  118. data/app/views/alchemy/admin/elements/_element_foot.html.erb +4 -4
  119. data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -7
  120. data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -2
  121. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +4 -4
  122. data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +1 -1
  123. data/app/views/alchemy/admin/elements/create.js.erb +2 -2
  124. data/app/views/alchemy/admin/elements/fold.js.erb +3 -6
  125. data/app/views/alchemy/admin/elements/new.html.erb +1 -1
  126. data/app/views/alchemy/admin/elements/order.js.erb +1 -1
  127. data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
  128. data/app/views/alchemy/admin/elements/update.js.erb +2 -2
  129. data/app/views/alchemy/admin/essence_files/edit.html.erb +4 -4
  130. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +17 -18
  131. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
  132. data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -0
  133. data/app/views/alchemy/admin/languages/_form.html.erb +12 -10
  134. data/app/views/alchemy/admin/languages/_language.html.erb +2 -1
  135. data/app/views/alchemy/admin/languages/_table.html.erb +3 -3
  136. data/app/views/alchemy/admin/languages/index.html.erb +15 -15
  137. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +6 -6
  138. data/app/views/alchemy/admin/layoutpages/index.html.erb +41 -40
  139. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +4 -4
  140. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +6 -6
  141. data/app/views/alchemy/admin/pages/_external_link.html.erb +2 -2
  142. data/app/views/alchemy/admin/pages/_file_link.html.erb +3 -3
  143. data/app/views/alchemy/admin/pages/_internal_link.html.erb +1 -1
  144. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  145. data/app/views/alchemy/admin/pages/_page.html.erb +13 -13
  146. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +2 -4
  147. data/app/views/alchemy/admin/pages/_sitemap.html.erb +5 -0
  148. data/app/views/alchemy/admin/pages/configure.html.erb +7 -7
  149. data/app/views/alchemy/admin/pages/configure_external.html.erb +4 -4
  150. data/app/views/alchemy/admin/pages/edit.html.erb +23 -30
  151. data/app/views/alchemy/admin/pages/index.html.erb +34 -23
  152. data/app/views/alchemy/admin/pages/new.html.erb +1 -1
  153. data/app/views/alchemy/admin/pages/sort.js.erb +1 -1
  154. data/app/views/alchemy/admin/partials/_flash_upload.html.erb +2 -3
  155. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  156. data/app/views/alchemy/admin/partials/_search_form.html.erb +3 -3
  157. data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -2
  158. data/app/views/alchemy/admin/pictures/_archive.html.erb +7 -7
  159. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
  160. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +6 -6
  161. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +4 -4
  162. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
  163. data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -8
  164. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +9 -14
  165. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -25
  166. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
  167. data/app/views/alchemy/admin/pictures/index.html.erb +49 -42
  168. data/app/views/alchemy/admin/pictures/new.html.erb +2 -2
  169. data/app/views/alchemy/admin/pictures/show.html.erb +11 -0
  170. data/app/views/alchemy/admin/resources/_boolean.html.erb +2 -2
  171. data/app/views/alchemy/admin/resources/_datetime.html.erb +2 -2
  172. data/app/views/alchemy/admin/resources/_form.html.erb +9 -8
  173. data/app/views/alchemy/admin/resources/_resource.html.erb +15 -21
  174. data/app/views/alchemy/admin/resources/_string.html.erb +2 -2
  175. data/app/views/alchemy/admin/resources/_table.html.erb +11 -13
  176. data/app/views/alchemy/admin/resources/_text.html.erb +2 -2
  177. data/app/views/alchemy/admin/resources/index.csv.erb +13 -0
  178. data/app/views/alchemy/admin/resources/index.html.erb +24 -15
  179. data/app/views/alchemy/admin/sites/index.html.erb +23 -0
  180. data/app/views/alchemy/admin/tags/_radio_tag.html.erb +1 -1
  181. data/app/views/alchemy/admin/tags/_tag.html.erb +2 -1
  182. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  183. data/app/views/alchemy/admin/tags/index.html.erb +16 -11
  184. data/app/views/alchemy/admin/tags/new.html.erb +3 -3
  185. data/app/views/alchemy/admin/trash/clear.js.coffee +1 -1
  186. data/app/views/alchemy/admin/users/_table.html.erb +12 -5
  187. data/app/views/alchemy/admin/users/_user.html.erb +16 -16
  188. data/app/views/alchemy/admin/users/index.html.erb +28 -16
  189. data/app/views/alchemy/breadcrumb/_page.html.erb +15 -0
  190. data/app/views/alchemy/breadcrumb/_spacer.html.erb +1 -0
  191. data/app/views/alchemy/elements/_editor_not_found.html.erb +1 -1
  192. data/app/views/alchemy/essences/_essence_file_editor.html.erb +16 -16
  193. data/app/views/alchemy/essences/_essence_file_view.html.erb +8 -9
  194. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +3 -6
  195. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +9 -8
  196. data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +0 -5
  197. data/app/views/alchemy/essences/_linkable_essence_tools.html.erb +2 -2
  198. data/app/views/alchemy/navigation/_link.html.erb +7 -7
  199. data/app/views/alchemy/navigation/_renderer.html.erb +29 -36
  200. data/app/views/alchemy/notifications/admin_user_created.de.text.erb +5 -1
  201. data/app/views/alchemy/notifications/admin_user_created.en.text.erb +5 -1
  202. data/app/views/alchemy/notifications/registered_user_created.de.text.erb +13 -0
  203. data/app/views/alchemy/notifications/registered_user_created.en.text.erb +13 -0
  204. data/app/views/alchemy/search/_result.html.erb +4 -6
  205. data/app/views/alchemy/search/_results.html.erb +4 -5
  206. data/app/views/alchemy/user_sessions/leave.html.erb +1 -1
  207. data/app/views/alchemy/user_sessions/new.html.erb +2 -2
  208. data/app/views/kaminari/_first_page.html.erb +11 -0
  209. data/app/views/kaminari/_gap.html.erb +1 -1
  210. data/app/views/kaminari/_last_page.html.erb +11 -0
  211. data/app/views/kaminari/_next_page.html.erb +2 -2
  212. data/app/views/kaminari/_page.html.erb +1 -1
  213. data/app/views/kaminari/_paginator.html.erb +2 -0
  214. data/app/views/kaminari/_prev_page.html.erb +2 -2
  215. data/app/views/layouts/alchemy/admin.html.erb +4 -5
  216. data/config/alchemy/config.yml +8 -12
  217. data/config/authorization_rules.rb +4 -3
  218. data/config/initializers/dragonfly.rb +20 -12
  219. data/config/locales/alchemy.de.yml +20 -15
  220. data/config/locales/alchemy.en.yml +15 -10
  221. data/config/locales/devise.de.yml +1 -0
  222. data/config/routes.rb +3 -3
  223. data/{spec/dummy/db/migrate/20121118000000_alchemy_two_point_four.rb → db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
  224. data/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
  225. data/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
  226. data/lib/alchemy/capistrano.rb +10 -8
  227. data/lib/alchemy/errors.rb +7 -0
  228. data/lib/alchemy/filetypes.rb +33 -0
  229. data/lib/alchemy/i18n.rb +9 -1
  230. data/lib/alchemy/name_conversions.rb +28 -0
  231. data/lib/alchemy/page_layout.rb +5 -3
  232. data/lib/alchemy/resource.rb +132 -29
  233. data/lib/alchemy/resources_helper.rb +81 -12
  234. data/lib/alchemy/upgrader.rb +14 -276
  235. data/lib/alchemy/version.rb +1 -1
  236. data/lib/alchemy_cms.rb +17 -2
  237. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
  238. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -1
  239. data/lib/tasks/alchemy/convert.rake +39 -0
  240. data/lib/tasks/alchemy/install.rake +4 -6
  241. data/lib/tasks/alchemy/upgrade.rake +18 -1
  242. data/spec/controllers/admin/clipboard_controller_spec.rb +4 -4
  243. data/spec/controllers/admin/elements_controller_spec.rb +23 -23
  244. data/spec/controllers/admin/pages_controller_spec.rb +15 -0
  245. data/spec/controllers/admin/resources_controller_spec.rb +1 -11
  246. data/spec/controllers/admin/trash_controller_spec.rb +9 -9
  247. data/spec/controllers/attachments_controller_spec.rb +3 -3
  248. data/spec/controllers/elements_controller_spec.rb +2 -2
  249. data/spec/controllers/pages_controller_spec.rb +160 -129
  250. data/spec/controllers/pictures_controller_spec.rb +2 -2
  251. data/spec/controllers/user_sessions_controller_spec.rb +3 -3
  252. data/spec/controllers/users_controller_spec.rb +2 -2
  253. data/spec/dummy/app/models/event.rb +2 -2
  254. data/spec/dummy/app/models/location.rb +4 -0
  255. data/spec/dummy/app/views/layouts/application.html.erb +6 -42
  256. data/spec/dummy/config/routes.rb +1 -1
  257. data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -1
  258. data/{db/migrate/20121118000000_alchemy_two_point_four.rb → spec/dummy/db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
  259. data/spec/dummy/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
  260. data/spec/dummy/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
  261. data/spec/dummy/db/migrate/20130328101418_create_locations.rb +9 -0
  262. data/spec/dummy/db/schema.rb +15 -6
  263. data/spec/factories.rb +4 -4
  264. data/spec/{integration → features}/admin/link_overlay_spec.rb +0 -0
  265. data/spec/{integration → features}/admin/modules_integration_spec.rb +1 -1
  266. data/spec/{integration → features}/admin/pages_controller_spec.rb +9 -4
  267. data/spec/{integration → features}/admin/picture_library_integration_spec.rb +5 -5
  268. data/spec/{integration → features}/admin/resources_integration_spec.rb +1 -1
  269. data/spec/{integration → features}/navigation_spec.rb +0 -0
  270. data/spec/{integration → features}/pages_controller_spec.rb +42 -112
  271. data/spec/{integration → features}/picture_security_spec.rb +2 -2
  272. data/spec/{integration → features}/security_spec.rb +7 -7
  273. data/spec/{integration → features}/translation_integration_spec.rb +0 -0
  274. data/spec/helpers/admin/base_helper_spec.rb +0 -50
  275. data/spec/helpers/admin/tags_helper_spec.rb +53 -0
  276. data/spec/helpers/base_helper_spec.rb +19 -3
  277. data/spec/helpers/pages_helper_spec.rb +92 -44
  278. data/spec/{url_helpers_spec.rb → helpers/picture_url_helpers_spec.rb} +7 -7
  279. data/spec/helpers/url_helper_spec.rb +92 -72
  280. data/spec/{config_spec.rb → libraries/config_spec.rb} +0 -0
  281. data/spec/libraries/resource_spec.rb +215 -76
  282. data/spec/libraries/resources_helper_spec.rb +70 -28
  283. data/spec/models/attachment_spec.rb +75 -9
  284. data/spec/models/clipboard_spec.rb +1 -1
  285. data/spec/models/element_spec.rb +7 -0
  286. data/spec/models/page_spec.rb +144 -25
  287. data/spec/models/picture_spec.rb +5 -5
  288. data/spec/models/resource_spec.rb +47 -10
  289. data/spec/models/user_spec.rb +115 -3
  290. data/spec/{routing_spec.rb → routing/routing_spec.rb} +8 -20
  291. data/spec/spec_helper.rb +5 -6
  292. data/spec/support/alchemy/specs_helpers.rb +1 -1
  293. data/spec/support/ci/install_phantomjs +1 -1
  294. data/spec/support/image with spaces.png +0 -0
  295. data/vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js +18 -18
  296. data/vendor/assets/javascripts/jquery_plugins/{jquery.dialogextend.1_0_1.js → jquery.dialogextend.js} +25 -17
  297. data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo.min.js +7 -0
  298. data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +7 -7
  299. data/vendor/assets/javascripts/keymage.min.js +6 -0
  300. data/vendor/assets/javascripts/spin.min.js +1 -0
  301. metadata +122 -124
  302. data/app/assets/images/alchemy/ajax_loader.gif +0 -0
  303. data/app/assets/images/alchemy/gui/toggle.png +0 -0
  304. data/app/assets/images/alchemy/image_loader.gif +0 -0
  305. data/app/assets/images/alchemy/shading.png +0 -0
  306. data/app/assets/images/alchemy/tabs.gif +0 -0
  307. data/app/assets/javascripts/alchemy/alchemy.base.js +0 -172
  308. data/app/assets/javascripts/alchemy/alchemy.datepicker.js +0 -47
  309. data/app/assets/javascripts/alchemy/alchemy.element_editor_selector.js +0 -91
  310. data/app/assets/javascripts/alchemy/alchemy.growler.js +0 -46
  311. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +0 -60
  312. data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +0 -15
  313. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +0 -97
  314. data/app/assets/javascripts/alchemy/alchemy.windows.js +0 -321
  315. data/app/models/alchemy/clipboard_spec.rb +0 -0
  316. data/app/views/alchemy/admin/pictures/show_in_window.html.erb +0 -8
  317. data/app/views/alchemy/notifications/registered_user_created.text.erb +0 -11
  318. data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
  319. data/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
  320. data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
  321. data/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
  322. data/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
  323. data/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
  324. data/spec/alchemy_spec.rb +0 -7
  325. data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
  326. data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
  327. data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
  328. data/spec/dummy/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
  329. data/spec/dummy/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
  330. data/spec/dummy/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
  331. data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo-1.4.2-min.js +0 -11
data/.gitignore CHANGED
@@ -21,4 +21,4 @@ spec/dummy/db/seeds.rb
21
21
  spec/dummy/config/locales/**/*
22
22
  /coverage/
23
23
  *.gem
24
- .ruby-version
24
+ /.ruby-version
@@ -1,19 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ - 2.0.0
4
5
  branches:
5
6
  only:
6
- - 2.5-stable
7
- before_script:
8
- # - sudo spec/support/ci/install_phantomjs
9
- # - "export PATH=phantomjs/bin:$PATH"
10
- - phantomjs --version
11
- - "sh -c 'cd spec/dummy && RAILS_ENV=test bundle exec rake db:create db:schema:load --trace'"
12
- script: "bundle exec rspec spec $SPEC_FLAGS"
7
+ - master
8
+ script: rake
13
9
  env:
14
- - DB=mysql SPEC_FLAGS="-t ~type:request"
15
- - DB=postgresql SPEC_FLAGS="-t ~type:request"
16
- - DB=mysql SPEC_FLAGS="-t type:request"
17
- matrix:
18
- allow_failures:
19
- - env: DB=mysql SPEC_FLAGS="-t type:request"
10
+ - DB=mysql
11
+ - DB=postgresql
data/Gemfile CHANGED
@@ -2,18 +2,20 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- #For some strange reason it's only loaded outside any group
5
+ # For some strange reason it's only loaded outside any group
6
6
  gem 'jasmine'
7
7
  gem 'jasminerice'
8
8
 
9
+ # Code coverage plattform
10
+ gem 'coveralls', require: false
11
+
9
12
  group :test do
10
13
  gem 'sqlite3' if ENV['DB'].nil? || ENV['DB'] == 'sqlite'
11
14
  gem 'mysql2' if ENV['DB'] == 'mysql'
12
15
  gem 'pg' if ENV['DB'] == 'postgresql'
13
- gem 'poltergeist', '1.0.2'
16
+ gem 'poltergeist', '1.1.0'
14
17
  unless ENV['CI']
15
18
  gem 'launchy'
16
- gem 'simplecov', :require => false
17
19
  end
18
20
  end
19
21
 
@@ -30,4 +32,5 @@ group :development do
30
32
  gem 'quiet_assets' # Mute assets loggin
31
33
  gem 'thin' # Get rid off 'Could not determine content-length of response body' Warning. Start with 'rails s thin'
32
34
  end
35
+ gem 'rspec-rails', github: 'rspec/rspec-rails', branch: '2-13-maintenance'
33
36
  end
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  ![Alchemy CMS](http://alchemy-cms.com/assets/alchemy_logo.png)
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=master)](http://travis-ci.org/magiclabs/alchemy_cms) [![Maintenance Status](http://stillmaintained.com/magiclabs/alchemy_cms.png)](http://stillmaintained.com/magiclabs/alchemy_cms) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/magiclabs/alchemy_cms)
3
+ [![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=master)](http://travis-ci.org/magiclabs/alchemy_cms) [![Dependency Status](https://gemnasium.com/magiclabs/alchemy_cms.png)](https://gemnasium.com/magiclabs/alchemy_cms) [![Code Climate](https://codeclimate.com/github/magiclabs/alchemy_cms.png)](https://codeclimate.com/github/magiclabs/alchemy_cms) [![Coverage Status](https://coveralls.io/repos/magiclabs/alchemy_cms/badge.png?branch=master)](https://coveralls.io/r/magiclabs/alchemy_cms)
4
4
 
5
5
  About
6
6
  -----
7
+ **This branch is a beta development branch. For productive environments use the current rubygems version, or the [latest stable branch (2.5-stable)](https://github.com/magiclabs/alchemy_cms/tree/2.5-stable).**
7
8
 
8
9
  Alchemy is a powerful, userfriendly and flexible Rails 3 CMS.
9
10
 
@@ -67,7 +68,7 @@ Add to existing Rails project
67
68
 
68
69
  In your Gemfile:
69
70
 
70
- gem 'alchemy_cms', '~> 2.5.0', github: 'magiclabs/alchemy_cms', branch: '2.5-stable'
71
+ gem 'alchemy_cms', github: 'magiclabs/alchemy_cms', branch: 'master'
71
72
 
72
73
  Run in terminal:
73
74
 
@@ -32,31 +32,31 @@ POST_INSTALL
32
32
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
33
33
  s.require_paths = ["lib"]
34
34
 
35
- s.add_runtime_dependency %q<rails>, ["~> 3.2.12"]
36
- s.add_runtime_dependency %q<devise>, ["~> 2.2.3"]
37
- s.add_runtime_dependency %q<devise-encryptable>, ["~> 0.1.1"]
38
- s.add_runtime_dependency %q<awesome_nested_set>, ["~> 2.0"]
39
- s.add_runtime_dependency %q<acts-as-taggable-on>, ["~> 2.1"]
40
- s.add_runtime_dependency %q<declarative_authorization>, ["= 0.5.5"]
41
- s.add_runtime_dependency %q<dragonfly>, ["~> 0.9.14"]
42
- s.add_runtime_dependency %q<kaminari>, ["~> 0.13.0"]
43
- s.add_runtime_dependency %q<acts_as_ferret>, ["~> 0.5"]
44
- s.add_runtime_dependency %q<acts_as_list>, ["~> 0.1.9"]
45
- s.add_runtime_dependency %q<magiclabs-userstamp>, ["~> 2.0.2"]
46
- s.add_runtime_dependency %q<dynamic_form>, ["~> 1.1"]
47
- s.add_runtime_dependency %q<jquery-rails>, ["~> 2.1.3"]
48
- s.add_runtime_dependency %q<jquery-ui-rails>, ["~> 3.0.1"]
49
- s.add_runtime_dependency %q<attachment_magic>, [">= 0.2.1"]
50
- s.add_runtime_dependency %q<sass-rails>, ['~> 3.2.3']
51
- s.add_runtime_dependency %q<coffee-rails>, ['~> 3.2.1']
52
- s.add_runtime_dependency %q<compass-rails>, ['~> 1.0.3']
53
- s.add_runtime_dependency %q<sassy-buttons>, ['~> 0.1.3']
54
- s.add_runtime_dependency %q<rails3-jquery-autocomplete>, ['~> 1.0.10']
35
+ s.add_runtime_dependency %q<rails>, ["~> 3.2.13"]
36
+ s.add_runtime_dependency %q<devise>, ["~> 2.2.3"]
37
+ s.add_runtime_dependency %q<devise-encryptable>, ["~> 0.1.1"]
38
+ s.add_runtime_dependency %q<awesome_nested_set>, ["~> 2.0"]
39
+ s.add_runtime_dependency %q<acts-as-taggable-on>, ["~> 2.1"]
40
+ s.add_runtime_dependency %q<declarative_authorization>, ["~> 0.5.7"]
41
+ s.add_runtime_dependency %q<dragonfly>, ["~> 0.9.14"]
42
+ s.add_runtime_dependency %q<kaminari>, ["~> 0.14.1"]
43
+ s.add_runtime_dependency %q<acts_as_ferret>, ["~> 0.5"]
44
+ s.add_runtime_dependency %q<acts_as_list>, ["~> 0.2.0"]
45
+ s.add_runtime_dependency %q<magiclabs-userstamp>, ["~> 2.0.2"]
46
+ s.add_runtime_dependency %q<dynamic_form>, ["~> 1.1"]
47
+ s.add_runtime_dependency %q<jquery-rails>, ["~> 2.2.1"]
48
+ s.add_runtime_dependency %q<jquery-ui-rails>, ["~> 3.0.1"]
49
+ s.add_runtime_dependency %q<sass-rails>, ['~> 3.2.3']
50
+ s.add_runtime_dependency %q<coffee-rails>, ['~> 3.2.1']
51
+ s.add_runtime_dependency %q<compass-rails>, ['~> 1.0.3']
52
+ s.add_runtime_dependency %q<sassy-buttons>, ['~> 0.1.3']
53
+ s.add_runtime_dependency %q<rails3-jquery-autocomplete>, ['~> 1.0.10']
54
+ s.add_runtime_dependency %q<tvdeyen-handles_sortable_columns>, ['~> 0.1.5']
55
55
 
56
56
  s.add_development_dependency %q<bumpy>
57
- s.add_development_dependency %q<capybara>, ['1.1.4']
57
+ s.add_development_dependency %q<capybara>, ['~> 2.0.3']
58
58
  s.add_development_dependency %q<factory_girl_rails>
59
- s.add_development_dependency %q<rspec-rails>, ['2.12.0']
59
+ #s.add_development_dependency %q<rspec-rails>, ['~> 2.13.0']
60
60
  s.add_development_dependency %q<sqlite3>
61
61
  s.add_development_dependency %q<yard>
62
62
  s.add_development_dependency %q<redcarpet>
@@ -0,0 +1,54 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ Created by FontForge 20100429 at Sun Feb 24 00:13:31 2013
6
+ By root
7
+ Copyright (C) 2012 by original authors @ fontello.com
8
+ </metadata>
9
+ <defs>
10
+ <font id="alchemy" horiz-adv-x="830" >
11
+ <font-face
12
+ font-family="alchemy"
13
+ font-weight="500"
14
+ font-stretch="normal"
15
+ units-per-em="1000"
16
+ panose-1="2 0 6 3 0 0 0 0 0 0"
17
+ ascent="850"
18
+ descent="-150"
19
+ bbox="14 -150 955 850"
20
+ underline-thickness="50"
21
+ underline-position="-100"
22
+ unicode-range="U+229E-1F50E"
23
+ />
24
+ <missing-glyph horiz-adv-x="364"
25
+ d="M33 0v666h265v-666h-265zM66 33h199v600h-199v-600z" />
26
+ <glyph glyph-name=".notdef" horiz-adv-x="364"
27
+ d="M33 0v666h265v-666h-265zM66 33h199v600h-199v-600z" />
28
+ <glyph glyph-name=".null" horiz-adv-x="0"
29
+ />
30
+ <glyph glyph-name="nonmarkingreturn" horiz-adv-x="333"
31
+ />
32
+ <glyph glyph-name="uni229E" unicode="&#x229e;"
33
+ d="M715 750q42 0 71 -29t29 -71v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-40 0 -70 30t-30 70v600q0 41 29.5 70.5t70.5 29.5h600zM665 300v100h-200v200h-100v-200h-200v-100h200v-200h100v200h200z" />
34
+ <glyph glyph-name="uni229F" unicode="&#x229f;"
35
+ d="M715 750q42 0 71 -29t29 -71v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-40 0 -70 30t-30 70v600q0 41 29.5 70.5t70.5 29.5h600zM665 300v100h-500v-100h500z" />
36
+ <glyph glyph-name="uni27F2" unicode="&#x27f2;" horiz-adv-x="970"
37
+ d="M547 736q171 0 289 -120q119 -121 119 -290t-119 -290q-118 -120 -289 -120q-143 0 -252 88l70 74q84 -60 182 -60q126 0 216 90t90 218t-90 218t-216 90q-124 0 -214 -87q-91 -87 -92 -211h142l-184 -204l-184 204h124q1 166 122 283q120 117 286 117z" />
38
+ <glyph glyph-name="uniE74F" unicode="&#xe74f;" horiz-adv-x="490"
39
+ d="M245 850l230 -364h-460zM245 -150l-230 366h460z" />
40
+ <glyph glyph-name="uniE800" unicode="&#xe800;" horiz-adv-x="930"
41
+ d="M171 146l-106 100h296v-296l-100 106l-146 -156l-100 100zM915 700l-154 -144l104 -100h-294v294l100 -104l144 154z" />
42
+ <glyph glyph-name="uniE801" unicode="&#xe801;" horiz-adv-x="927"
43
+ d="M914 728v-242l-536 -536l-364 364l535 536h243zM770 584q25 26 25 61t-25.5 60.5t-60.5 25.5t-60.5 -25.5t-25.5 -60.5t25.5 -60.5t60.5 -25.5t61 25z" />
44
+ <glyph glyph-name="uniE802" unicode="&#xe802;" horiz-adv-x="822"
45
+ d="M491 746h316v-316l-100 124l-146 -152l-100 100l152 146zM261 302l100 -100l-152 -146l122 -100h-316v316l100 -122z" />
46
+ <glyph glyph-name="uniE803" unicode="&#xe803;" horiz-adv-x="500"
47
+ d="M467 194q18 -18 18 -43t-17.5 -42t-43.5 -17t-43 16l-132 152l-132 -152q-17 -16 -43 -16t-43 16q-16 17 -16 43t16 43l138 156l-138 158q-16 17 -16 43t16 43q17 16 43 16t43 -16l132 -152l132 152q17 16 43 16t43.5 -17t17.5 -42t-18 -43l-138 -158z" />
48
+ <glyph glyph-name="uniE804" unicode="&#xe804;" horiz-adv-x="610"
49
+ d="M565 400q30 0 30 -50t-30 -50h-210v-210q0 -30 -50 -30t-50 30v210h-210q-30 0 -30 50t30 50h210v210q0 30 50 30t50 -30v-210h210z" />
50
+ <glyph glyph-name="u1F50E" unicode="&#x1f50e;" horiz-adv-x="928"
51
+ d="M335 290l25 -25l-86 -86l-72 -74l-27 27l74 73zM579.5 841q136.5 0 234 -97t97.5 -234t-97.5 -233.5t-233.5 -96.5q-64 0 -123 24l-255 -256l-184 184l256 255q-26 63 -26 123q0 137 97.5 234t234 97zM579.5 290q91.5 0 155.5 64.5t64 155.5t-64 155t-155.5 64
52
+ t-155.5 -64t-64 -155t64 -155.5t155.5 -64.5z" />
53
+ </font>
54
+ </defs></svg>
@@ -0,0 +1,151 @@
1
+ window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
2
+
3
+ # Setting jQueryUIs global animation duration to something more snappy
4
+ $.fx.speeds._default = 400
5
+
6
+ # The Alchemy object contains all base functions, that don't fit in its own module.
7
+ # All other modules uses this global Alchemy object as namespace.
8
+ $.extend Alchemy,
9
+
10
+ # Multiple picture select handler for the picture archive.
11
+ pictureSelector: ->
12
+ $selected_item_tools = $(".selected_item_tools")
13
+ $picture_selects = $(".picture_tool.select input")
14
+ $picture_selects.on "change", ->
15
+ if $picture_selects.filter(":checked").size() > 0
16
+ $selected_item_tools.show()
17
+ else
18
+ $selected_item_tools.hide()
19
+ if @checked
20
+ $(this).parent().addClass("visible").removeClass "hidden"
21
+ else
22
+ $(this).parent().removeClass("visible").addClass "hidden"
23
+ return
24
+ $("a#edit_multiple_pictures").on "click", (e) ->
25
+ $this = $(this)
26
+ picture_ids = $("input:checkbox", "#picture_archive").serialize()
27
+ e.preventDefault()
28
+ Alchemy.openWindow $this.attr("href") + "?" + picture_ids, {title: $this.attr("title"), height: 230, overflow: false}
29
+ false
30
+ return
31
+
32
+ # To show the "Please wait" overlay.
33
+ # Pass false to hide it.
34
+ pleaseWaitOverlay: (show = true) ->
35
+ $overlay = $("#overlay")
36
+ spinner = Alchemy.Spinner.medium()
37
+ if show
38
+ spinner.spin($("#overlay")[0])
39
+ $overlay.css "visibility", "visible"
40
+ else
41
+ spinner.stop()
42
+ $overlay.css "visibility", "hidden"
43
+ return
44
+
45
+ # Checks if the element is dirty (has unsaved changes)
46
+ # and only calls the Alchemy.ElementEditors.toggleFold function, if it is not dirty.
47
+ toggleElement: (id, text) ->
48
+ if Alchemy.isPageDirty()
49
+ Alchemy.openConfirmWindow
50
+ title: text.title
51
+ message: text.message
52
+ okLabel: text.okLabel
53
+ cancelLabel: text.cancelLabel
54
+ okCallback: ->
55
+ Alchemy.ElementEditors.toggleFold id
56
+ return
57
+ false
58
+ else
59
+ Alchemy.ElementEditors.toggleFold id
60
+ return
61
+
62
+ # Shows spinner while loading images and
63
+ # fades the image after its been loaded
64
+ ImageLoader: (scope = document, options = {color: '#fff'}) ->
65
+ $('img', scope).each ->
66
+ image = $(this).hide()
67
+ parent = image.parent()
68
+ spinner = Alchemy.Spinner.small options
69
+ spinner.spin parent[0]
70
+ image.on 'load', ->
71
+ image.fadeIn 600
72
+ spinner.stop()
73
+ image.on 'error', ->
74
+ spinner.stop()
75
+ image.parent().html('<span class="icon warn"/>')
76
+
77
+ removePicture: (selector) ->
78
+ $form_field = $(selector)
79
+ $element = $form_field.parents(".element_editor")
80
+ if $form_field
81
+ $form_field.val ""
82
+ $form_field.prev().remove()
83
+ $form_field.parent().addClass "missing"
84
+ Alchemy.setElementDirty $element
85
+ return
86
+
87
+ # Sets the element to saved state
88
+ setElementSaved: (selector) ->
89
+ $element = $(selector)
90
+ Alchemy.setElementClean selector
91
+ Alchemy.Buttons.enable $element
92
+ return
93
+
94
+ # Initializes all select tag with .alchemy_selectbox class as selectBoxIt instance
95
+ # Pass a jQuery scope to only init a subset of selectboxes.
96
+ SelectBox: (scope) ->
97
+ $("select.alchemy_selectbox", scope).selectBoxIt()
98
+ return
99
+
100
+ Buttons: (options) ->
101
+ $("button, input:submit, a.button").button options
102
+ return
103
+
104
+ # Selects cell tab for given name.
105
+ # Creates it if it's not present yet.
106
+ selectOrCreateCellTab: (cell_name, label) ->
107
+ if $("#cell_" + cell_name).size() is 0
108
+ $("#cells").tabs "add", "#cell_" + cell_name, label
109
+ $("#cell_" + cell_name).addClass "sortable_cell"
110
+ $("#cells").tabs "select", "cell_" + cell_name
111
+ return
112
+
113
+ # Inits the cell tabs
114
+ buildTabbedCells: (label) ->
115
+ $cells = $("<div id=\"cells\"/>")
116
+ $("#cell_for_other_elements").wrap $cells
117
+ $("#cells").prepend "<ul><li><a href=\"#cell_for_other_elements\">" + label + "</a></li></ul>"
118
+ $("#cells").tabs().tabs "paging",
119
+ follow: true
120
+ followOnSelect: true
121
+ return
122
+
123
+ # Logs exception to js console, if present.
124
+ debug: (e) ->
125
+ if window["console"]
126
+ console.debug e
127
+ console.trace()
128
+ return
129
+
130
+ getUrlParam: (name) ->
131
+ results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec(window.location.href)
132
+ results[1] or 0 if results
133
+ return
134
+
135
+ isiPhone: navigator.userAgent.match(/iPhone/i) isnt null
136
+ isiPad: navigator.userAgent.match(/iPad/i) isnt null
137
+ isiPod: navigator.userAgent.match(/iPod/i) isnt null
138
+ isiOS: navigator.userAgent.match(/iPad|iPhone|iPod/i) isnt null
139
+ isFirefox: navigator.userAgent.match(/Firefox/i) isnt null
140
+ isChrome: navigator.userAgent.match(/Chrome/i) isnt null
141
+ isSafari: navigator.userAgent.match(/Safari/i) isnt null
142
+ isIE: navigator.userAgent.match(/MSIE/i) isnt null
143
+
144
+ Alchemy.getBrowserVersion = (browser) ->
145
+ (if Alchemy["is" + browser] then parseInt(navigator.userAgent.match(new RegExp(browser + ".[0-9]+", "i"))[0].replace(new RegExp(browser + "."), ""), 10) else null)
146
+ return
147
+
148
+ Alchemy.ChromeVersion = Alchemy.getBrowserVersion("Chrome")
149
+ Alchemy.FirefoxVersion = Alchemy.getBrowserVersion("Firefox")
150
+ Alchemy.SafariVersion = Alchemy.getBrowserVersion("Safari")
151
+ Alchemy.IEVersion = Alchemy.getBrowserVersion("MSIE")
@@ -14,13 +14,14 @@ Alchemy.Buttons =
14
14
 
15
15
  disable: (button) ->
16
16
  $button = $(button)
17
- spinner = '<img src="/assets/alchemy/ajax_loader.gif" style="width: 16px; height: 16px">'
17
+ spinner = Alchemy.Spinner.small()
18
18
  $button.data('label', $button.text())
19
19
  $button.attr('disabled', true)
20
20
  $button.addClass('disabled')
21
21
  $button.css
22
22
  width: $button.outerWidth()
23
- $button.html(spinner)
23
+ $button.text('')
24
+ spinner.spin($button[0])
24
25
  return true
25
26
 
26
27
  enable: (scope) ->
@@ -0,0 +1,31 @@
1
+ window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
2
+
3
+ $.extend Alchemy,
4
+
5
+ Datepicker: (scope) ->
6
+ browserHasDatepicker = Alchemy.isiOS
7
+ datepicker_options =
8
+ dateFormat: "yy-mm-dd"
9
+ changeMonth: true
10
+ changeYear: true
11
+ showWeek: true
12
+ showButtonPanel: true
13
+ showOtherMonths: true
14
+ onSelect: ->
15
+ Alchemy.setElementDirty $(this).parents("div.element_editor")
16
+
17
+ if Alchemy.locale is "de"
18
+ $.extend datepicker_options,
19
+ dateFormat: "dd.mm.yy"
20
+ dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
21
+ dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
22
+ monthNames: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]
23
+ monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
24
+ closeText: "Ok"
25
+ currentText: "Heute"
26
+ weekHeader: "KW"
27
+ nextText: "nächster"
28
+ prevText: "vorheriger"
29
+
30
+ # Initializes the jQueryUI datepicker and disables the browsers default Datepicker unless the browser is iOS.
31
+ $('input[type="date"], input.date', scope).datepicker(datepicker_options).prop "type", "text" unless browserHasDatepicker
@@ -47,7 +47,7 @@ if (typeof(Alchemy) === 'undefined') {
47
47
  data: params_string,
48
48
  complete: function() {
49
49
  $(event.target).css("cursor", "auto");
50
- Alchemy.refreshTrashWindow(page_id);
50
+ Alchemy.TrashWindow.refresh(page_id);
51
51
  }
52
52
  });
53
53
  },
@@ -0,0 +1,98 @@
1
+ window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
2
+
3
+ # Handlers for element editors.
4
+ #
5
+ # It provides folding of element editors and
6
+ # selecting element editors from the preview frame
7
+ # and the elenents window.
8
+ #
9
+ Alchemy.ElementEditors =
10
+
11
+ # Binds all events to element editor partials.
12
+ # Calles once per page load.
13
+ init: ->
14
+ $elements = $("#element_area .element_editor")
15
+ self = Alchemy.ElementEditors
16
+ self.reinit $elements
17
+ return
18
+
19
+ # Binds events to all given element editors
20
+ # Called after replacing element editors via ajax.
21
+ reinit: (elements) ->
22
+ self = Alchemy.ElementEditors
23
+ $elements = $(elements)
24
+ $elements.each ->
25
+ self.bindEvent this
26
+ return
27
+ $elements.find(".element_head").click self.onClickElement
28
+ $elements.find(".element_head").dblclick ->
29
+ id = $(this).parent().attr("id").replace(/\D/g, "")
30
+ self.toggleFold id
31
+ return
32
+ return
33
+
34
+ # Click event handler.
35
+ # Also triggers custom 'Alchemy.SelectElement' event on target element in preview frame.
36
+ onClickElement: (e) ->
37
+ self = Alchemy.ElementEditors
38
+ $element = $(this).parent(".element_editor")
39
+ id = $element.attr("id").replace(/\D/g, "")
40
+ e.preventDefault()
41
+ $("#element_area .element_editor").removeClass "selected"
42
+ $element.addClass "selected"
43
+ self.scrollToElement this
44
+ $frame_elements = document.getElementById("alchemyPreviewWindow").contentWindow.jQuery("[data-alchemy-element]")
45
+ $selected_element = $frame_elements.closest("[data-alchemy-element=\"" + id + "\"]")
46
+ $selected_element.trigger "Alchemy.SelectElement"
47
+ return
48
+
49
+ # Binds the custom 'Alchemy.SelectElementEditor' event.
50
+ # Triggered, if an element gets selected inside the preview iframe.
51
+ bindEvent: (element) ->
52
+ self = Alchemy.ElementEditors
53
+ $(element).bind "Alchemy.SelectElementEditor", self.selectElement
54
+ return
55
+
56
+ # Selects an element in the element window.
57
+ # Expands the element, if necessary.
58
+ # Also chooses the right cell, if necessary.
59
+ # Can be triggered through custom event 'Alchemy.SelectElementEditor'
60
+ # Used by the elements on click events in the preview frame.
61
+ selectElement: (e) ->
62
+ self = Alchemy.ElementEditors
63
+ id = @id.replace(/\D/g, "")
64
+ $element = $(this)
65
+ $elements = $("#element_area .element_editor")
66
+ $cells = $("#cells .sortable_cell")
67
+ e.preventDefault()
68
+ $elements.removeClass "selected"
69
+ $element.addClass "selected"
70
+ if $cells.size() > 0
71
+ $cell = $element.parent(".sortable_cell")
72
+ $("#cells").tabs "option", "active", $cells.index($cell)
73
+ if $element.hasClass("folded")
74
+ self.toggleFold id
75
+ else
76
+ self.scrollToElement this
77
+ return
78
+
79
+ # Scrolls the element window to given element editor dom element.
80
+ scrollToElement: (el) ->
81
+ $("#alchemyElementWindow").scrollTo el,
82
+ duration: 400
83
+ offset: -10
84
+ return
85
+
86
+ # Folds or expands the element editor with the given id.
87
+ toggleFold: (id) ->
88
+ self = Alchemy.ElementEditors
89
+ spinner = Alchemy.Spinner.small()
90
+ element = $('.ajax_folder', '#element_' + id)
91
+ $("#element_" + id + "_folder").hide()
92
+ element.prepend(spinner.spin().el)
93
+ $.post Alchemy.routes.fold_admin_element_path(id), ->
94
+ $("#element_" + id + "_folder").show()
95
+ spinner.stop()
96
+ self.scrollToElement "#element_" + id
97
+ return
98
+ return