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.
- data/.gitignore +1 -1
- data/.travis.yml +5 -13
- data/Gemfile +6 -3
- data/README.md +3 -2
- data/alchemy_cms.gemspec +22 -22
- data/app/assets/fonts/alchemy-icons.eot +0 -0
- data/app/assets/fonts/alchemy-icons.svg +54 -0
- data/app/assets/fonts/alchemy-icons.ttf +0 -0
- data/app/assets/fonts/alchemy-icons.woff +0 -0
- data/app/assets/images/alchemy/icons.png +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +151 -0
- data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -2
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +31 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +1 -1
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +98 -0
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +23 -24
- data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +27 -0
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +11 -8
- data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +32 -0
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +46 -0
- data/app/assets/javascripts/alchemy/alchemy.js +8 -2
- data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +5 -4
- data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +49 -0
- data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +3 -0
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +71 -0
- data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +61 -0
- data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +35 -0
- data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +11 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +278 -0
- data/app/assets/stylesheets/alchemy/admin.css.scss +2 -0
- data/app/assets/stylesheets/alchemy/archive.scss +109 -65
- data/app/assets/stylesheets/alchemy/base.scss +16 -188
- data/app/assets/stylesheets/alchemy/dashboard.scss +2 -2
- data/app/assets/stylesheets/alchemy/defaults.scss +2 -1
- data/app/assets/stylesheets/alchemy/elements.scss +58 -94
- data/app/assets/stylesheets/alchemy/errors.scss +2 -2
- data/app/assets/stylesheets/alchemy/{mixins.scss → extends.scss} +104 -80
- data/app/assets/stylesheets/alchemy/flash.scss +4 -6
- data/app/assets/stylesheets/alchemy/fonts.scss +46 -0
- data/app/assets/stylesheets/alchemy/form_elements.scss +46 -45
- data/app/assets/stylesheets/alchemy/frame.scss +20 -15
- data/app/assets/stylesheets/alchemy/icons.scss +22 -9
- data/app/assets/stylesheets/alchemy/jquery-ui.scss +476 -399
- data/app/assets/stylesheets/alchemy/login.scss +1 -1
- data/app/assets/stylesheets/alchemy/menubar.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/notices.scss +5 -5
- data/app/assets/stylesheets/alchemy/pagination.scss +25 -13
- data/app/assets/stylesheets/alchemy/search.scss +29 -17
- data/app/assets/stylesheets/alchemy/sitemap.scss +41 -36
- data/app/assets/stylesheets/alchemy/tables.scss +102 -50
- data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +18 -16
- data/app/assets/stylesheets/alchemy/toolbar.scss +84 -24
- data/app/assets/stylesheets/alchemy/upload.scss +14 -9
- data/app/assets/stylesheets/alchemy/variables.scss +1 -0
- data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +18 -21
- data/app/controllers/alchemy/admin/attachments_controller.rb +29 -39
- data/app/controllers/alchemy/admin/base_controller.rb +3 -9
- data/app/controllers/alchemy/admin/clipboard_controller.rb +1 -1
- data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
- data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +3 -3
- data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +5 -5
- data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +18 -16
- data/app/controllers/alchemy/admin/pictures_controller.rb +11 -10
- data/app/controllers/alchemy/admin/resources_controller.rb +87 -14
- data/app/controllers/alchemy/admin/tags_controller.rb +3 -3
- data/app/controllers/alchemy/admin/trash_controller.rb +3 -3
- data/app/controllers/alchemy/admin/users_controller.rb +6 -11
- data/app/controllers/alchemy/attachments_controller.rb +8 -9
- data/app/controllers/alchemy/base_controller.rb +17 -10
- data/app/controllers/alchemy/pages_controller.rb +7 -19
- data/app/controllers/alchemy/passwords_controller.rb +15 -3
- data/app/controllers/alchemy/user_sessions_controller.rb +5 -4
- data/app/controllers/alchemy/users_controller.rb +1 -1
- data/app/helpers/alchemy/admin/attachments_helper.rb +2 -2
- data/app/helpers/alchemy/admin/base_helper.rb +62 -90
- data/app/helpers/alchemy/admin/elements_helper.rb +13 -5
- data/app/helpers/alchemy/admin/essences_helper.rb +3 -5
- data/app/helpers/alchemy/admin/pages_helper.rb +6 -3
- data/app/helpers/alchemy/admin/tags_helper.rb +60 -0
- data/app/helpers/alchemy/base_helper.rb +16 -20
- data/app/helpers/alchemy/elements_helper.rb +7 -11
- data/app/helpers/alchemy/essences_helper.rb +2 -2
- data/app/helpers/alchemy/pages_helper.rb +31 -69
- data/app/helpers/alchemy/url_helper.rb +11 -3
- data/app/models/alchemy/attachment.rb +73 -45
- data/app/models/alchemy/cell.rb +1 -1
- data/app/models/alchemy/content.rb +20 -9
- data/app/models/alchemy/element.rb +9 -7
- data/app/models/alchemy/page.rb +15 -248
- data/app/models/alchemy/page/cells.rb +71 -0
- data/app/models/alchemy/page/elements.rb +147 -0
- data/app/models/alchemy/page/naming.rb +90 -0
- data/app/models/alchemy/picture.rb +18 -13
- data/app/models/alchemy/tag.rb +1 -1
- data/app/models/alchemy/user.rb +38 -6
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +14 -7
- data/app/views/alchemy/admin/attachments/_attachment.html.erb +17 -12
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +3 -8
- data/app/views/alchemy/admin/attachments/_files_list.html.erb +20 -12
- data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +11 -0
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +31 -0
- data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +4 -0
- data/app/views/alchemy/admin/attachments/edit.html.erb +8 -7
- data/app/views/alchemy/admin/attachments/index.html.erb +19 -12
- data/app/views/alchemy/admin/attachments/new.html.erb +2 -2
- data/app/views/alchemy/admin/attachments/show.html.erb +3 -0
- data/app/views/alchemy/admin/contents/_missing.html.erb +4 -4
- data/app/views/alchemy/admin/contents/create.js.erb +1 -1
- data/app/views/alchemy/admin/contents/new.html.erb +6 -3
- data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/_users.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/index.html.erb +3 -3
- data/app/views/alchemy/admin/dashboard/info.html.erb +16 -13
- data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_element_foot.html.erb +4 -4
- data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -7
- data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -2
- data/app/views/alchemy/admin/elements/_new_element_form.html.erb +4 -4
- data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +1 -1
- data/app/views/alchemy/admin/elements/create.js.erb +2 -2
- data/app/views/alchemy/admin/elements/fold.js.erb +3 -6
- data/app/views/alchemy/admin/elements/new.html.erb +1 -1
- data/app/views/alchemy/admin/elements/order.js.erb +1 -1
- data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
- data/app/views/alchemy/admin/elements/update.js.erb +2 -2
- data/app/views/alchemy/admin/essence_files/edit.html.erb +4 -4
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +17 -18
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
- data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -0
- data/app/views/alchemy/admin/languages/_form.html.erb +12 -10
- data/app/views/alchemy/admin/languages/_language.html.erb +2 -1
- data/app/views/alchemy/admin/languages/_table.html.erb +3 -3
- data/app/views/alchemy/admin/languages/index.html.erb +15 -15
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +6 -6
- data/app/views/alchemy/admin/layoutpages/index.html.erb +41 -40
- data/app/views/alchemy/admin/pages/_contactform_links.html.erb +4 -4
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +6 -6
- data/app/views/alchemy/admin/pages/_external_link.html.erb +2 -2
- data/app/views/alchemy/admin/pages/_file_link.html.erb +3 -3
- data/app/views/alchemy/admin/pages/_internal_link.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 +13 -13
- data/app/views/alchemy/admin/pages/_page_for_links.html.erb +2 -4
- data/app/views/alchemy/admin/pages/_sitemap.html.erb +5 -0
- data/app/views/alchemy/admin/pages/configure.html.erb +7 -7
- data/app/views/alchemy/admin/pages/configure_external.html.erb +4 -4
- data/app/views/alchemy/admin/pages/edit.html.erb +23 -30
- data/app/views/alchemy/admin/pages/index.html.erb +34 -23
- data/app/views/alchemy/admin/pages/new.html.erb +1 -1
- data/app/views/alchemy/admin/pages/sort.js.erb +1 -1
- data/app/views/alchemy/admin/partials/_flash_upload.html.erb +2 -3
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
- data/app/views/alchemy/admin/partials/_search_form.html.erb +3 -3
- data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_archive.html.erb +7 -7
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +6 -6
- data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +4 -4
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -8
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +9 -14
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -25
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
- data/app/views/alchemy/admin/pictures/index.html.erb +49 -42
- data/app/views/alchemy/admin/pictures/new.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/show.html.erb +11 -0
- data/app/views/alchemy/admin/resources/_boolean.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_datetime.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_form.html.erb +9 -8
- data/app/views/alchemy/admin/resources/_resource.html.erb +15 -21
- data/app/views/alchemy/admin/resources/_string.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_table.html.erb +11 -13
- data/app/views/alchemy/admin/resources/_text.html.erb +2 -2
- data/app/views/alchemy/admin/resources/index.csv.erb +13 -0
- data/app/views/alchemy/admin/resources/index.html.erb +24 -15
- data/app/views/alchemy/admin/sites/index.html.erb +23 -0
- data/app/views/alchemy/admin/tags/_radio_tag.html.erb +1 -1
- data/app/views/alchemy/admin/tags/_tag.html.erb +2 -1
- data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
- data/app/views/alchemy/admin/tags/index.html.erb +16 -11
- data/app/views/alchemy/admin/tags/new.html.erb +3 -3
- data/app/views/alchemy/admin/trash/clear.js.coffee +1 -1
- data/app/views/alchemy/admin/users/_table.html.erb +12 -5
- data/app/views/alchemy/admin/users/_user.html.erb +16 -16
- data/app/views/alchemy/admin/users/index.html.erb +28 -16
- data/app/views/alchemy/breadcrumb/_page.html.erb +15 -0
- data/app/views/alchemy/breadcrumb/_spacer.html.erb +1 -0
- data/app/views/alchemy/elements/_editor_not_found.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +16 -16
- data/app/views/alchemy/essences/_essence_file_view.html.erb +8 -9
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +3 -6
- data/app/views/alchemy/essences/_essence_picture_tools.html.erb +9 -8
- data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +0 -5
- data/app/views/alchemy/essences/_linkable_essence_tools.html.erb +2 -2
- data/app/views/alchemy/navigation/_link.html.erb +7 -7
- data/app/views/alchemy/navigation/_renderer.html.erb +29 -36
- data/app/views/alchemy/notifications/admin_user_created.de.text.erb +5 -1
- data/app/views/alchemy/notifications/admin_user_created.en.text.erb +5 -1
- data/app/views/alchemy/notifications/registered_user_created.de.text.erb +13 -0
- data/app/views/alchemy/notifications/registered_user_created.en.text.erb +13 -0
- data/app/views/alchemy/search/_result.html.erb +4 -6
- data/app/views/alchemy/search/_results.html.erb +4 -5
- data/app/views/alchemy/user_sessions/leave.html.erb +1 -1
- data/app/views/alchemy/user_sessions/new.html.erb +2 -2
- data/app/views/kaminari/_first_page.html.erb +11 -0
- data/app/views/kaminari/_gap.html.erb +1 -1
- data/app/views/kaminari/_last_page.html.erb +11 -0
- data/app/views/kaminari/_next_page.html.erb +2 -2
- data/app/views/kaminari/_page.html.erb +1 -1
- data/app/views/kaminari/_paginator.html.erb +2 -0
- data/app/views/kaminari/_prev_page.html.erb +2 -2
- data/app/views/layouts/alchemy/admin.html.erb +4 -5
- data/config/alchemy/config.yml +8 -12
- data/config/authorization_rules.rb +4 -3
- data/config/initializers/dragonfly.rb +20 -12
- data/config/locales/alchemy.de.yml +20 -15
- data/config/locales/alchemy.en.yml +15 -10
- data/config/locales/devise.de.yml +1 -0
- data/config/routes.rb +3 -3
- data/{spec/dummy/db/migrate/20121118000000_alchemy_two_point_four.rb → db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
- data/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
- data/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
- data/lib/alchemy/capistrano.rb +10 -8
- data/lib/alchemy/errors.rb +7 -0
- data/lib/alchemy/filetypes.rb +33 -0
- data/lib/alchemy/i18n.rb +9 -1
- data/lib/alchemy/name_conversions.rb +28 -0
- data/lib/alchemy/page_layout.rb +5 -3
- data/lib/alchemy/resource.rb +132 -29
- data/lib/alchemy/resources_helper.rb +81 -12
- data/lib/alchemy/upgrader.rb +14 -276
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +17 -2
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -1
- data/lib/tasks/alchemy/convert.rake +39 -0
- data/lib/tasks/alchemy/install.rake +4 -6
- data/lib/tasks/alchemy/upgrade.rake +18 -1
- data/spec/controllers/admin/clipboard_controller_spec.rb +4 -4
- data/spec/controllers/admin/elements_controller_spec.rb +23 -23
- data/spec/controllers/admin/pages_controller_spec.rb +15 -0
- data/spec/controllers/admin/resources_controller_spec.rb +1 -11
- data/spec/controllers/admin/trash_controller_spec.rb +9 -9
- data/spec/controllers/attachments_controller_spec.rb +3 -3
- data/spec/controllers/elements_controller_spec.rb +2 -2
- data/spec/controllers/pages_controller_spec.rb +160 -129
- data/spec/controllers/pictures_controller_spec.rb +2 -2
- data/spec/controllers/user_sessions_controller_spec.rb +3 -3
- data/spec/controllers/users_controller_spec.rb +2 -2
- data/spec/dummy/app/models/event.rb +2 -2
- data/spec/dummy/app/models/location.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +6 -42
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -1
- data/{db/migrate/20121118000000_alchemy_two_point_four.rb → spec/dummy/db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
- data/spec/dummy/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
- data/spec/dummy/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
- data/spec/dummy/db/migrate/20130328101418_create_locations.rb +9 -0
- data/spec/dummy/db/schema.rb +15 -6
- data/spec/factories.rb +4 -4
- data/spec/{integration → features}/admin/link_overlay_spec.rb +0 -0
- data/spec/{integration → features}/admin/modules_integration_spec.rb +1 -1
- data/spec/{integration → features}/admin/pages_controller_spec.rb +9 -4
- data/spec/{integration → features}/admin/picture_library_integration_spec.rb +5 -5
- data/spec/{integration → features}/admin/resources_integration_spec.rb +1 -1
- data/spec/{integration → features}/navigation_spec.rb +0 -0
- data/spec/{integration → features}/pages_controller_spec.rb +42 -112
- data/spec/{integration → features}/picture_security_spec.rb +2 -2
- data/spec/{integration → features}/security_spec.rb +7 -7
- data/spec/{integration → features}/translation_integration_spec.rb +0 -0
- data/spec/helpers/admin/base_helper_spec.rb +0 -50
- data/spec/helpers/admin/tags_helper_spec.rb +53 -0
- data/spec/helpers/base_helper_spec.rb +19 -3
- data/spec/helpers/pages_helper_spec.rb +92 -44
- data/spec/{url_helpers_spec.rb → helpers/picture_url_helpers_spec.rb} +7 -7
- data/spec/helpers/url_helper_spec.rb +92 -72
- data/spec/{config_spec.rb → libraries/config_spec.rb} +0 -0
- data/spec/libraries/resource_spec.rb +215 -76
- data/spec/libraries/resources_helper_spec.rb +70 -28
- data/spec/models/attachment_spec.rb +75 -9
- data/spec/models/clipboard_spec.rb +1 -1
- data/spec/models/element_spec.rb +7 -0
- data/spec/models/page_spec.rb +144 -25
- data/spec/models/picture_spec.rb +5 -5
- data/spec/models/resource_spec.rb +47 -10
- data/spec/models/user_spec.rb +115 -3
- data/spec/{routing_spec.rb → routing/routing_spec.rb} +8 -20
- data/spec/spec_helper.rb +5 -6
- data/spec/support/alchemy/specs_helpers.rb +1 -1
- data/spec/support/ci/install_phantomjs +1 -1
- data/spec/support/image with spaces.png +0 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js +18 -18
- data/vendor/assets/javascripts/jquery_plugins/{jquery.dialogextend.1_0_1.js → jquery.dialogextend.js} +25 -17
- data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo.min.js +7 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +7 -7
- data/vendor/assets/javascripts/keymage.min.js +6 -0
- data/vendor/assets/javascripts/spin.min.js +1 -0
- metadata +122 -124
- data/app/assets/images/alchemy/ajax_loader.gif +0 -0
- data/app/assets/images/alchemy/gui/toggle.png +0 -0
- data/app/assets/images/alchemy/image_loader.gif +0 -0
- data/app/assets/images/alchemy/shading.png +0 -0
- data/app/assets/images/alchemy/tabs.gif +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +0 -172
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js +0 -47
- data/app/assets/javascripts/alchemy/alchemy.element_editor_selector.js +0 -91
- data/app/assets/javascripts/alchemy/alchemy.growler.js +0 -46
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +0 -60
- data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +0 -15
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js +0 -97
- data/app/assets/javascripts/alchemy/alchemy.windows.js +0 -321
- data/app/models/alchemy/clipboard_spec.rb +0 -0
- data/app/views/alchemy/admin/pictures/show_in_window.html.erb +0 -8
- data/app/views/alchemy/notifications/registered_user_created.text.erb +0 -11
- data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
- data/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
- data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
- data/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
- data/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
- data/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
- data/spec/alchemy_spec.rb +0 -7
- data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
- data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
- data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
- data/spec/dummy/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
- data/spec/dummy/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
- data/spec/dummy/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
- data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo-1.4.2-min.js +0 -11
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -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
|
-
-
|
7
|
-
|
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
|
15
|
-
- DB=postgresql
|
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
|
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) [![
|
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',
|
71
|
+
gem 'alchemy_cms', github: 'magiclabs/alchemy_cms', branch: 'master'
|
71
72
|
|
72
73
|
Run in terminal:
|
73
74
|
|
data/alchemy_cms.gemspec
CHANGED
@@ -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>,
|
36
|
-
s.add_runtime_dependency %q<devise>,
|
37
|
-
s.add_runtime_dependency %q<devise-encryptable>,
|
38
|
-
s.add_runtime_dependency %q<awesome_nested_set>,
|
39
|
-
s.add_runtime_dependency %q<acts-as-taggable-on>,
|
40
|
-
s.add_runtime_dependency %q<declarative_authorization>,
|
41
|
-
s.add_runtime_dependency %q<dragonfly>,
|
42
|
-
s.add_runtime_dependency %q<kaminari>,
|
43
|
-
s.add_runtime_dependency %q<acts_as_ferret>,
|
44
|
-
s.add_runtime_dependency %q<acts_as_list>,
|
45
|
-
s.add_runtime_dependency %q<magiclabs-userstamp>,
|
46
|
-
s.add_runtime_dependency %q<dynamic_form>,
|
47
|
-
s.add_runtime_dependency %q<jquery-rails>,
|
48
|
-
s.add_runtime_dependency %q<jquery-ui-rails>,
|
49
|
-
s.add_runtime_dependency %q<
|
50
|
-
s.add_runtime_dependency %q<
|
51
|
-
s.add_runtime_dependency %q<
|
52
|
-
s.add_runtime_dependency %q<
|
53
|
-
s.add_runtime_dependency %q<
|
54
|
-
s.add_runtime_dependency %q<
|
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>, ['
|
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.
|
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>
|
Binary file
|
@@ -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="⊞"
|
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="⊟"
|
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="⟲" 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="" horiz-adv-x="490"
|
39
|
+
d="M245 850l230 -364h-460zM245 -150l-230 366h460z" />
|
40
|
+
<glyph glyph-name="uniE800" unicode="" 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="" 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="" 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="" 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="" 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="🔎" 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>
|
Binary file
|
Binary file
|
Binary file
|
@@ -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 =
|
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.
|
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
|
@@ -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
|