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.
- data/.gitignore +1 -1
- data/.travis.yml +3 -4
- data/Gemfile +1 -0
- data/README.md +10 -6
- data/alchemy_cms.gemspec +5 -2
- data/app/assets/images/alchemy/icons.png +0 -0
- data/app/assets/images/sassy-ie-overlay.png +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +50 -59
- data/app/assets/javascripts/alchemy/alchemy.buttons.js +14 -4
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js +8 -2
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js +11 -3
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +14 -1
- data/app/assets/javascripts/alchemy/alchemy.preview.js +1 -1
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js +12 -4
- data/app/assets/javascripts/alchemy/alchemy.uploader.js +4 -1
- data/app/assets/javascripts/alchemy/alchemy.windows.js +18 -8
- data/app/assets/stylesheets/alchemy/_defaults.scss +84 -120
- data/app/assets/stylesheets/alchemy/alchemy.css +2 -2
- data/app/assets/stylesheets/alchemy/archive.css.scss +288 -0
- data/app/assets/stylesheets/alchemy/base.css.scss +95 -390
- data/app/assets/stylesheets/alchemy/dashboard.css.scss +4 -4
- data/app/assets/stylesheets/alchemy/elements.css.scss +83 -118
- data/app/assets/stylesheets/alchemy/flash.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/form_elements.css.scss +528 -0
- data/app/assets/stylesheets/alchemy/frame.css.scss +13 -39
- data/app/assets/stylesheets/alchemy/icons.css.scss +217 -228
- data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +48 -50
- data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/login.css.scss +1 -5
- data/app/assets/stylesheets/alchemy/menubar.css.scss +19 -29
- data/app/assets/stylesheets/alchemy/pagination.css.scss +3 -4
- data/app/assets/stylesheets/alchemy/sitemap.css.scss +81 -81
- data/app/assets/stylesheets/alchemy/tables.css.scss +63 -57
- data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +57 -57
- data/app/assets/stylesheets/alchemy/upload.css.scss +6 -6
- data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +6 -10
- data/app/controllers/alchemy/admin/attachments_controller.rb +5 -4
- data/app/controllers/alchemy/admin/base_controller.rb +1 -9
- data/app/controllers/alchemy/admin/contents_controller.rb +4 -6
- data/app/controllers/alchemy/admin/elements_controller.rb +2 -2
- data/app/controllers/alchemy/admin/pages_controller.rb +2 -2
- data/app/controllers/alchemy/admin/pictures_controller.rb +74 -15
- data/app/controllers/alchemy/attachments_controller.rb +8 -2
- data/app/controllers/alchemy/base_controller.rb +47 -5
- data/app/controllers/alchemy/elements_controller.rb +1 -1
- data/app/controllers/alchemy/messages_controller.rb +12 -12
- data/app/controllers/alchemy/pages_controller.rb +5 -1
- data/app/controllers/alchemy/pictures_controller.rb +9 -4
- data/app/controllers/alchemy/user_sessions_controller.rb +2 -4
- data/app/helpers/alchemy/admin/base_helper.rb +98 -19
- data/app/helpers/alchemy/admin/contents_helper.rb +2 -2
- data/app/helpers/alchemy/admin/elements_helper.rb +2 -3
- data/app/helpers/alchemy/base_helper.rb +6 -5
- data/app/helpers/alchemy/elements_helper.rb +2 -2
- data/app/helpers/alchemy/essences_helper.rb +4 -5
- data/app/helpers/alchemy/pages_helper.rb +15 -79
- data/app/helpers/alchemy/url_helper.rb +67 -0
- data/app/mailers/alchemy/messages.rb +1 -1
- data/app/mailers/alchemy/notifications.rb +1 -1
- data/app/models/alchemy/attachment.rb +11 -2
- data/app/models/alchemy/cell.rb +20 -10
- data/app/models/alchemy/content.rb +4 -3
- data/app/models/alchemy/element.rb +170 -178
- data/app/models/alchemy/language/code.rb +4 -1
- data/app/models/alchemy/message.rb +19 -3
- data/app/models/alchemy/page.rb +45 -40
- data/app/models/alchemy/picture.rb +24 -2
- data/app/models/alchemy/user.rb +2 -3
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +12 -12
- data/app/views/alchemy/admin/attachments/_attachment.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/create.js.erb +1 -0
- data/app/views/alchemy/admin/attachments/edit.html.erb +9 -3
- data/app/views/alchemy/admin/attachments/index.html.erb +3 -2
- data/app/views/alchemy/admin/contents/_missing.html.erb +1 -1
- data/app/views/alchemy/admin/contents/create.js.erb +54 -0
- data/app/views/alchemy/admin/contents/new.html.erb +9 -4
- data/app/views/alchemy/admin/elements/{_add_content.html.erb → _add_picture.html.erb} +4 -4
- data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -1
- data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -1
- data/app/views/alchemy/admin/elements/{_picture_editor.html.erb → _picture_gallery_editor.html.erb} +7 -11
- data/app/views/alchemy/admin/elements/fold.js.erb +46 -0
- data/app/views/alchemy/admin/elements/index.html.erb +24 -24
- data/app/views/alchemy/admin/elements/list.js.erb +11 -9
- data/app/views/alchemy/admin/essence_files/assign.js.erb +3 -1
- data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +28 -0
- data/app/views/alchemy/admin/pages/_contactform_links.html.erb +8 -6
- data/app/views/alchemy/admin/pages/_external_link.html.erb +11 -9
- data/app/views/alchemy/admin/pages/_file_link.html.erb +10 -8
- data/app/views/alchemy/admin/pages/_internal_link.html.erb +14 -10
- data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page_for_links.html.erb +32 -21
- data/app/views/alchemy/admin/pages/configure.html.erb +2 -2
- data/app/views/alchemy/admin/pages/configure_external.html.erb +13 -13
- data/app/views/alchemy/admin/pages/edit.html.erb +2 -2
- data/app/views/alchemy/admin/pages/index.html.erb +26 -24
- data/app/views/alchemy/admin/pages/link.html.erb +2 -5
- data/app/views/alchemy/admin/partials/_upload_form.html.erb +28 -12
- data/app/views/alchemy/admin/pictures/_archive.html.erb +54 -0
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +10 -7
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +21 -22
- data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +31 -0
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +9 -0
- data/app/views/alchemy/admin/pictures/_picture.html.erb +36 -6
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -0
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
- data/app/views/alchemy/admin/pictures/create.js.erb +4 -5
- data/app/views/alchemy/admin/pictures/edit.html.erb +26 -0
- data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +39 -0
- data/app/views/alchemy/admin/pictures/index.html.erb +81 -70
- data/app/views/alchemy/admin/pictures/index.js.erb +3 -0
- data/app/views/alchemy/admin/pictures/new.html.erb +1 -0
- data/app/views/alchemy/admin/resources/index.html.erb +3 -1
- data/app/views/alchemy/admin/users/_table.html.erb +1 -1
- data/app/views/alchemy/admin/users/index.html.erb +27 -23
- data/app/views/alchemy/elements/_article_editor.html.erb +7 -2
- data/app/views/alchemy/elements/_bild_editor.html.erb +1 -1
- data/app/views/alchemy/elements/_bild_text_editor.html.erb +6 -1
- data/app/views/alchemy/elements/_bild_text_view.html.erb +3 -3
- data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +1 -1
- data/app/views/alchemy/elements/_image_mosaic_view.html.erb +2 -2
- data/app/views/alchemy/elements/_intro_image_text_view.html.erb +4 -4
- data/app/views/alchemy/elements/_searchresult_editor.html.erb +4 -1
- data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +2 -3
- data/app/views/alchemy/essences/_essence_picture_tools.html.erb +1 -1
- data/app/views/alchemy/search/_form.html.erb +8 -0
- data/app/views/alchemy/search/_result.html.erb +3 -2
- data/app/views/alchemy/search/_results.html.erb +28 -0
- data/app/views/alchemy/user_sessions/leave.html.erb +4 -4
- data/app/views/alchemy/user_sessions/login.html.erb +1 -2
- data/app/views/layouts/alchemy/admin.html.erb +30 -10
- data/app/views/layouts/alchemy/login.html.erb +2 -39
- data/config/alchemy/elements.yml +1 -2
- data/config/alchemy/page_layouts.yml +8 -5
- data/config/authorization_rules.rb +27 -18
- data/config/initializers/localeapp.rb +9 -0
- data/config/locales/alchemy.de.yml +93 -56
- data/config/locales/alchemy.en.yml +73 -50
- data/config/routes.rb +3 -1
- data/db/migrate/20120704181529_add_upload_hash_to_alchemy_picture.rb +5 -0
- data/db/migrate/20120705214247_acts_as_taggable_on_migration.rb +28 -0
- data/db/migrate/20120728185830_add_cached_tag_list_to_alchemy_pictures.rb +5 -0
- data/db/migrate/20120831135441_set_alchemy_languages_country_code_default_to_empty_string.rb +9 -0
- data/lib/alchemy/capistrano.rb +2 -2
- data/lib/alchemy/essence.rb +14 -0
- data/lib/alchemy/page_layout.rb +0 -6
- data/lib/alchemy/resource.rb +9 -15
- data/lib/alchemy/upgrader.rb +18 -3
- data/lib/alchemy/version.rb +5 -1
- data/lib/alchemy_cms.rb +4 -1
- data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +16 -6
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +17 -3
- data/lib/rails/generators/alchemy/elements/elements_generator.rb +6 -1
- data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +10 -1
- data/lib/rails/generators/alchemy/elements/templates/view.html.erb +17 -18
- data/lib/rails/generators/alchemy/scaffold/files/pages.html.erb +4 -2
- data/lib/tasks/fleximage.rake +2 -2
- data/spec/controllers/admin/contents_controller_spec.rb +2 -2
- data/spec/controllers/admin/elements_controller_spec.rb +30 -1
- data/spec/controllers/admin/pages_controller_spec.rb +35 -18
- data/spec/controllers/admin/trash_controller_spec.rb +40 -16
- data/spec/controllers/attachments_controller_spec.rb +62 -0
- data/spec/controllers/base_controller_spec.rb +43 -42
- data/spec/controllers/elements_controller_spec.rb +30 -0
- data/spec/controllers/pages_controller_spec.rb +22 -5
- data/spec/controllers/pictures_controller_spec.rb +82 -0
- data/spec/dummy/app/models/event.rb +2 -1
- data/spec/dummy/config/database.yml +3 -2
- data/spec/dummy/db/schema.rb +51 -27
- data/spec/factories.rb +29 -8
- data/spec/helpers/admin/base_helper_spec.rb +134 -21
- data/spec/helpers/admin/contents_helper_spec.rb +2 -2
- data/spec/helpers/admin/elements_helper_spec.rb +17 -9
- data/spec/helpers/admin/essences_helper_spec.rb +7 -6
- data/spec/helpers/essences_helper_spec.rb +8 -7
- data/spec/helpers/pages_helper_spec.rb +208 -325
- data/spec/helpers/url_helper_spec.rb +171 -0
- data/spec/integration/admin/link_overlay_spec.rb +53 -0
- data/spec/integration/admin/modules_integration_spec.rb +22 -26
- data/spec/integration/admin/pages_controller_spec.rb +10 -19
- data/spec/integration/admin/picture_library_integration_spec.rb +52 -0
- data/spec/integration/admin/resources_integration_spec.rb +68 -75
- data/spec/integration/pages_controller_spec.rb +70 -61
- data/spec/integration/security_spec.rb +3 -5
- data/spec/integration/translation_integration_spec.rb +56 -0
- data/spec/libraries/essence_spec.rb +18 -0
- data/spec/libraries/resource_spec.rb +101 -79
- data/spec/libraries/resources_helper_spec.rb +3 -0
- data/spec/models/content_spec.rb +63 -60
- data/spec/models/element_spec.rb +203 -93
- data/spec/models/language_spec.rb +90 -65
- data/spec/models/page_layout_spec.rb +37 -0
- data/spec/models/page_spec.rb +181 -113
- data/spec/models/picture_spec.rb +73 -26
- data/spec/models/resource_spec.rb +52 -23
- data/spec/support/alchemy/specs_helpers.rb +2 -0
- data/spec/support/image.png +0 -0
- data/spec/{helpers/url_helpers_spec.rb → url_helpers_spec.rb} +0 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.selectBoxIt.js +1909 -0
- data/vendor/assets/javascripts/jquery_plugins/preloadCssImages.jQuery_v5.js +152 -0
- metadata +106 -33
- data/app/assets/stylesheets/alchemy/buttons.css.scss +0 -361
- data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +0 -260
- data/app/views/alchemy/admin/contents/create.js.coffee +0 -49
- data/app/views/alchemy/admin/elements/fold.js.coffee +0 -37
- data/app/views/alchemy/admin/essence_pictures/destroy.js.coffee +0 -19
- data/app/views/alchemy/admin/pictures/_pictures_list.html.erb +0 -16
- data/app/views/alchemy/admin/pictures/update.js.erb +0 -3
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/locales/fo.yml +0 -5
- data/spec/page_layout_spec.rb +0 -35
- data/vendor/assets/javascripts/jquery_plugins/jquery.in-place-edit.js +0 -172
- data/vendor/assets/javascripts/jquery_plugins/jquery.sb.min.js +0 -14
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -5,12 +5,11 @@ rvm:
|
|
5
5
|
- 1.9.3
|
6
6
|
branches:
|
7
7
|
only:
|
8
|
-
-
|
8
|
+
- master
|
9
9
|
before_script:
|
10
|
-
- "
|
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
|
12
|
+
script: "bundle exec rspec spec"
|
14
13
|
env:
|
15
14
|
- DB=mysql
|
16
15
|
- DB=postgresql
|
data/Gemfile
CHANGED
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=
|
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
|
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.
|
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', :
|
86
|
+
gem 'alchemy_cms', :github => 'magiclabs/alchemy_cms'
|
83
87
|
|
84
88
|
Run in terminal:
|
85
89
|
|
data/alchemy_cms.gemspec
CHANGED
@@ -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.
|
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
|
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
|
|
Binary file
|
Binary file
|
@@ -10,53 +10,38 @@ if (typeof(Alchemy) === 'undefined') {
|
|
10
10
|
// The Alchemy JavaScript Object contains all Functions
|
11
11
|
$.extend(Alchemy, {
|
12
12
|
|
13
|
-
|
14
|
-
var
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
$(
|
27
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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(
|
184
|
-
$(
|
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
|
19
|
-
|
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
|
-
|
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
|
-
|
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').
|
74
|
+
$('div#show_element_window').
|
75
|
+
removeClass('disabled').
|
76
|
+
find('a').removeAttr('tabindex');
|
75
77
|
},
|
76
78
|
disable: function() {
|
77
|
-
$('div#show_element_window').
|
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').
|
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
|
|
@@ -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
|
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.
|
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').
|
90
|
+
$('div#show_preview_window').
|
91
|
+
removeClass('disabled').
|
92
|
+
find('a').removeAttr('tabindex');
|
91
93
|
},
|
92
94
|
disable: function() {
|
93
|
-
$('div#show_preview_window').
|
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').
|
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
|
-
|
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 =
|
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
|
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
|
});
|