alchemy_cms 2.2.4 → 2.3.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/.gitignore +1 -1
  2. data/.travis.yml +3 -4
  3. data/Gemfile +1 -0
  4. data/README.md +10 -6
  5. data/alchemy_cms.gemspec +5 -2
  6. data/app/assets/images/alchemy/icons.png +0 -0
  7. data/app/assets/images/sassy-ie-overlay.png +0 -0
  8. data/app/assets/javascripts/alchemy/alchemy.base.js +50 -59
  9. data/app/assets/javascripts/alchemy/alchemy.buttons.js +14 -4
  10. data/app/assets/javascripts/alchemy/alchemy.datepicker.js +8 -2
  11. data/app/assets/javascripts/alchemy/alchemy.elements_window.js +11 -3
  12. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +1 -1
  13. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +14 -1
  14. data/app/assets/javascripts/alchemy/alchemy.preview.js +1 -1
  15. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +12 -4
  16. data/app/assets/javascripts/alchemy/alchemy.uploader.js +4 -1
  17. data/app/assets/javascripts/alchemy/alchemy.windows.js +18 -8
  18. data/app/assets/stylesheets/alchemy/_defaults.scss +84 -120
  19. data/app/assets/stylesheets/alchemy/alchemy.css +2 -2
  20. data/app/assets/stylesheets/alchemy/archive.css.scss +288 -0
  21. data/app/assets/stylesheets/alchemy/base.css.scss +95 -390
  22. data/app/assets/stylesheets/alchemy/dashboard.css.scss +4 -4
  23. data/app/assets/stylesheets/alchemy/elements.css.scss +83 -118
  24. data/app/assets/stylesheets/alchemy/flash.css.scss +1 -1
  25. data/app/assets/stylesheets/alchemy/form_elements.css.scss +528 -0
  26. data/app/assets/stylesheets/alchemy/frame.css.scss +13 -39
  27. data/app/assets/stylesheets/alchemy/icons.css.scss +217 -228
  28. data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +48 -50
  29. data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
  30. data/app/assets/stylesheets/alchemy/login.css.scss +1 -5
  31. data/app/assets/stylesheets/alchemy/menubar.css.scss +19 -29
  32. data/app/assets/stylesheets/alchemy/pagination.css.scss +3 -4
  33. data/app/assets/stylesheets/alchemy/sitemap.css.scss +81 -81
  34. data/app/assets/stylesheets/alchemy/tables.css.scss +63 -57
  35. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +57 -57
  36. data/app/assets/stylesheets/alchemy/upload.css.scss +6 -6
  37. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +6 -10
  38. data/app/controllers/alchemy/admin/attachments_controller.rb +5 -4
  39. data/app/controllers/alchemy/admin/base_controller.rb +1 -9
  40. data/app/controllers/alchemy/admin/contents_controller.rb +4 -6
  41. data/app/controllers/alchemy/admin/elements_controller.rb +2 -2
  42. data/app/controllers/alchemy/admin/pages_controller.rb +2 -2
  43. data/app/controllers/alchemy/admin/pictures_controller.rb +74 -15
  44. data/app/controllers/alchemy/attachments_controller.rb +8 -2
  45. data/app/controllers/alchemy/base_controller.rb +47 -5
  46. data/app/controllers/alchemy/elements_controller.rb +1 -1
  47. data/app/controllers/alchemy/messages_controller.rb +12 -12
  48. data/app/controllers/alchemy/pages_controller.rb +5 -1
  49. data/app/controllers/alchemy/pictures_controller.rb +9 -4
  50. data/app/controllers/alchemy/user_sessions_controller.rb +2 -4
  51. data/app/helpers/alchemy/admin/base_helper.rb +98 -19
  52. data/app/helpers/alchemy/admin/contents_helper.rb +2 -2
  53. data/app/helpers/alchemy/admin/elements_helper.rb +2 -3
  54. data/app/helpers/alchemy/base_helper.rb +6 -5
  55. data/app/helpers/alchemy/elements_helper.rb +2 -2
  56. data/app/helpers/alchemy/essences_helper.rb +4 -5
  57. data/app/helpers/alchemy/pages_helper.rb +15 -79
  58. data/app/helpers/alchemy/url_helper.rb +67 -0
  59. data/app/mailers/alchemy/messages.rb +1 -1
  60. data/app/mailers/alchemy/notifications.rb +1 -1
  61. data/app/models/alchemy/attachment.rb +11 -2
  62. data/app/models/alchemy/cell.rb +20 -10
  63. data/app/models/alchemy/content.rb +4 -3
  64. data/app/models/alchemy/element.rb +170 -178
  65. data/app/models/alchemy/language/code.rb +4 -1
  66. data/app/models/alchemy/message.rb +19 -3
  67. data/app/models/alchemy/page.rb +45 -40
  68. data/app/models/alchemy/picture.rb +24 -2
  69. data/app/models/alchemy/user.rb +2 -3
  70. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +12 -12
  71. data/app/views/alchemy/admin/attachments/_attachment.html.erb +1 -1
  72. data/app/views/alchemy/admin/attachments/create.js.erb +1 -0
  73. data/app/views/alchemy/admin/attachments/edit.html.erb +9 -3
  74. data/app/views/alchemy/admin/attachments/index.html.erb +3 -2
  75. data/app/views/alchemy/admin/contents/_missing.html.erb +1 -1
  76. data/app/views/alchemy/admin/contents/create.js.erb +54 -0
  77. data/app/views/alchemy/admin/contents/new.html.erb +9 -4
  78. data/app/views/alchemy/admin/elements/{_add_content.html.erb → _add_picture.html.erb} +4 -4
  79. data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -1
  80. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -1
  81. data/app/views/alchemy/admin/elements/{_picture_editor.html.erb → _picture_gallery_editor.html.erb} +7 -11
  82. data/app/views/alchemy/admin/elements/fold.js.erb +46 -0
  83. data/app/views/alchemy/admin/elements/index.html.erb +24 -24
  84. data/app/views/alchemy/admin/elements/list.js.erb +11 -9
  85. data/app/views/alchemy/admin/essence_files/assign.js.erb +3 -1
  86. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +28 -0
  87. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +8 -6
  88. data/app/views/alchemy/admin/pages/_external_link.html.erb +11 -9
  89. data/app/views/alchemy/admin/pages/_file_link.html.erb +10 -8
  90. data/app/views/alchemy/admin/pages/_internal_link.html.erb +14 -10
  91. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  92. data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
  93. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +32 -21
  94. data/app/views/alchemy/admin/pages/configure.html.erb +2 -2
  95. data/app/views/alchemy/admin/pages/configure_external.html.erb +13 -13
  96. data/app/views/alchemy/admin/pages/edit.html.erb +2 -2
  97. data/app/views/alchemy/admin/pages/index.html.erb +26 -24
  98. data/app/views/alchemy/admin/pages/link.html.erb +2 -5
  99. data/app/views/alchemy/admin/partials/_upload_form.html.erb +28 -12
  100. data/app/views/alchemy/admin/pictures/_archive.html.erb +54 -0
  101. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +10 -7
  102. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +21 -22
  103. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +31 -0
  104. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +9 -0
  105. data/app/views/alchemy/admin/pictures/_picture.html.erb +36 -6
  106. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -0
  107. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
  108. data/app/views/alchemy/admin/pictures/create.js.erb +4 -5
  109. data/app/views/alchemy/admin/pictures/edit.html.erb +26 -0
  110. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +39 -0
  111. data/app/views/alchemy/admin/pictures/index.html.erb +81 -70
  112. data/app/views/alchemy/admin/pictures/index.js.erb +3 -0
  113. data/app/views/alchemy/admin/pictures/new.html.erb +1 -0
  114. data/app/views/alchemy/admin/resources/index.html.erb +3 -1
  115. data/app/views/alchemy/admin/users/_table.html.erb +1 -1
  116. data/app/views/alchemy/admin/users/index.html.erb +27 -23
  117. data/app/views/alchemy/elements/_article_editor.html.erb +7 -2
  118. data/app/views/alchemy/elements/_bild_editor.html.erb +1 -1
  119. data/app/views/alchemy/elements/_bild_text_editor.html.erb +6 -1
  120. data/app/views/alchemy/elements/_bild_text_view.html.erb +3 -3
  121. data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +1 -1
  122. data/app/views/alchemy/elements/_image_mosaic_view.html.erb +2 -2
  123. data/app/views/alchemy/elements/_intro_image_text_view.html.erb +4 -4
  124. data/app/views/alchemy/elements/_searchresult_editor.html.erb +4 -1
  125. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +1 -1
  126. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +2 -3
  127. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +1 -1
  128. data/app/views/alchemy/search/_form.html.erb +8 -0
  129. data/app/views/alchemy/search/_result.html.erb +3 -2
  130. data/app/views/alchemy/search/_results.html.erb +28 -0
  131. data/app/views/alchemy/user_sessions/leave.html.erb +4 -4
  132. data/app/views/alchemy/user_sessions/login.html.erb +1 -2
  133. data/app/views/layouts/alchemy/admin.html.erb +30 -10
  134. data/app/views/layouts/alchemy/login.html.erb +2 -39
  135. data/config/alchemy/elements.yml +1 -2
  136. data/config/alchemy/page_layouts.yml +8 -5
  137. data/config/authorization_rules.rb +27 -18
  138. data/config/initializers/localeapp.rb +9 -0
  139. data/config/locales/alchemy.de.yml +93 -56
  140. data/config/locales/alchemy.en.yml +73 -50
  141. data/config/routes.rb +3 -1
  142. data/db/migrate/20120704181529_add_upload_hash_to_alchemy_picture.rb +5 -0
  143. data/db/migrate/20120705214247_acts_as_taggable_on_migration.rb +28 -0
  144. data/db/migrate/20120728185830_add_cached_tag_list_to_alchemy_pictures.rb +5 -0
  145. data/db/migrate/20120831135441_set_alchemy_languages_country_code_default_to_empty_string.rb +9 -0
  146. data/lib/alchemy/capistrano.rb +2 -2
  147. data/lib/alchemy/essence.rb +14 -0
  148. data/lib/alchemy/page_layout.rb +0 -6
  149. data/lib/alchemy/resource.rb +9 -15
  150. data/lib/alchemy/upgrader.rb +18 -3
  151. data/lib/alchemy/version.rb +5 -1
  152. data/lib/alchemy_cms.rb +4 -1
  153. data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +16 -6
  154. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +17 -3
  155. data/lib/rails/generators/alchemy/elements/elements_generator.rb +6 -1
  156. data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +10 -1
  157. data/lib/rails/generators/alchemy/elements/templates/view.html.erb +17 -18
  158. data/lib/rails/generators/alchemy/scaffold/files/pages.html.erb +4 -2
  159. data/lib/tasks/fleximage.rake +2 -2
  160. data/spec/controllers/admin/contents_controller_spec.rb +2 -2
  161. data/spec/controllers/admin/elements_controller_spec.rb +30 -1
  162. data/spec/controllers/admin/pages_controller_spec.rb +35 -18
  163. data/spec/controllers/admin/trash_controller_spec.rb +40 -16
  164. data/spec/controllers/attachments_controller_spec.rb +62 -0
  165. data/spec/controllers/base_controller_spec.rb +43 -42
  166. data/spec/controllers/elements_controller_spec.rb +30 -0
  167. data/spec/controllers/pages_controller_spec.rb +22 -5
  168. data/spec/controllers/pictures_controller_spec.rb +82 -0
  169. data/spec/dummy/app/models/event.rb +2 -1
  170. data/spec/dummy/config/database.yml +3 -2
  171. data/spec/dummy/db/schema.rb +51 -27
  172. data/spec/factories.rb +29 -8
  173. data/spec/helpers/admin/base_helper_spec.rb +134 -21
  174. data/spec/helpers/admin/contents_helper_spec.rb +2 -2
  175. data/spec/helpers/admin/elements_helper_spec.rb +17 -9
  176. data/spec/helpers/admin/essences_helper_spec.rb +7 -6
  177. data/spec/helpers/essences_helper_spec.rb +8 -7
  178. data/spec/helpers/pages_helper_spec.rb +208 -325
  179. data/spec/helpers/url_helper_spec.rb +171 -0
  180. data/spec/integration/admin/link_overlay_spec.rb +53 -0
  181. data/spec/integration/admin/modules_integration_spec.rb +22 -26
  182. data/spec/integration/admin/pages_controller_spec.rb +10 -19
  183. data/spec/integration/admin/picture_library_integration_spec.rb +52 -0
  184. data/spec/integration/admin/resources_integration_spec.rb +68 -75
  185. data/spec/integration/pages_controller_spec.rb +70 -61
  186. data/spec/integration/security_spec.rb +3 -5
  187. data/spec/integration/translation_integration_spec.rb +56 -0
  188. data/spec/libraries/essence_spec.rb +18 -0
  189. data/spec/libraries/resource_spec.rb +101 -79
  190. data/spec/libraries/resources_helper_spec.rb +3 -0
  191. data/spec/models/content_spec.rb +63 -60
  192. data/spec/models/element_spec.rb +203 -93
  193. data/spec/models/language_spec.rb +90 -65
  194. data/spec/models/page_layout_spec.rb +37 -0
  195. data/spec/models/page_spec.rb +181 -113
  196. data/spec/models/picture_spec.rb +73 -26
  197. data/spec/models/resource_spec.rb +52 -23
  198. data/spec/support/alchemy/specs_helpers.rb +2 -0
  199. data/spec/support/image.png +0 -0
  200. data/spec/{helpers/url_helpers_spec.rb → url_helpers_spec.rb} +0 -0
  201. data/vendor/assets/javascripts/jquery_plugins/jquery.selectBoxIt.js +1909 -0
  202. data/vendor/assets/javascripts/jquery_plugins/preloadCssImages.jQuery_v5.js +152 -0
  203. metadata +106 -33
  204. data/app/assets/stylesheets/alchemy/buttons.css.scss +0 -361
  205. data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +0 -260
  206. data/app/views/alchemy/admin/contents/create.js.coffee +0 -49
  207. data/app/views/alchemy/admin/elements/fold.js.coffee +0 -37
  208. data/app/views/alchemy/admin/essence_pictures/destroy.js.coffee +0 -19
  209. data/app/views/alchemy/admin/pictures/_pictures_list.html.erb +0 -16
  210. data/app/views/alchemy/admin/pictures/update.js.erb +0 -3
  211. data/spec/dummy/config/locales/en.yml +0 -5
  212. data/spec/dummy/config/locales/fo.yml +0 -5
  213. data/spec/page_layout_spec.rb +0 -35
  214. data/vendor/assets/javascripts/jquery_plugins/jquery.in-place-edit.js +0 -172
  215. data/vendor/assets/javascripts/jquery_plugins/jquery.sb.min.js +0 -14
