alchemy_cms 2.3.2 → 2.4.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -2
- data/.travis.yml +1 -5
- data/Gemfile +4 -4
- data/README.md +22 -15
- data/alchemy_cms.gemspec +38 -38
- data/app/assets/javascripts/alchemy/alchemy.base.js +2 -2
- data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +31 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +1 -1
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js +24 -15
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +9 -3
- data/app/assets/javascripts/alchemy/alchemy.jquery_loader.js +2 -2
- data/app/assets/javascripts/alchemy/alchemy.js +1 -0
- data/app/assets/javascripts/alchemy/alchemy.menubar.js +4 -12
- data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +32 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js +4 -4
- data/app/assets/stylesheets/alchemy/_defaults.scss +0 -1
- data/app/assets/stylesheets/alchemy/alchemy.css +2 -1
- data/app/assets/stylesheets/alchemy/base.css.scss +2 -54
- data/app/assets/stylesheets/alchemy/elements.css.scss +8 -5
- data/app/assets/stylesheets/alchemy/errors.css.scss +51 -0
- data/app/assets/stylesheets/alchemy/flash.css.scss +0 -2
- data/app/assets/stylesheets/alchemy/form_elements.css.scss +31 -75
- data/app/assets/stylesheets/alchemy/icons.css.scss +5 -5
- data/app/assets/stylesheets/alchemy/menubar.css.scss +0 -2
- data/app/assets/stylesheets/alchemy/sitemap.css.scss +0 -1
- data/app/assets/stylesheets/alchemy/tables.css.scss +3 -1
- data/app/controllers/alchemy/admin/base_controller.rb +19 -12
- data/app/controllers/alchemy/admin/elements_controller.rb +52 -24
- data/app/controllers/alchemy/admin/pages_controller.rb +11 -5
- data/app/controllers/alchemy/admin/resources_controller.rb +3 -4
- data/app/controllers/alchemy/admin/users_controller.rb +1 -0
- data/app/controllers/alchemy/base_controller.rb +34 -8
- data/app/controllers/alchemy/pictures_controller.rb +16 -1
- data/app/controllers/alchemy/user_sessions_controller.rb +6 -1
- data/app/helpers/alchemy/base_helper.rb +14 -0
- data/app/helpers/alchemy/elements_helper.rb +10 -5
- data/app/helpers/alchemy/pages_helper.rb +1 -2
- data/app/helpers/alchemy/url_helper.rb +43 -24
- data/app/models/alchemy/element.rb +23 -16
- data/app/models/alchemy/page.rb +25 -14
- data/app/models/alchemy/picture.rb +24 -0
- data/app/views/alchemy/admin/contents/create.js.erb +1 -1
- data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -1
- data/app/views/alchemy/admin/elements/create.js.erb +11 -3
- data/app/views/alchemy/admin/elements/fold.js.erb +1 -1
- data/app/views/alchemy/admin/elements/new.html.erb +1 -1
- data/app/views/alchemy/admin/elements/update.js.erb +1 -1
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
- data/app/views/alchemy/admin/languages/_form.html.erb +1 -1
- 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/configure.html.erb +10 -6
- data/app/views/alchemy/admin/pages/configure_external.html.erb +1 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +1 -2
- data/app/views/alchemy/admin/pages/new.html.erb +2 -2
- data/app/views/alchemy/admin/pages/update.js.erb +10 -2
- data/app/views/alchemy/admin/partials/_sub_navigation_tab.html.erb +5 -5
- data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +2 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +2 -1
- data/app/views/alchemy/admin/pictures/show_in_window.html.erb +3 -2
- data/app/views/alchemy/admin/resources/_form.html.erb +1 -1
- data/app/views/alchemy/admin/users/_table.html.erb +4 -4
- data/app/views/alchemy/admin/users/edit.html.erb +1 -1
- data/app/views/alchemy/admin/users/new.html.erb +1 -1
- data/app/views/alchemy/base/error_notice.js.erb +1 -1
- data/app/views/alchemy/base/remote_errors.js.erb +2 -3
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +10 -7
- data/app/views/alchemy/essences/_essence_picture_view.html.erb +24 -21
- data/app/views/layouts/alchemy/admin.html.erb +9 -31
- data/bin/alchemy +20 -24
- data/config/alchemy/config.yml +6 -0
- data/config/alchemy/page_layouts.yml +2 -0
- data/config/authorization_rules.rb +1 -1
- data/config/locales/alchemy.de.yml +3 -0
- data/config/locales/alchemy.en.yml +4 -1
- data/db/migrate/20121026100815_alchemy_two_point_three.rb +312 -0
- data/lib/alchemy/mount_point.rb +9 -3
- data/lib/alchemy/page_layout.rb +89 -73
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +45 -12
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +3 -1
- data/lib/rails/generators/alchemy/essence/essence_generator.rb +51 -0
- data/lib/rails/generators/alchemy/essence/templates/editor.html.erb +18 -0
- data/lib/rails/generators/alchemy/essence/templates/view.html.erb +2 -0
- data/lib/rails/templates/alchemy.rb +1 -1
- data/lib/tasks/install.rake +57 -2
- data/spec/controllers/admin/elements_controller_spec.rb +170 -22
- data/spec/controllers/admin/trash_controller_spec.rb +1 -1
- data/spec/controllers/admin/users_controller_spec.rb +36 -0
- data/spec/controllers/base_controller_spec.rb +12 -1
- data/spec/controllers/elements_controller_spec.rb +17 -13
- data/spec/controllers/pictures_controller_spec.rb +4 -4
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/db/migrate/20121026100815_alchemy_two_point_three.rb +312 -0
- data/spec/dummy/db/migrate/20121026104128_create_events.rb +19 -0
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/factories.rb +0 -1
- data/spec/helpers/base_helper_spec.rb +48 -0
- data/spec/helpers/elements_helper_spec.rb +14 -3
- data/spec/helpers/url_helper_spec.rb +8 -3
- data/spec/integration/picture_security_spec.rb +35 -0
- data/spec/integration/translation_integration_spec.rb +6 -5
- data/spec/models/element_spec.rb +5 -5
- data/spec/models/page_layout_spec.rb +10 -16
- data/spec/models/page_spec.rb +25 -2
- data/spec/models/picture_spec.rb +24 -2
- data/spec/routing_spec.rb +115 -115
- data/spec/support/alchemy/specs_helpers.rb +4 -4
- data/{app/assets/images/alchemy → vendor/assets/images}/Jcrop.gif +0 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js +19 -243
- data/vendor/assets/javascripts/jquery_plugins/jquery.selectboxit.min.js +1 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +6 -6
- data/vendor/assets/stylesheets/jquery.Jcrop.min.css +28 -0
- metadata +48 -82
- data/app/assets/javascripts/alchemy/alchemy.buttons.js +0 -50
- data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +0 -54
- data/app/helpers/alchemy/pictures_helper.rb +0 -19
- data/db/migrate/20100607143125_create_pages.rb +0 -34
- data/db/migrate/20100607144254_create_elements.rb +0 -20
- data/db/migrate/20100607145256_create_contents.rb +0 -18
- data/db/migrate/20100607145719_create_users.rb +0 -32
- data/db/migrate/20100607150611_create_pictures.rb +0 -16
- data/db/migrate/20100607150812_create_attachments.rb +0 -16
- data/db/migrate/20100607153647_create_folded_pages.rb +0 -13
- data/db/migrate/20100607161345_create_essence_texts.rb +0 -19
- data/db/migrate/20100607162339_create_elements_pages.rb +0 -12
- data/db/migrate/20100607193638_create_essence_pictures.rb +0 -23
- data/db/migrate/20100607193646_create_essence_richtexts.rb +0 -16
- data/db/migrate/20100607193653_create_essence_htmls.rb +0 -13
- data/db/migrate/20100609111653_create_essence_dates.rb +0 -13
- data/db/migrate/20100609111809_create_essence_files.rb +0 -15
- data/db/migrate/20100609111821_create_essence_flashes.rb +0 -16
- data/db/migrate/20100609111837_create_essence_videos.rb +0 -18
- data/db/migrate/20100616150753_create_essence_audios.rb +0 -17
- data/db/migrate/20100812085225_add_crop_from_and_crop_size_to_essence_pictures.rb +0 -11
- data/db/migrate/20100909140701_change_essence_htmls_source_column_type.rb +0 -9
- data/db/migrate/20101109150312_alter_pages_visible_column_default.rb +0 -9
- data/db/migrate/20101109151812_create_languages.rb +0 -19
- data/db/migrate/20101216151419_add_language_id_to_pages.rb +0 -27
- data/db/migrate/20101216155216_add_index_to_languages.rb +0 -9
- data/db/migrate/20101216173323_add_default_to_languages.rb +0 -9
- data/db/migrate/20101218130049_add_urlname_index_to_pages.rb +0 -9
- data/db/migrate/20110115123343_remove_css_class_default_from_essence_pictures.rb +0 -11
- data/db/migrate/20110224105120_change_pages_visible_default.rb +0 -11
- data/db/migrate/20110228182659_remove_default_page_layout_from_pages.rb +0 -11
- data/db/migrate/20110414163140_remove_display_name_from_elements.rb +0 -11
- data/db/migrate/20110511100516_rename_essence_texts_title_to_link_title.rb +0 -9
- data/db/migrate/20110529130429_create_cells.rb +0 -14
- data/db/migrate/20110529130500_add_cell_id_to_elements.rb +0 -11
- data/db/migrate/20110530102804_change_pages_page_layout_column.rb +0 -11
- data/db/migrate/20110707190728_add_render_size_to_essence_pictures.rb +0 -9
- data/db/migrate/20110711142057_change_open_link_in_new_window_to_link_target.rb +0 -19
- data/db/migrate/20110919110451_add_default_role_to_users.rb +0 -9
- data/db/migrate/20111116125112_namespace_alchemy_models.rb +0 -23
- data/db/migrate/20120216135355_add_country_code_to_languages.rb +0 -9
- data/db/migrate/20120608085509_create_alchemy_essence_selects.rb +0 -11
- data/db/migrate/20120611221734_create_alchemy_essence_booleans.rb +0 -11
- data/db/migrate/20120704181529_add_upload_hash_to_alchemy_picture.rb +0 -5
- data/db/migrate/20120705214247_acts_as_taggable_on_migration.rb +0 -28
- data/db/migrate/20120728185830_add_cached_tag_list_to_alchemy_pictures.rb +0 -5
- data/db/migrate/20120831135441_set_alchemy_languages_country_code_default_to_empty_string.rb +0 -9
- data/spec/helpers/pictures_helper_spec.rb +0 -14
- data/vendor/assets/javascripts/jquery_plugins/jquery.selectBoxIt.js +0 -1909
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- ree
|
4
3
|
- 1.9.2
|
5
4
|
- 1.9.3
|
6
5
|
branches:
|
7
6
|
only:
|
8
|
-
-
|
7
|
+
- master
|
9
8
|
before_script:
|
10
9
|
- "phantomjs -v"
|
11
10
|
- "sh -c 'cd spec/dummy && RAILS_ENV=test bundle exec rake db:create db:schema:load --trace'"
|
@@ -13,6 +12,3 @@ script: "bundle exec rspec spec"
|
|
13
12
|
env:
|
14
13
|
- DB=mysql
|
15
14
|
- DB=postgresql
|
16
|
-
matrix:
|
17
|
-
allow_failures:
|
18
|
-
- rvm: ree
|
data/Gemfile
CHANGED
@@ -10,7 +10,7 @@ group :test do
|
|
10
10
|
gem 'sqlite3' if ENV['DB'].nil? || ENV['DB'] == 'sqlite'
|
11
11
|
gem 'mysql2' if ENV['DB'] == 'mysql'
|
12
12
|
gem 'pg' if ENV['DB'] == 'postgresql'
|
13
|
-
gem 'poltergeist'
|
13
|
+
gem 'poltergeist', '0.7.0'
|
14
14
|
unless ENV['CI']
|
15
15
|
gem 'launchy'
|
16
16
|
end
|
@@ -24,9 +24,9 @@ end
|
|
24
24
|
|
25
25
|
group :development do
|
26
26
|
unless ENV['CI']
|
27
|
-
#gem 'localeapp'
|
28
27
|
gem 'guard-spork'
|
29
|
-
gem 'debugger'
|
30
|
-
gem '
|
28
|
+
gem 'debugger'
|
29
|
+
gem 'quiet_assets' # Mute assets loggin
|
30
|
+
gem 'thin' # Get rid off 'Could not determine content-length of response body' Warning. Start with 'rails s thin'
|
31
31
|
end
|
32
32
|
end
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
Alchemy CMS
|
2
2
|
===========
|
3
3
|
|
4
|
-
[![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=
|
4
|
+
[![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=master)](http://travis-ci.org/magiclabs/alchemy_cms)
|
5
5
|
[![Maintenance Status](http://stillmaintained.com/magiclabs/alchemy_cms.png)](http://stillmaintained.com/magiclabs/alchemy_cms)
|
6
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)
|
8
7
|
|
9
8
|
About
|
10
9
|
-----
|
11
10
|
|
11
|
+
**This branch is a beta development branch. For productive environments use the current rubygems version, or the [latest stable branch (2.3-stable)](https://github.com/magiclabs/alchemy_cms/tree/2.3-stable).**
|
12
|
+
|
12
13
|
Alchemy is a Rails 3 CMS with a flexible content storing architecture.
|
13
14
|
|
14
15
|
Read more on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
|
@@ -37,24 +38,25 @@ Rails Version
|
|
37
38
|
|
38
39
|
This version of Alchemy runs with Rails 3.2.8+.
|
39
40
|
|
40
|
-
If you are looking for a Rails 3.1 compatible version check the 2.1-stable branch.
|
41
|
+
If you are looking for a Rails 3.1 compatible version check the [2.1-stable branch](https://github.com/magiclabs/alchemy_cms/tree/2.1-stable).
|
41
42
|
|
42
|
-
If you are looking for a Rails 3.0 compatible version check the 2.0-stable branch.
|
43
|
+
If you are looking for a Rails 3.0 compatible version check the [2.0-stable branch](https://github.com/magiclabs/alchemy_cms/tree/2.0-stable).
|
43
44
|
|
44
|
-
If you are looking for a Rails 2.3 compatible version check the 1.6-stable branch.
|
45
|
+
If you are looking for a Rails 2.3 compatible version check the [1.6-stable branch](https://github.com/magiclabs/alchemy_cms/tree/1.6-stable).
|
45
46
|
|
46
47
|
Ruby Version
|
47
48
|
------------
|
48
49
|
|
49
|
-
Alchemy runs
|
50
|
-
|
50
|
+
Alchemy runs with Ruby 1.9.2 and Ruby 1.9.3.
|
51
|
+
|
52
|
+
For a Ruby 1.8.7 compatible version use the [2.3-stable branch](https://github.com/magiclabs/alchemy_cms/tree/2.3-stable).
|
51
53
|
|
52
54
|
Installation
|
53
55
|
------------
|
54
56
|
|
55
57
|
Use the installer (recommended):
|
56
58
|
|
57
|
-
gem install alchemy_cms
|
59
|
+
gem install alchemy_cms --pre
|
58
60
|
alchemy new my_magicpage
|
59
61
|
|
60
62
|
Start the local server:
|
@@ -66,9 +68,9 @@ Then just switch to your browser and open `http://localhost:3000`
|
|
66
68
|
Upgrading
|
67
69
|
------------
|
68
70
|
|
69
|
-
|
71
|
+
After updating Alchemy you should run the upgrader.
|
70
72
|
|
71
|
-
|
73
|
+
Run in terminal:
|
72
74
|
|
73
75
|
rake alchemy:upgrade
|
74
76
|
|
@@ -78,14 +80,18 @@ Add to existing Rails project
|
|
78
80
|
|
79
81
|
In your Gemfile:
|
80
82
|
|
81
|
-
gem 'alchemy_cms', :github => 'magiclabs/alchemy_cms'
|
83
|
+
gem 'alchemy_cms', :github => 'magiclabs/alchemy_cms'
|
82
84
|
|
83
85
|
Run in terminal:
|
84
86
|
|
85
|
-
bundle
|
86
|
-
rake alchemy:install
|
87
|
-
|
88
|
-
|
87
|
+
bundle update
|
88
|
+
rake alchemy:install
|
89
|
+
|
90
|
+
Note: If you did not mounted Alchemy on the root route `'/'`, then you have to add Alchemy's view helpers manually to your app.
|
91
|
+
|
92
|
+
Just paste this in your `app/controllers/application_controller.rb`
|
93
|
+
|
94
|
+
`helper Alchemy::PagesHelper`
|
89
95
|
|
90
96
|
Tipps
|
91
97
|
-----
|
@@ -112,6 +118,7 @@ Resources
|
|
112
118
|
* Issue-Tracker: <http://issues.alchemy-cms.com>
|
113
119
|
* Sourcecode: <http://source.alchemy-cms.com>
|
114
120
|
* User Group: <http://groups.google.com/group/alchemy-cms>
|
121
|
+
* Changelog: <http://revision.io/alchemy_cms>
|
115
122
|
|
116
123
|
Authors
|
117
124
|
---------
|
data/alchemy_cms.gemspec
CHANGED
@@ -3,46 +3,46 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
require "alchemy/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name
|
7
|
-
s.version
|
8
|
-
s.platform
|
9
|
-
s.authors
|
10
|
-
s.email
|
11
|
-
s.homepage
|
12
|
-
s.summary
|
13
|
-
s.description
|
14
|
-
s.requirements
|
15
|
-
s.required_ruby_version = '
|
16
|
-
s.license
|
6
|
+
s.name = "alchemy_cms"
|
7
|
+
s.version = Alchemy::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Thomas von Deyen", "Robin Boening", "Marc Schettke", "Carsten Fregin"]
|
10
|
+
s.email = ["alchemy@magiclabs.de"]
|
11
|
+
s.homepage = "http://alchemy-cms.com"
|
12
|
+
s.summary = %q{An extremly flexbile CMS for Rails 3.2}
|
13
|
+
s.description = %q{Alchemy is a Rails 3 CMS with a flexible content storing architecture.}
|
14
|
+
s.requirements << 'ImageMagick (libmagick), v6.6 or greater.'
|
15
|
+
s.required_ruby_version = '~> 1.9.2'
|
16
|
+
s.license = 'BSD New'
|
17
17
|
|
18
|
-
s.files
|
19
|
-
s.test_files
|
20
|
-
s.executables
|
21
|
-
s.require_paths
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_runtime_dependency
|
24
|
-
s.add_runtime_dependency
|
25
|
-
s.add_runtime_dependency
|
26
|
-
s.add_runtime_dependency
|
27
|
-
s.add_runtime_dependency
|
28
|
-
s.add_runtime_dependency
|
29
|
-
s.add_runtime_dependency
|
30
|
-
s.add_runtime_dependency
|
31
|
-
s.add_runtime_dependency
|
32
|
-
s.add_runtime_dependency
|
33
|
-
s.add_runtime_dependency
|
34
|
-
s.add_runtime_dependency
|
35
|
-
s.add_runtime_dependency
|
36
|
-
s.add_runtime_dependency
|
37
|
-
s.add_runtime_dependency
|
38
|
-
s.add_runtime_dependency
|
39
|
-
s.add_runtime_dependency
|
23
|
+
s.add_runtime_dependency %q<rails>, ["~> 3.2.8"]
|
24
|
+
s.add_runtime_dependency %q<authlogic>, ["~> 3.1.3"]
|
25
|
+
s.add_runtime_dependency %q<awesome_nested_set>, ["~> 2.0"]
|
26
|
+
s.add_runtime_dependency %q<acts-as-taggable-on>, ["~> 2.1"]
|
27
|
+
s.add_runtime_dependency %q<declarative_authorization>, ["= 0.5.5"]
|
28
|
+
s.add_runtime_dependency %q<tvdeyen-fleximage>, ["~> 1.2.0"]
|
29
|
+
s.add_runtime_dependency %q<kaminari>, ["~> 0.13.0"]
|
30
|
+
s.add_runtime_dependency %q<acts_as_ferret>, ["~> 0.5"]
|
31
|
+
s.add_runtime_dependency %q<acts_as_list>, ["~> 0.1"]
|
32
|
+
s.add_runtime_dependency %q<magiclabs-userstamp>, ["~> 2.0.2"]
|
33
|
+
s.add_runtime_dependency %q<dynamic_form>, ["~> 1.1"]
|
34
|
+
s.add_runtime_dependency %q<jquery-rails>, ["~> 2.1.3"]
|
35
|
+
s.add_runtime_dependency %q<attachment_magic>, ["~> 0.2.1"]
|
36
|
+
s.add_runtime_dependency %q<sass-rails>, ['~> 3.2.3']
|
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']
|
40
40
|
|
41
|
-
s.add_development_dependency
|
42
|
-
s.add_development_dependency
|
43
|
-
s.add_development_dependency
|
44
|
-
s.add_development_dependency
|
45
|
-
s.add_development_dependency
|
46
|
-
s.add_development_dependency
|
41
|
+
s.add_development_dependency %q<bumpy>
|
42
|
+
s.add_development_dependency %q<capybara>
|
43
|
+
s.add_development_dependency %q<factory_girl_rails>
|
44
|
+
s.add_development_dependency %q<rspec-rails>
|
45
|
+
s.add_development_dependency %q<sqlite3>
|
46
|
+
s.add_development_dependency %q<yard>
|
47
47
|
|
48
48
|
end
|
@@ -111,7 +111,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
111
111
|
setElementSaved: function(selector) {
|
112
112
|
var $element = $(selector);
|
113
113
|
Alchemy.setElementClean(selector);
|
114
|
-
Alchemy.
|
114
|
+
Alchemy.Buttons.enable($element);
|
115
115
|
},
|
116
116
|
|
117
117
|
resizeFrame: function() {
|
@@ -166,7 +166,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
166
166
|
},
|
167
167
|
|
168
168
|
SelectBox: function(scope) {
|
169
|
-
$('select', scope).selectBoxIt();
|
169
|
+
$('select.alchemy_selectbox', scope).selectBoxIt();
|
170
170
|
},
|
171
171
|
|
172
172
|
Buttons: function(options) {
|
@@ -0,0 +1,31 @@
|
|
1
|
+
window.Alchemy = {} if window.Alchemy == undefined
|
2
|
+
|
3
|
+
Alchemy.Buttons =
|
4
|
+
|
5
|
+
observe: (scope) ->
|
6
|
+
$('form', scope).not('.button_with_label form').on 'submit', (event) ->
|
7
|
+
$btn = $(this).find(':submit')
|
8
|
+
if $btn.attr('disabled') == 'disabled'
|
9
|
+
event.preventDefault()
|
10
|
+
event.stopPropagation()
|
11
|
+
false
|
12
|
+
else
|
13
|
+
Alchemy.Buttons.disable($btn)
|
14
|
+
|
15
|
+
disable: (button) ->
|
16
|
+
$button = $(button)
|
17
|
+
spinner = '<img src="/assets/alchemy/ajax_loader.gif" style="width: 16px; height: 16px">'
|
18
|
+
$button.data('label', $button.text())
|
19
|
+
$button.attr('disabled', true)
|
20
|
+
$button.addClass('disabled')
|
21
|
+
$button.css
|
22
|
+
width: $button.outerWidth()
|
23
|
+
$button.html(spinner)
|
24
|
+
return true
|
25
|
+
|
26
|
+
enable: (scope) ->
|
27
|
+
$button = $('form :submit:disabled', scope)
|
28
|
+
$button.removeClass('disabled')
|
29
|
+
$button.removeAttr('disabled')
|
30
|
+
$button.text($button.data('label'))
|
31
|
+
return true
|
@@ -100,7 +100,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
100
100
|
$(this).draggable({
|
101
101
|
helper: 'clone',
|
102
102
|
iframeFix: 'iframe#alchemyPreviewWindow',
|
103
|
-
connectToSortable: cell_classes,
|
103
|
+
connectToSortable: cell_classes.replace(/,.$/, ''),
|
104
104
|
start: function(event, ui) {
|
105
105
|
$(this).hide().addClass('dragged');
|
106
106
|
ui.helper.css({
|
@@ -10,16 +10,20 @@ if (typeof(Alchemy) === 'undefined') {
|
|
10
10
|
Alchemy.ElementsWindow = {
|
11
11
|
|
12
12
|
init: function(path, options, callback) {
|
13
|
+
var self = Alchemy.ElementsWindow;
|
13
14
|
var $dialog = $('<div style="display: none" id="alchemyElementWindow"></div>');
|
14
15
|
var closeCallback = function() {
|
15
16
|
$dialog.dialog("destroy");
|
16
17
|
$('#alchemyElementWindow').remove();
|
17
18
|
Alchemy.ElementsWindow.button.enable();
|
18
19
|
};
|
20
|
+
self.path = path;
|
21
|
+
self.callback = callback;
|
19
22
|
$dialog.html(Alchemy.getOverlaySpinner({
|
20
23
|
x: 420,
|
21
24
|
y: 300
|
22
25
|
}));
|
26
|
+
self.dialog = $dialog;
|
23
27
|
Alchemy.ElementsWindow.currentWindow = $dialog.dialog({
|
24
28
|
modal: false,
|
25
29
|
minWidth: 422,
|
@@ -35,21 +39,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
35
39
|
},
|
36
40
|
open: function(event, ui) {
|
37
41
|
Alchemy.ElementsWindow.button.disable();
|
38
|
-
|
39
|
-
url: path,
|
40
|
-
success: function(data, textStatus, XMLHttpRequest) {
|
41
|
-
$dialog.html(data);
|
42
|
-
Alchemy.ButtonObserver('#alchemyElementWindow .button');
|
43
|
-
Alchemy.overlayObserver('#alchemyElementWindow');
|
44
|
-
Alchemy.Datepicker('#alchemyElementWindow input.date, #alchemyElementWindow input[type="date"]');
|
45
|
-
if (callback) {
|
46
|
-
callback.call();
|
47
|
-
}
|
48
|
-
},
|
49
|
-
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
50
|
-
Alchemy.AjaxErrorHandler($dialog, XMLHttpRequest.status, textStatus, errorThrown);
|
51
|
-
}
|
52
|
-
});
|
42
|
+
Alchemy.ElementsWindow.reload(callback);
|
53
43
|
},
|
54
44
|
beforeClose: function() {
|
55
45
|
if (Alchemy.isPageDirty()) {
|
@@ -104,6 +94,25 @@ if (typeof(Alchemy) === 'undefined') {
|
|
104
94
|
}));
|
105
95
|
}
|
106
96
|
return $toolbar;
|
97
|
+
},
|
98
|
+
|
99
|
+
reload: function() {
|
100
|
+
var self = Alchemy.ElementsWindow;
|
101
|
+
$.ajax({
|
102
|
+
url: self.path,
|
103
|
+
success: function(data, textStatus, XMLHttpRequest) {
|
104
|
+
self.dialog.html(data);
|
105
|
+
Alchemy.Buttons.observe('#alchemyElementWindow');
|
106
|
+
Alchemy.overlayObserver('#alchemyElementWindow');
|
107
|
+
Alchemy.Datepicker('#alchemyElementWindow input.date, #alchemyElementWindow input[type="date"]');
|
108
|
+
if (self.callback) {
|
109
|
+
self.callback.call();
|
110
|
+
}
|
111
|
+
},
|
112
|
+
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
113
|
+
Alchemy.AjaxErrorHandler($dialog, XMLHttpRequest.status, textStatus, errorThrown);
|
114
|
+
}
|
115
|
+
});
|
107
116
|
}
|
108
117
|
|
109
118
|
}
|
@@ -1,11 +1,17 @@
|
|
1
|
-
if
|
2
|
-
window.Alchemy = {}
|
1
|
+
window.Alchemy = {} if window.Alchemy == undefined
|
3
2
|
|
4
3
|
Alchemy.GUI =
|
5
4
|
|
5
|
+
init: ->
|
6
|
+
Alchemy.Tooltips()
|
7
|
+
Alchemy.SelectBox()
|
8
|
+
Alchemy.Datepicker()
|
9
|
+
Alchemy.Buttons.observe()
|
10
|
+
Alchemy.resizeFrame()
|
11
|
+
|
6
12
|
initElement: ($el) ->
|
7
13
|
Alchemy.ElementDirtyObserver($el)
|
8
14
|
Alchemy.SelectBox($el)
|
9
|
-
Alchemy.
|
15
|
+
Alchemy.Buttons.observe($el)
|
10
16
|
Alchemy.Datepicker('input[type="date"]', $el)
|
11
17
|
Alchemy.overlayObserver($el)
|
@@ -30,12 +30,12 @@ Alchemy.loadjQuery = function(callback) {
|
|
30
30
|
head.appendChild(script);
|
31
31
|
}
|
32
32
|
|
33
|
-
getScript('//
|
33
|
+
getScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', function() {
|
34
34
|
if (typeof(jQuery) !== 'undefined') {
|
35
35
|
if (thisPageUsingOtherJSLibrary) {
|
36
36
|
jQuery.noConflict();
|
37
37
|
}
|
38
|
-
callback(
|
38
|
+
callback();
|
39
39
|
}
|
40
40
|
});
|
41
41
|
|
@@ -18,6 +18,7 @@
|
|
18
18
|
//= require alchemy/alchemy.image_cropper
|
19
19
|
//= require alchemy/alchemy.js_extensions
|
20
20
|
//= require alchemy/alchemy.link_overlay
|
21
|
+
//= require alchemy/alchemy.onload
|
21
22
|
//= require alchemy/alchemy.page_sorter
|
22
23
|
//= require alchemy/alchemy.uploader
|
23
24
|
//= require alchemy/alchemy.file_progress
|
@@ -6,20 +6,12 @@ Alchemy.loadAlchemyMenuBar = function(options) {
|
|
6
6
|
|
7
7
|
Alchemy.Menubar = {
|
8
8
|
|
9
|
-
init: function ($) {
|
10
|
-
var self = Alchemy.Menubar;
|
11
|
-
self._$ = $;
|
12
|
-
self.show();
|
13
|
-
},
|
14
|
-
|
15
9
|
show: function() {
|
16
|
-
|
17
|
-
self._$('body').prepend(Alchemy.Menubar.build());
|
10
|
+
$('body').prepend(Alchemy.Menubar.build());
|
18
11
|
},
|
19
12
|
|
20
13
|
build: function() {
|
21
|
-
var
|
22
|
-
var bar = self._$('<div id="alchemy_menubar"/>').append('<ul/>');
|
14
|
+
var bar = $('<div id="alchemy_menubar"/>').append('<ul/>');
|
23
15
|
bar.find('ul').append('<li><a href="' + options.route + '/admin">' + Alchemy.Menubar.t("to_alchemy") + '</a></li>').append('<li><a href="' + options.route + '/admin/pages/' + options.page_id + '/edit">' + Alchemy.Menubar.t("edit_page") + '</a></li>').append('<li><a href="' + options.route + '/admin/logout">' + Alchemy.Menubar.t("logout") + '</a></li>');
|
24
16
|
return bar;
|
25
17
|
},
|
@@ -51,9 +43,9 @@ Alchemy.loadAlchemyMenuBar = function(options) {
|
|
51
43
|
};
|
52
44
|
|
53
45
|
if (typeof(jQuery) === 'undefined') {
|
54
|
-
Alchemy.loadjQuery(Alchemy.Menubar.
|
46
|
+
Alchemy.loadjQuery(Alchemy.Menubar.show);
|
55
47
|
} else {
|
56
|
-
Alchemy.Menubar.
|
48
|
+
Alchemy.Menubar.show();
|
57
49
|
}
|
58
50
|
|
59
51
|
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
$ ->
|
2
|
+
# Preloading all background images from CSS files.
|
3
|
+
$.preloadCssImages()
|
4
|
+
|
5
|
+
# We obviously have javascript enabled.
|
6
|
+
$('html').removeClass('no-js')
|
7
|
+
|
8
|
+
# Initialize the GUI.
|
9
|
+
Alchemy.GUI.init()
|
10
|
+
|
11
|
+
# Fade all growl notifications.
|
12
|
+
if $('#flash_notices').length > 0
|
13
|
+
Alchemy.Growler.fade()
|
14
|
+
|
15
|
+
# Add observer for please wait overlay.
|
16
|
+
$('a.please_wait, #main_navi a.main_navi_entry, div.button_with_label form :submit, #sub_navigation .subnavi_tab a, .pagination a')
|
17
|
+
.not('*[data-alchemy-confirm], #subnav_additions .subnavi_tab button')
|
18
|
+
.click ->
|
19
|
+
Alchemy.pleaseWaitOverlay()
|
20
|
+
|
21
|
+
# Hack for enabling tab focus for <a>'s styled as button.
|
22
|
+
$('a.button').attr({tabindex: 0})
|
23
|
+
|
24
|
+
# Locale select handler
|
25
|
+
$('select#change_locale').on 'change', (e) ->
|
26
|
+
url = Alchemy.current_url
|
27
|
+
delimiter = url.match(/\?/) ? '&' : '?'
|
28
|
+
window.location = url + delimiter + 'locale=' + $(this).val()
|
29
|
+
|
30
|
+
# Resize the Alchemy frame on every browser resize.
|
31
|
+
jQuery(window).resize ->
|
32
|
+
Alchemy.resizeFrame()
|