data/.gitignore CHANGED
@@ -18,4 +18,4 @@ spec/dummy/uploads/
18
18
  spec/dummy/db/test.sqlite3-journal
19
19
  spec/dummy/db/seeds.rb
20
20
  .rvmrc
21
- /coverage/
21
+ spec/dummy/config/locales/**/*
@@ -5,12 +5,11 @@ rvm:
5
5
  - 1.9.3
6
6
  branches:
7
7
  only:
8
- - 2.2-stable
8
+ - master
9
9
  before_script:
10
- - "export DISPLAY=:99.0"
11
- - "sh -e /etc/init.d/xvfb start"
10
+ - "phantomjs -v"
12
11
  - "sh -c 'cd spec/dummy && RAILS_ENV=test bundle exec rake db:create db:schema:load --trace'"
13
- script: "bundle exec rspec spec --format=doc"
12
+ script: "bundle exec rspec spec"
14
13
  env:
15
14
  - DB=mysql
16
15
  - DB=postgresql
data/Gemfile CHANGED
@@ -24,6 +24,7 @@ end
24
24
 
25
25
  group :development do
26
26
  unless ENV['CI']
27
+ #gem 'localeapp'
27
28
  gem 'guard-spork'
28
29
  gem 'debugger', :platform => :ruby_19
29
30
  gem 'ruby-debug', :platform => :ruby_18
data/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  Alchemy CMS
2
2
  ===========
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=2.2-stable)](http://travis-ci.org/magiclabs/alchemy_cms)
5
- ![Status](http://stillmaintained.com/magiclabs/alchemy_cms.png)
4
+ [![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=master)](http://travis-ci.org/magiclabs/alchemy_cms)
5
+ [![Maintenance Status](http://stillmaintained.com/magiclabs/alchemy_cms.png)](http://stillmaintained.com/magiclabs/alchemy_cms)
6
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/magiclabs/alchemy_cms)
7
+ [![Dependency Status](https://gemnasium.com/magiclabs/alchemy_cms.png)](https://gemnasium.com/magiclabs/alchemy_cms)
6
8
 
7
9
  About
8
10
  -----
9
11
 
12
+ **This branch is a beta development branch. For productive environments use the current rubygems version, or the [latest stable branch (2.2-stable)](https://github.com/magiclabs/alchemy_cms/tree/2.2-stable).**
13
+
10
14
  Alchemy is a Rails 3 CMS with a flexible content storing architecture.
11
15
 
12
16
  Read more on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
@@ -33,9 +37,9 @@ Features
33
37
  Rails Version
34
38
  -------------
35
39
 
36
- This version of Alchemy runs with Rails 3.2 only.
40
+ This version of Alchemy runs with Rails 3.2.6+.
37
41
 
38
- If you are looking for a Rails 3.1 compatible version check the 2.1-stable branch.
42
+ If you are looking for a Rails 3.1 compatible version check the 2.2-stable branch.
39
43
 
40
44
  If you are looking for a Rails 3.0 compatible version check the 2.0-stable branch.
41
45
 
@@ -51,7 +55,7 @@ Installation
51
55
 
52
56
  Use the installer (recommended):
53
57
 
54
- gem install alchemy_cms
58
+ gem install alchemy_cms --pre
55
59
  alchemy new my_magicpage
56
60
 
57
61
  Start the local server:
@@ -79,7 +83,7 @@ Add to existing Rails project
79
83
 
80
84
  In your Gemfile:
81
85
 
82
- gem 'alchemy_cms', :git => 'git://github.com/magiclabs/alchemy_cms.git'
86
+ gem 'alchemy_cms', :github => 'magiclabs/alchemy_cms'
83
87
 
84
88
  Run in terminal:
85
89
 
@@ -20,9 +20,10 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
- s.add_runtime_dependency(%q<rails>, ["~> 3.2.11"])
23
+ s.add_runtime_dependency(%q<rails>, ["~> 3.2.5"])
24
24
  s.add_runtime_dependency(%q<authlogic>)
25
25
  s.add_runtime_dependency(%q<awesome_nested_set>, ["~> 2.0"])
26
+ s.add_runtime_dependency(%q<acts-as-taggable-on>, ["~> 2.1"])
26
27
  s.add_runtime_dependency(%q<declarative_authorization>, ["~> 0.5.4"])
27
28
  s.add_runtime_dependency(%q<tvdeyen-fleximage>, ["~> 1.2.0"])
28
29
  s.add_runtime_dependency(%q<kaminari>, ["~> 0.13.0"])
@@ -34,11 +35,13 @@ Gem::Specification.new do |s|
34
35
  s.add_runtime_dependency(%q<attachment_magic>, ["~> 0.2.1"])
35
36
  s.add_runtime_dependency(%q<sass-rails>, ['~> 3.2.3'])
36
37
  s.add_runtime_dependency(%q<coffee-rails>, ['~> 3.2.1'])
38
+ s.add_runtime_dependency(%q<compass-rails>, ['~> 1.0.3'])
39
+ s.add_runtime_dependency(%q<sassy-buttons>, ['~> 0.1.3'])
37
40
 
38
41
  s.add_development_dependency(%q<bumpy>)
39
42
  s.add_development_dependency(%q<capybara>)
40
43
  s.add_development_dependency(%q<factory_girl_rails>, ['~> 1.7.0'])
41
- s.add_development_dependency(%q<rspec-rails>, ['2.12.0'])
44
+ s.add_development_dependency(%q<rspec-rails>)
42
45
  s.add_development_dependency(%q<sqlite3>)
43
46
  s.add_development_dependency(%q<yard>)
44
47
 
@@ -10,53 +10,38 @@ if (typeof(Alchemy) === 'undefined') {
10
10
  // The Alchemy JavaScript Object contains all Functions
11
11
  $.extend(Alchemy, {
12
12
 
13
- inPlaceEditor: function(options) {
14
- var defaults = {
15
- save_label: 'save',
16
- cancel_label: 'cancel'
17
- };
18
- var settings = jQuery.extend({}, defaults, options);
19
- var cancel_handler = function(element) {
20
- jQuery(element).css({
21
- overflow: 'hidden'
22
- });
23
- return true;
24
- };
25
- var submit_handler = function(element, id, value) {
26
- $(element).css({
27
- overflow: 'hidden'
28
- });
29
- id = id.match(/\d+/)[0];
30
- $.ajax({
31
- url: Alchemy.routes.admin_picture_path(id),
32
- type: 'PUT',
33
- data: {
34
- name: value,
35
- size: Alchemy.getUrlParam('size')
36
- }
37
- });
38
- return false;
39
- };
40
-
41
- $('#alchemy .rename').click(function() {
42
- $(this).css({
43
- overflow: 'visible'
44
- });
13
+ pictureSelector: function() {
14
+ var
15
+ $selected_item_tools = $('.selected_item_tools'),
16
+ $picture_selects = $('.picture_tool.select input');
17
+ $picture_selects.on('change', function() {
18
+ if ($picture_selects.filter(':checked').size() > 0) {
19
+ $selected_item_tools.show();
20
+ } else {
21
+ $selected_item_tools.hide();
22
+ }
23
+ if (this.checked) {
24
+ $(this).parent().addClass('visible').removeClass('hidden');
25
+ } else {
26
+ $(this).parent().removeClass('visible').addClass('hidden');
27
+ }
45
28
  });
46
-
47
- $('#alchemy .rename').inPlaceEdit({
48
- submit: submit_handler,
49
- cancel: cancel_handler,
50
- html: ' \
51
- <div class="inplace-edit"> \
52
- <input type="text" value="" class="thin_border field" /> \
53
- <div class="buttons"> \
54
- <input type="button" value="' + settings.save_label + '" class="save-button button" /> \
55
- <input type="button" value="' + settings.cancel_label + '" class="cancel-button button" /> \
56
- </div> \
57
- </div>'
29
+ $('a#edit_multiple_pictures').on('click', function(e) {
30
+ var
31
+ $this = $(this),
32
+ picture_ids = $("input:checkbox", '#picture_archive').serialize();
33
+ e.preventDefault();
34
+ Alchemy.openWindow(
35
+ $this.attr('href') + '?' + picture_ids,
36
+ $this.attr('title'),
37
+ 400,
38
+ 230,
39
+ false,
40
+ true,
41
+ false
42
+ );
43
+ return false;
58
44
  });
59
-
60
45
  },
61
46
 
62
47
  pleaseWaitOverlay: function(show) {
@@ -180,26 +165,14 @@ if (typeof(Alchemy) === 'undefined') {
180
165
  });
181
166
  },
182
167
 
183
- SelectBox: function(selector) {
184
- $(selector).sb({
185
- animDuration: 0,
186
- fixedWidth: true
187
- });
168
+ SelectBox: function(scope) {
169
+ $('select', scope).selectBoxIt();
188
170
  },
189
171
 
190
172
  Buttons: function(options) {
191
173
  $("button, input:submit, a.button").button(options);
192
174
  },
193
175
 
194
- handleEssenceCheckbox: function(checkbox) {
195
- var $checkbox = $(checkbox);
196
- if (checkbox.checked) {
197
- $('#' + checkbox.id + '_hidden').remove();
198
- } else {
199
- $checkbox.after('<input type="hidden" value="0" name="' + checkbox.name + '" id="' + checkbox.id + '_hidden">');
200
- }
201
- },
202
-
203
176
  selectOrCreateCellTab: function(cell_name, label) {
204
177
  if ($('#cell_' + cell_name).size() === 0) {
205
178
  $('#cells').tabs('add', '#cell_' + cell_name, label);
@@ -220,8 +193,26 @@ if (typeof(Alchemy) === 'undefined') {
220
193
  if (results) return results[1] || 0;
221
194
  },
222
195
 
196
+ isiPhone: navigator.userAgent.match(/iPhone/i) !== null,
197
+ isiPad: navigator.userAgent.match(/iPad/i) !== null,
198
+ isiPod: navigator.userAgent.match(/iPod/i) !== null,
199
+ isiOS: navigator.userAgent.match(/iPad|iPhone|iPod/i) !== null,
200
+ isFirefox: navigator.userAgent.match(/Firefox/i) !== null,
201
+ isChrome: navigator.userAgent.match(/Chrome/i) !== null,
202
+ isSafari: navigator.userAgent.match(/Safari/i) !== null,
203
+ isIE: navigator.userAgent.match(/MSIE/i) !== null,
204
+
223
205
  locale: 'en'
224
206
 
225
207
  });
226
208
 
209
+ Alchemy.getBrowserVersion = function(browser) {
210
+ return Alchemy['is' + browser] ? parseInt(navigator.userAgent.match(new RegExp(browser + ".[0-9]+", 'i'))[0].replace(new RegExp(browser + '.'), ''), 10) : null;
211
+ }
212
+
213
+ Alchemy.ChromeVersion = Alchemy.getBrowserVersion('Chrome');
214
+ Alchemy.FirefoxVersion = Alchemy.getBrowserVersion('Firefox');
215
+ Alchemy.SafariVersion = Alchemy.getBrowserVersion('Safari');
216
+ Alchemy.IEVersion = Alchemy.getBrowserVersion('MSIE');
217
+
227
218
  })(jQuery);
@@ -15,16 +15,18 @@ if (typeof(Alchemy) === 'undefined') {
15
15
  disableButton: function(button) {
16
16
  var $button = $(button),
17
17
  $clone = $button.clone(),
18
- width = $button.outerWidth(),
19
- text = $button.text();
18
+ width = Alchemy.getButtonWidth($button),
19
+ height = Alchemy.getButtonHeight($button),
20
+ spinner = '<img src="/assets/alchemy/ajax_loader.gif" style="width: 16px; height: 16px">';
20
21
  $button.hide().addClass('disabled');
21
22
  $button.parent().append($clone);
22
23
  $clone.attr({
23
24
  disabled: true,
24
25
  href: 'javascript:void(0)'
25
26
  }).addClass('cloned-button').css({
26
- width: width
27
- }).html('<img src="/assets/alchemy/ajax_loader.gif" style="width: 16px; height: 16px">').show();
27
+ width: width,
28
+ 'line-height': height + 'px'
29
+ }).html(spinner).show();
28
30
  return true;
29
31
  },
30
32
 
@@ -33,6 +35,14 @@ if (typeof(Alchemy) === 'undefined') {
33
35
  $button.show().removeClass('disabled');
34
36
  $button.parent().find('.cloned-button').remove();
35
37
  return true;
38
+ },
39
+
40
+ getButtonWidth: function($button) {
41
+ return $button.outerWidth() - (parseInt($button.css('border-left-width'), 10) + parseInt($button.css('border-right-width'), 10));
42
+ },
43
+
44
+ getButtonHeight: function($button) {
45
+ return $button.outerHeight() - (parseInt($button.css('border-top-width'), 10) + parseInt($button.css('border-bottom-width'), 10));
36
46
  }
37
47
 
38
48
  });
@@ -7,13 +7,17 @@ if (typeof(Alchemy) === 'undefined') {
7
7
  $.extend(Alchemy, {
8
8
 
9
9
  Datepicker: function(selector) {
10
+ var browserHasDatepicker = Alchemy.isiOS || (Alchemy.isChrome && Alchemy.ChromeVersion >= 20);
10
11
  var datepicker_options = {
11
12
  dateFormat: 'yy-mm-dd',
12
13
  changeMonth: true,
13
14
  changeYear: true,
14
15
  showWeek: true,
15
16
  showButtonPanel: true,
16
- showOtherMonths: true
17
+ showOtherMonths: true,
18
+ onSelect: function() {
19
+ Alchemy.setElementDirty($(this).parents('div.element_editor'));
20
+ }
17
21
  };
18
22
  if (typeof(selector) === 'undefined') {
19
23
  var selector = 'input[type="date"], input.date'
@@ -32,7 +36,9 @@ if (typeof(Alchemy) === 'undefined') {
32
36
  prevText: 'vorheriger'
33
37
  });
34
38
  }
35
- $(selector).datepicker(datepicker_options);
39
+ if (!browserHasDatepicker) {
40
+ $(selector).datepicker(datepicker_options);
41
+ }
36
42
  }
37
43
 
38
44
  });
@@ -71,13 +71,21 @@ if (typeof(Alchemy) === 'undefined') {
71
71
 
72
72
  button: {
73
73
  enable: function() {
74
- $('div#show_element_window').removeClass('disabled');
74
+ $('div#show_element_window').
75
+ removeClass('disabled').
76
+ find('a').removeAttr('tabindex');
75
77
  },
76
78
  disable: function() {
77
- $('div#show_element_window').addClass('disabled');
79
+ $('div#show_element_window').
80
+ addClass('disabled').
81
+ find('a').attr('tabindex', '-1');
78
82
  },
79
83
  toggle: function() {
80
- $('div#show_element_window').toggleClass('disabled');
84
+ if ($('div#show_element_window').hasClass('disabled')) {
85
+ Alchemy.ElementsWindow.button.enable();
86
+ } else {
87
+ Alchemy.ElementsWindow.button.disable();
88
+ }
81
89
  }
82
90
  },
83
91
 
@@ -5,7 +5,7 @@ Alchemy.GUI =
5
5
 
6
6
  initElement: ($el) ->
7
7
  Alchemy.ElementDirtyObserver($el)
8
- Alchemy.SelectBox('select', $el)
8
+ Alchemy.SelectBox($el)
9
9
  Alchemy.ButtonObserver('button.button', $el)
10
10
  Alchemy.Datepicker('input[type="date"]', $el)
11
11
  Alchemy.overlayObserver($el)
@@ -27,7 +27,10 @@
27
27
  url: Alchemy.routes.link_admin_pages_path,
28
28
  success: (data, textStatus, XMLHttpRequest) ->
29
29
  $dialog.html(data)
30
- Alchemy.SelectBox('#alchemyLinkOverlay select.alchemy_selectbox')
30
+ Alchemy.SelectBox('#alchemyLinkOverlay')
31
+ $dialog.css overflow: 'visible'
32
+ $dialog.dialog('widget').css overflow: 'visible'
33
+ Alchemy.LinkOverlay.attachEvents();
31
34
  error: (XMLHttpRequest, textStatus, errorThrown) ->
32
35
  Alchemy.AjaxErrorHandler($dialog, XMLHttpRequest.status, textStatus, errorThrown)
33
36
  })
@@ -36,6 +39,16 @@
36
39
  })
37
40
  Alchemy.LinkOverlay.current.linked_element = linked_element
38
41
 
42
+ attachEvents: ->
43
+ self = Alchemy.LinkOverlay
44
+ $('a.sitemap_pagename_link, a.show_elements_to_link', '#alchemyLinkOverlay').on 'click', (e) ->
45
+ e.preventDefault()
46
+ $this = $(this)
47
+ page_id = $this.data('page-id')
48
+ url = $this.data('url')
49
+ self.selectPage(page_id, url)
50
+ self.showElementsSelect(page_id) if $this.hasClass('show_elements_to_link')
51
+
39
52
  close : ->
40
53
  Alchemy.LinkOverlay.current.dialog('close')
41
54
  return true
@@ -72,7 +72,7 @@ Alchemy.initAlchemyPreviewMode = function() {
72
72
  clickElement: function(e) {
73
73
  var $this = $(this);
74
74
  var parent$ = window.parent.jQuery;
75
- var target_id = $this.data('alchemy-element');
75
+ var target_id = $this.attr('data-alchemy-element');
76
76
  var $element_editor = parent$('#element_area .element_editor').closest('[id="element_' + target_id + '"]');
77
77
  var $elementsWindow = parent$('#alchemyElementWindow');
78
78
  e.preventDefault();
@@ -87,15 +87,23 @@ if (typeof(Alchemy) === 'undefined') {
87
87
 
88
88
  button: {
89
89
  enable: function() {
90
- $('div#show_preview_window').removeClass('disabled');
90
+ $('div#show_preview_window').
91
+ removeClass('disabled').
92
+ find('a').removeAttr('tabindex');
91
93
  },
92
94
  disable: function() {
93
- $('div#show_preview_window').addClass('disabled');
95
+ $('div#show_preview_window').
96
+ addClass('disabled').
97
+ find('a').attr('tabindex', '-1');
94
98
  },
95
99
  toggle: function() {
96
- $('div#show_preview_window').toggleClass('disabled');
100
+ if ($('div#show_preview_window').hasClass('disabled')) {
101
+ Alchemy.PreviewWindow.button.enable();
102
+ } else {
103
+ Alchemy.PreviewWindow.button.disable();
104
+ }
97
105
  }
98
- }
106
+ },
99
107
 
100
108
  };
101
109
 
@@ -68,7 +68,10 @@ Alchemy.Uploader = {
68
68
  if (status === 200) {
69
69
  window.setTimeout(function() {
70
70
  Alchemy.closeCurrentWindow();
71
- }, 3500);
71
+ if (typeof(settings.onQueueComplete) !== 'undefined') {
72
+ settings.onQueueComplete.call();
73
+ }
74
+ }, 2000);
72
75
  }
73
76
  },
74
77
  onClientLoadStart: function(event, file) {
@@ -50,7 +50,7 @@ if (typeof(Alchemy) === 'undefined') {
50
50
  if (options.buttonId) $btn.attr({
51
51
  'id': options.buttonId
52
52
  });
53
- $lnk = $('<a title="' + options.buttonTitle + '" class="icon_button"></a>');
53
+ $lnk = $('<a title="' + options.buttonTitle + '" class="icon_button" href="#"></a>');
54
54
  $lnk.click(options.onClick);
55
55
  $lnk.append('<span class="icon ' + options.iconClass + '"></span>');
56
56
  $btn.append($lnk);
@@ -110,7 +110,7 @@ if (typeof(Alchemy) === 'undefined') {
110
110
  },
111
111
 
112
112
  openWindow: function(action_url, title, size_x, size_y, resizable, modal, overflow) {
113
- overflow == undefined ? overflow = false : overflow = overflow;
113
+ overflow == undefined ? overflow = true : overflow = overflow;
114
114
  if (size_x === 'fullscreen') {
115
115
  size_x = $(window).width() - 50;
116
116
  size_y = $(window).height() - 50;
@@ -151,7 +151,7 @@ if (typeof(Alchemy) === 'undefined') {
151
151
  top: ($(window).height() - $dialog.dialog('widget').height()) / 2
152
152
  });
153
153
  }
154
- Alchemy.SelectBox('#alchemyOverlay select.alchemy_selectbox');
154
+ Alchemy.SelectBox('#alchemyOverlay');
155
155
  Alchemy.Datepicker('#alchemyOverlay input.date, #alchemyOverlay input[type="date"]');
156
156
  Alchemy.ButtonObserver('#alchemyOverlay .button');
157
157
  Alchemy.overlayObserver('#alchemyOverlay');
@@ -164,9 +164,6 @@ if (typeof(Alchemy) === 'undefined') {
164
164
  }
165
165
  });
166
166
  },
167
- beforeClose: function() {
168
- $(".sb.open").triggerAll("close");
169
- },
170
167
  close: function() {
171
168
  $dialog.remove();
172
169
  }
@@ -294,13 +291,26 @@ if (typeof(Alchemy) === 'undefined') {
294
291
  return false;
295
292
  });
296
293
 
297
- $('a[data-alchemy-confirm]', scope).on('click', function(event) {
294
+ $('a[data-alchemy-confirm-delete]', scope).on('click', function(event) {
298
295
  var $this = $(this);
299
- var options = $this.data('alchemy-confirm');
296
+ var options = $this.data('alchemy-confirm-delete');
300
297
  event.preventDefault();
301
298
  Alchemy.confirmToDeleteWindow($this.attr('href'), options.title, options.message, options.ok_label, options.cancel_label);
302
299
  return false;
303
300
  });
301
+
302
+ $('input[data-alchemy-confirm], button[data-alchemy-confirm]', scope).on('click', function(event) {
303
+ var $this = $(this), self = this;
304
+ var options = $this.data('alchemy-confirm');
305
+ event.preventDefault();
306
+ Alchemy.openConfirmWindow($.extend(options, {
307
+ okCallback: function() {
308
+ Alchemy.pleaseWaitOverlay();
309
+ self.form.submit();
310
+ }
311
+ }));
312
+ return false;
313
+ });
304
314
  }
305
315
 
306
316
  });