alchemy_cms 7.0.8 → 7.1.0.pre.b2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +162 -0
- data/Gemfile +9 -11
- data/README.md +11 -9
- data/alchemy_cms.gemspec +4 -3
- data/app/assets/config/alchemy_manifest.js +3 -5
- data/app/assets/images/alchemy/missing-image.svg +1 -1
- data/app/assets/javascripts/alchemy/admin.js +1 -23
- data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +2 -3
- data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +19 -34
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +38 -13
- data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.fixed_elements.js +32 -25
- data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.image_overlay.coffee +3 -5
- data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +0 -57
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +24 -65
- data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +2 -2
- data/app/assets/javascripts/alchemy/alchemy.preview.js.coffee +5 -4
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +5 -5
- data/app/assets/javascripts/alchemy/templates/index.js +0 -2
- data/app/assets/javascripts/alchemy/templates/node_folder.hbs +1 -1
- data/app/assets/javascripts/alchemy/templates/page.hbs +1 -1
- data/app/assets/javascripts/alchemy/templates/page_folder.hbs +2 -2
- data/app/assets/javascripts/tinymce/icons/remixicons/icons.js +93 -0
- data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +37 -18
- data/app/assets/stylesheets/alchemy/_custom-properties.scss +82 -0
- data/app/assets/stylesheets/alchemy/_mixins.scss +38 -30
- data/app/assets/stylesheets/alchemy/_variables.scss +23 -8
- data/app/assets/stylesheets/alchemy/admin.scss +3 -4
- data/app/assets/stylesheets/alchemy/archive.scss +110 -50
- data/app/assets/stylesheets/alchemy/attachments.scss +5 -4
- data/app/assets/stylesheets/alchemy/buttons.scss +41 -166
- data/app/assets/stylesheets/alchemy/dashboard.scss +31 -6
- data/app/assets/stylesheets/alchemy/dialogs.scss +12 -28
- data/app/assets/stylesheets/alchemy/elements.scss +272 -282
- data/app/assets/stylesheets/alchemy/flash.scss +20 -12
- data/app/assets/stylesheets/alchemy/forms.scss +21 -34
- data/app/assets/stylesheets/alchemy/frame.scss +11 -32
- data/app/assets/stylesheets/alchemy/hints.scss +4 -62
- data/app/assets/stylesheets/alchemy/image_library.scss +36 -33
- data/app/assets/stylesheets/alchemy/menubar.scss +7 -6
- data/app/assets/stylesheets/alchemy/navigation.scss +27 -15
- data/app/assets/stylesheets/alchemy/nodes.scss +11 -7
- data/app/assets/stylesheets/alchemy/notices.scss +16 -4
- data/app/assets/stylesheets/alchemy/page-select.scss +10 -2
- data/app/assets/stylesheets/alchemy/pagination.scss +22 -13
- data/app/assets/stylesheets/alchemy/resource_info.scss +7 -5
- data/app/assets/stylesheets/alchemy/selects.scss +49 -42
- data/app/assets/stylesheets/alchemy/shoelace.scss +345 -0
- data/app/assets/stylesheets/alchemy/sitemap.scss +24 -14
- data/app/assets/stylesheets/alchemy/spinner.scss +9 -19
- data/app/assets/stylesheets/alchemy/tables.scss +16 -24
- data/app/assets/stylesheets/alchemy/tags.scss +4 -0
- data/app/assets/stylesheets/alchemy/toolbar.scss +29 -25
- data/app/assets/stylesheets/alchemy/upload.scss +140 -89
- data/app/assets/stylesheets/tinymce/skins/content/alchemy/content.min.scss +69 -0
- data/app/assets/stylesheets/tinymce/skins/skintool.json +38 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.css +711 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.css +705 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.css +29 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/fonts/tinymce-mobile.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.min.scss +3798 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.css +677 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css +7 -0
- data/app/components/alchemy/admin/node_select.rb +39 -0
- data/app/components/alchemy/admin/page_select.rb +42 -0
- data/app/controllers/alchemy/admin/base_controller.rb +5 -6
- data/app/controllers/alchemy/admin/elements_controller.rb +63 -35
- data/app/controllers/alchemy/admin/pages_controller.rb +9 -4
- data/app/controllers/alchemy/base_controller.rb +4 -2
- data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +1 -1
- data/app/controllers/concerns/alchemy/site_redirects.rb +1 -1
- data/app/decorators/alchemy/element_editor.rb +0 -2
- data/app/helpers/alchemy/admin/attachments_helper.rb +6 -5
- data/app/helpers/alchemy/admin/base_helper.rb +17 -12
- data/app/helpers/alchemy/admin/ingredients_helper.rb +4 -1
- data/app/helpers/alchemy/admin/pages_helper.rb +5 -11
- data/app/helpers/alchemy/base_helper.rb +47 -13
- data/app/javascript/alchemy_admin/clipboard.js +16 -0
- data/app/javascript/alchemy_admin/components/alchemy_html_element.js +129 -0
- data/app/javascript/alchemy_admin/components/button.js +59 -0
- data/app/javascript/alchemy_admin/components/char_counter.js +40 -0
- data/app/javascript/alchemy_admin/components/datepicker.js +39 -0
- data/app/javascript/alchemy_admin/components/dialog_link.js +45 -0
- data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +36 -0
- data/app/javascript/alchemy_admin/components/element_editor.js +553 -0
- data/app/javascript/alchemy_admin/components/ingredient_group.js +54 -0
- data/app/javascript/alchemy_admin/components/link_buttons/link_button.js +48 -0
- data/app/javascript/alchemy_admin/components/link_buttons/unlink_button.js +38 -0
- data/app/javascript/alchemy_admin/components/link_buttons.js +79 -0
- data/app/javascript/alchemy_admin/components/node_select.js +45 -0
- data/app/javascript/alchemy_admin/components/overlay.js +18 -0
- data/app/javascript/alchemy_admin/components/page_select.js +63 -0
- data/app/javascript/alchemy_admin/components/remote_select.js +134 -0
- data/app/javascript/alchemy_admin/components/select.js +12 -0
- data/app/javascript/alchemy_admin/components/spinner.js +31 -0
- data/app/javascript/alchemy_admin/components/tinymce.js +134 -0
- data/app/javascript/alchemy_admin/components/uploader/file_upload.js +266 -0
- data/app/javascript/alchemy_admin/components/uploader/progress.js +258 -0
- data/app/javascript/alchemy_admin/components/uploader.js +132 -0
- data/app/javascript/alchemy_admin/dirty.js +49 -0
- data/app/javascript/alchemy_admin/file_editors.js +1 -1
- data/app/javascript/alchemy_admin/gui.js +14 -0
- data/app/javascript/alchemy_admin/i18n.js +12 -8
- data/app/javascript/alchemy_admin/image_cropper.js +6 -3
- data/app/javascript/alchemy_admin/image_loader.js +7 -15
- data/app/javascript/alchemy_admin/ingredient_anchor_link.js +2 -5
- data/app/javascript/alchemy_admin/initializer.js +65 -0
- data/app/javascript/alchemy_admin/locales/en.js +31 -0
- data/app/javascript/alchemy_admin/picture_editors.js +6 -4
- data/app/javascript/alchemy_admin/picture_selector.js +38 -0
- data/app/javascript/alchemy_admin/please_wait_overlay.js +8 -0
- data/app/javascript/alchemy_admin/sortable_elements.js +78 -0
- data/app/javascript/alchemy_admin/spinner.js +36 -0
- data/app/javascript/alchemy_admin/tags_autocomplete.js +46 -0
- data/app/javascript/alchemy_admin/utils/ajax.js +6 -5
- data/app/javascript/alchemy_admin/utils/debounce.js +10 -0
- data/app/javascript/alchemy_admin/utils/dom_helpers.js +20 -0
- data/app/javascript/alchemy_admin/utils/format.js +11 -0
- data/app/javascript/alchemy_admin/utils/max.js +3 -0
- data/app/javascript/alchemy_admin/utils/string_conversions.js +10 -0
- data/app/javascript/alchemy_admin.js +64 -13
- data/app/javascript/menubar.js +10 -0
- data/app/models/alchemy/attachment.rb +9 -11
- data/app/models/alchemy/element.rb +11 -0
- data/app/models/alchemy/ingredients/richtext.rb +1 -10
- data/app/models/alchemy/node.rb +4 -0
- data/app/models/alchemy/page/page_naming.rb +7 -0
- data/app/models/alchemy/page/page_natures.rb +10 -2
- data/app/models/alchemy/page.rb +11 -51
- data/app/models/alchemy/picture/url.rb +1 -9
- data/app/models/alchemy/picture_variant.rb +11 -2
- data/app/models/concerns/alchemy/picture_thumbnails.rb +1 -1
- data/app/serializers/alchemy/page_tree_serializer.rb +2 -1
- data/app/services/alchemy/copy_page.rb +98 -0
- data/app/views/alchemy/_menubar.html.erb +17 -13
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +14 -10
- data/app/views/alchemy/admin/attachments/_attachment.html.erb +44 -36
- data/app/views/alchemy/admin/attachments/_replace_button.html.erb +15 -21
- data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
- data/app/views/alchemy/admin/attachments/assign.js.erb +1 -1
- data/app/views/alchemy/admin/attachments/index.html.erb +6 -4
- data/app/views/alchemy/admin/attachments/show.html.erb +10 -23
- data/app/views/alchemy/admin/clipboard/clear.js.erb +1 -1
- data/app/views/alchemy/admin/clipboard/index.html.erb +3 -7
- data/app/views/alchemy/admin/clipboard/insert.js.erb +1 -1
- data/app/views/alchemy/admin/crop.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/index.html.erb +13 -11
- data/app/views/alchemy/admin/dashboard/info.html.erb +7 -7
- data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +21 -23
- data/app/views/alchemy/admin/elements/_element.html.erb +52 -44
- data/app/views/alchemy/admin/elements/_footer.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_form.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_header.html.erb +11 -12
- data/app/views/alchemy/admin/elements/_toolbar.html.erb +33 -45
- data/app/views/alchemy/admin/elements/create.js.erb +7 -15
- data/app/views/alchemy/admin/elements/destroy.js.erb +0 -2
- data/app/views/alchemy/admin/elements/index.html.erb +27 -24
- data/app/views/alchemy/admin/elements/new.html.erb +9 -11
- data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +2 -2
- data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +3 -3
- data/app/views/alchemy/admin/ingredients/_video_fields.html.erb +1 -2
- data/app/views/alchemy/admin/languages/_form.html.erb +2 -3
- data/app/views/alchemy/admin/languages/_language.html.erb +15 -8
- data/app/views/alchemy/admin/languages/_table.html.erb +1 -0
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +28 -16
- data/app/views/alchemy/admin/layoutpages/index.html.erb +2 -2
- data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +12 -8
- data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +1 -1
- data/app/views/alchemy/admin/nodes/_form.html.erb +20 -21
- data/app/views/alchemy/admin/nodes/_node.html.erb +39 -34
- data/app/views/alchemy/admin/nodes/index.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_anchor_link.html.erb +4 -4
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +2 -2
- data/app/views/alchemy/admin/pages/_current_page.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_external_link.html.erb +4 -4
- data/app/views/alchemy/admin/pages/_file_link.html.erb +5 -5
- data/app/views/alchemy/admin/pages/_form.html.erb +10 -21
- data/app/views/alchemy/admin/pages/_internal_link.html.erb +4 -4
- data/app/views/alchemy/admin/pages/_locked_page.html.erb +2 -2
- data/app/views/alchemy/admin/pages/_new_page_form.html.erb +4 -17
- data/app/views/alchemy/admin/pages/_page.html.erb +76 -72
- data/app/views/alchemy/admin/pages/_page_infos.html.erb +23 -7
- data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +2 -1
- data/app/views/alchemy/admin/pages/_page_status.html.erb +11 -21
- data/app/views/alchemy/admin/pages/_publication_fields.html.erb +2 -5
- data/app/views/alchemy/admin/pages/_table.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_table_row.html.erb +43 -39
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +43 -38
- data/app/views/alchemy/admin/pages/configure.html.erb +12 -14
- data/app/views/alchemy/admin/pages/edit.html.erb +80 -103
- data/app/views/alchemy/admin/pages/info.html.erb +20 -11
- data/app/views/alchemy/admin/pages/link.html.erb +22 -16
- data/app/views/alchemy/admin/pages/new.html.erb +9 -11
- data/app/views/alchemy/admin/pages/unlock.js.erb +10 -3
- data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +15 -13
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +3 -5
- data/app/views/alchemy/admin/partials/_routes.html.erb +10 -2
- data/app/views/alchemy/admin/partials/_site_select.html.erb +6 -5
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +28 -23
- data/app/views/alchemy/admin/pictures/_archive.html.erb +5 -5
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +21 -23
- data/app/views/alchemy/admin/pictures/_infos.html.erb +2 -6
- data/app/views/alchemy/admin/pictures/_picture.html.erb +17 -21
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +17 -16
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +1 -1
- data/app/views/alchemy/admin/pictures/assign.js.erb +1 -1
- data/app/views/alchemy/admin/pictures/index.html.erb +34 -30
- data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
- data/app/views/alchemy/admin/resources/_filter.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_form.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_resource.html.erb +16 -9
- data/app/views/alchemy/admin/resources/_table.html.erb +4 -1
- data/app/views/alchemy/admin/resources/index.html.erb +22 -19
- data/app/views/alchemy/admin/sites/index.html.erb +2 -1
- data/app/views/alchemy/admin/styleguide/index.html.erb +54 -28
- data/app/views/alchemy/admin/tags/_tag.html.erb +16 -14
- data/app/views/alchemy/admin/tags/index.html.erb +15 -12
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +28 -0
- data/app/views/alchemy/admin/uploader/_button.html.erb +23 -29
- data/app/views/alchemy/admin/uploader/_setup.html.erb +3 -8
- data/app/views/alchemy/base/500.html.erb +1 -1
- data/app/views/alchemy/base/error_notice.js.erb +0 -1
- data/app/views/alchemy/ingredients/_boolean_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_datetime_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_file_editor.html.erb +5 -5
- data/app/views/alchemy/ingredients/_link_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_node_editor.html.erb +6 -19
- data/app/views/alchemy/ingredients/_page_editor.html.erb +7 -19
- data/app/views/alchemy/ingredients/_picture_editor.html.erb +2 -2
- data/app/views/alchemy/ingredients/_richtext_editor.html.erb +6 -15
- data/app/views/alchemy/ingredients/_select_editor.html.erb +2 -1
- data/app/views/alchemy/ingredients/_text_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/shared/_anchor.html.erb +1 -1
- data/app/views/alchemy/ingredients/shared/_link_tools.html.erb +10 -20
- data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +42 -49
- data/app/views/kaminari/alchemy/_first_page.html.erb +4 -2
- data/app/views/kaminari/alchemy/_gap.html.erb +1 -1
- data/app/views/kaminari/alchemy/_last_page.html.erb +4 -2
- data/app/views/kaminari/alchemy/_next_page.html.erb +4 -2
- data/app/views/kaminari/alchemy/_prev_page.html.erb +4 -2
- data/app/views/layouts/alchemy/admin.html.erb +10 -29
- data/bundles/shoelace.js +10 -0
- data/bundles/tinymce.js +20 -0
- data/config/alchemy/config.yml +11 -10
- data/config/alchemy/modules.yml +30 -30
- data/config/brakeman.ignore +0 -34
- data/config/importmap.rb +9 -5
- data/config/initializers/dragonfly.rb +1 -0
- data/config/initializers/rails_live_reload.rb +13 -0
- data/config/locales/alchemy.en.yml +25 -9
- data/config/routes.rb +2 -1
- data/lib/alchemy/auth_accessors.rb +6 -1
- data/lib/alchemy/config.rb +24 -2
- data/lib/alchemy/dev_support/live_reload_watcher.rb +5 -0
- data/lib/alchemy/engine.rb +10 -3
- data/lib/alchemy/forms/builder.rb +18 -12
- data/lib/alchemy/resources_helper.rb +3 -3
- data/lib/alchemy/test_support/capybara_helpers.rb +8 -5
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +6 -6
- data/lib/alchemy/test_support/rspec_matchers.rb +14 -0
- data/lib/alchemy/test_support/shared_uploader_examples.rb +1 -1
- data/lib/alchemy/tinymce.rb +19 -3
- data/lib/alchemy/version.rb +1 -1
- data/package.json +30 -9
- data/rollup.config.mjs +65 -0
- data/vendor/assets/fonts/remixicon.eot +0 -0
- data/vendor/assets/fonts/remixicon.svg +7816 -0
- data/vendor/assets/fonts/remixicon.ttf +0 -0
- data/vendor/assets/fonts/remixicon.woff +0 -0
- data/vendor/assets/fonts/remixicon.woff2 +0 -0
- data/vendor/assets/stylesheets/remixicon.scss +10480 -0
- data/vendor/assets/stylesheets/tinymce/skins/content/default/content.min.css +1 -0
- data/vendor/javascript/clipboard.min.js +7 -0
- data/vendor/javascript/flatpickr.min.js +1 -0
- data/vendor/javascript/keymaster.min.js +1 -0
- data/vendor/javascript/rails-ujs.min.js +1 -0
- data/vendor/javascript/shoelace.min.js +995 -0
- data/vendor/javascript/sortable.min.js +7 -0
- data/vendor/javascript/tinymce.min.js +1 -0
- data/vendor/javascript/ungap-custom-elements.min.js +3 -0
- metadata +111 -124
- data/.codeclimate.yml +0 -35
- data/.editorconfig +0 -23
- data/.github/FUNDING.yml +0 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.md +0 -22
- data/.github/ISSUE_TEMPLATE/Feature_request.md +0 -17
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -18
- data/.github/workflows/brakeman-analysis.yml +0 -46
- data/.github/workflows/lint.yml +0 -37
- data/.github/workflows/stale.yml +0 -33
- data/.github/workflows/test.yml +0 -124
- data/.gitignore +0 -31
- data/.hound.yml +0 -9
- data/.localeapp/config.rb +0 -8
- data/.prettierrc +0 -6
- data/.rspec +0 -1
- data/.rubocop.yml +0 -7
- data/.standard.yml +0 -4
- data/.yardopts +0 -5
- data/app/assets/javascripts/alchemy/alchemy.autocomplete.js.coffee +0 -30
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +0 -53
- data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +0 -45
- data/app/assets/javascripts/alchemy/alchemy.char_counter.js.coffee +0 -19
- data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +0 -59
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +0 -79
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +0 -267
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +0 -27
- data/app/assets/javascripts/alchemy/alchemy.spinner.js +0 -32
- data/app/assets/javascripts/alchemy/alchemy.tooltips.coffee +0 -10
- data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +0 -131
- data/app/assets/javascripts/alchemy/menubar.js.coffee +0 -8
- data/app/assets/javascripts/alchemy/node_select.js +0 -39
- data/app/assets/javascripts/alchemy/page_select.js +0 -46
- data/app/assets/javascripts/alchemy/templates/node.hbs +0 -16
- data/app/assets/javascripts/alchemy/templates/spinner.hbs +0 -7
- data/app/assets/stylesheets/alchemy/jquery-ui.scss +0 -435
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +0 -94
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +0 -63
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +0 -129
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/anchor.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/loader.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/object.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/trans.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +0 -2105
- data/app/javascript/alchemy_admin/datepicker.js +0 -33
- data/app/javascript/alchemy_admin/tinymce.js +0 -146
- data/app/javascript/alchemy_admin/translations.js +0 -32
- data/app/views/alchemy/admin/elements/fold.js.erb +0 -33
- data/app/views/alchemy/admin/elements/order.js.erb +0 -11
- data/app/views/alchemy/admin/elements/publish.js.erb +0 -21
- data/app/views/alchemy/admin/elements/update.js.erb +0 -27
- data/vendor/assets/fonts/fa-regular-400.eot +0 -0
- data/vendor/assets/fonts/fa-regular-400.svg +0 -803
- data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/fa-solid-900.svg +0 -4938
- data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/clipboard.min.js +0 -7
- data/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js +0 -178
- data/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js +0 -125
- data/vendor/assets/javascripts/fileupload/jquery.fileupload.js +0 -1502
- data/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js +0 -224
- data/vendor/assets/javascripts/jquery-ui/data.js +0 -45
- data/vendor/assets/javascripts/jquery-ui/ie.js +0 -20
- data/vendor/assets/javascripts/jquery-ui/keycode.js +0 -51
- data/vendor/assets/javascripts/jquery-ui/plugin.js +0 -49
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +0 -46
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +0 -27
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +0 -50
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +0 -54
- data/vendor/assets/javascripts/jquery-ui/version.js +0 -20
- data/vendor/assets/javascripts/jquery-ui/widget.js +0 -754
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +0 -1268
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +0 -241
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +0 -1623
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +0 -931
- data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo.min.js +0 -7
- data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +0 -296
- data/vendor/assets/javascripts/keymaster.js +0 -296
- data/vendor/assets/javascripts/requestAnimationFrame.js +0 -31
- data/vendor/assets/javascripts/tinymce/license.txt +0 -504
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +0 -2
- data/vendor/assets/stylesheets/fontawesome/_animated.scss +0 -20
- data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +0 -20
- data/vendor/assets/stylesheets/fontawesome/_core.scss +0 -21
- data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +0 -6
- data/vendor/assets/stylesheets/fontawesome/_icons.scss +0 -1441
- data/vendor/assets/stylesheets/fontawesome/_larger.scss +0 -23
- data/vendor/assets/stylesheets/fontawesome/_list.scss +0 -18
- data/vendor/assets/stylesheets/fontawesome/_mixins.scss +0 -56
- data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +0 -24
- data/vendor/assets/stylesheets/fontawesome/_screen-reader.scss +0 -5
- data/vendor/assets/stylesheets/fontawesome/_stacked.scss +0 -31
- data/vendor/assets/stylesheets/fontawesome/_variables.scss +0 -1458
- data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +0 -16
- data/vendor/assets/stylesheets/fontawesome/regular.scss +0 -23
- data/vendor/assets/stylesheets/fontawesome/solid.scss +0 -24
@@ -1,46 +0,0 @@
|
|
1
|
-
# This workflow integrates Brakeman with GitHub's Code Scanning feature
|
2
|
-
# Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications
|
3
|
-
|
4
|
-
name: Brakeman Scan
|
5
|
-
|
6
|
-
on:
|
7
|
-
push:
|
8
|
-
branches: [main]
|
9
|
-
pull_request:
|
10
|
-
# The branches below must be a subset of the branches above
|
11
|
-
branches: [main]
|
12
|
-
schedule:
|
13
|
-
- cron: "40 4 * * 2"
|
14
|
-
|
15
|
-
jobs:
|
16
|
-
brakeman-scan:
|
17
|
-
name: Brakeman Scan
|
18
|
-
runs-on: ubuntu-latest
|
19
|
-
steps:
|
20
|
-
# Checkout the repository to the GitHub Actions runner
|
21
|
-
- name: Checkout
|
22
|
-
uses: actions/checkout@v3
|
23
|
-
|
24
|
-
# Customize the ruby version depending on your needs
|
25
|
-
- name: Set up Ruby
|
26
|
-
uses: ruby/setup-ruby@v1
|
27
|
-
with:
|
28
|
-
ruby-version: "3.0"
|
29
|
-
|
30
|
-
- name: Setup Brakeman
|
31
|
-
env:
|
32
|
-
BRAKEMAN_VERSION: "5.4" # SARIF support is provided in Brakeman version 4.10+
|
33
|
-
run: |
|
34
|
-
gem install brakeman --version $BRAKEMAN_VERSION
|
35
|
-
|
36
|
-
# Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis
|
37
|
-
- name: Scan
|
38
|
-
continue-on-error: true
|
39
|
-
run: |
|
40
|
-
brakeman -f sarif -o output.sarif.json .
|
41
|
-
|
42
|
-
# Upload the SARIF file generated in the previous step
|
43
|
-
- name: Upload SARIF
|
44
|
-
uses: github/codeql-action/upload-sarif@v2
|
45
|
-
with:
|
46
|
-
sarif_file: output.sarif.json
|
data/.github/workflows/lint.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
name: Lint
|
2
|
-
|
3
|
-
on: [pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
Standard:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
steps:
|
9
|
-
- name: Checkout code
|
10
|
-
uses: actions/checkout@v3
|
11
|
-
- name: Install Ruby and gems
|
12
|
-
uses: ruby/setup-ruby@v1
|
13
|
-
with:
|
14
|
-
ruby-version: "3.0"
|
15
|
-
bundler-cache: true
|
16
|
-
- name: Lint Ruby files
|
17
|
-
run: bundle exec standardrb
|
18
|
-
Prettier:
|
19
|
-
runs-on: ubuntu-latest
|
20
|
-
steps:
|
21
|
-
- name: Checkout
|
22
|
-
uses: actions/checkout@v3
|
23
|
-
- name: Setup Node
|
24
|
-
uses: actions/setup-node@v3
|
25
|
-
with:
|
26
|
-
node-version: "18"
|
27
|
-
- name: Restore node_modules cache
|
28
|
-
uses: actions/cache@v3
|
29
|
-
with:
|
30
|
-
path: node_modules
|
31
|
-
key: ${{ runner.os }}-node-modules-${{ hashFiles('package.json') }}
|
32
|
-
restore-keys: |
|
33
|
-
${{ runner.os }}-node-modules
|
34
|
-
- name: Install dependencies
|
35
|
-
run: yarn install
|
36
|
-
- name: Lint code
|
37
|
-
run: yarn lint
|
data/.github/workflows/stale.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
name: Mark stale issues and pull requests
|
2
|
-
|
3
|
-
on:
|
4
|
-
schedule:
|
5
|
-
- cron: "0 0 * * *"
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
stale:
|
9
|
-
runs-on: ubuntu-latest
|
10
|
-
|
11
|
-
steps:
|
12
|
-
- uses: actions/stale@v5
|
13
|
-
with:
|
14
|
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
15
|
-
days-before-issue-stale: 180
|
16
|
-
days-before-close: 30
|
17
|
-
stale-issue-message: |
|
18
|
-
This issue has not seen any activity in a long time.
|
19
|
-
Please create a pull request with a fix or ask someone of the community if they can help.
|
20
|
-
This issue will be closed in 7 days if no further activity happens.
|
21
|
-
close-issue-message: |
|
22
|
-
This issue has not seen any activity in a long time.
|
23
|
-
If the issue described still exists in recent versions of Alchemy,
|
24
|
-
please open a new issue with. Thanks for reporting.
|
25
|
-
stale-pr-message: |
|
26
|
-
This pull request has not seen any activiy in a long time.
|
27
|
-
Probably because of missing tests or a necessary rebase.
|
28
|
-
This PR will be closed in 7 days if no further activity happens.
|
29
|
-
close-pr-message: |
|
30
|
-
This pull request has not seen any activiy in a long time.
|
31
|
-
Probably because of missing tests or a necessary rebase.
|
32
|
-
Please open a new PR to latest main if you want to continue working on this.
|
33
|
-
Thanks for the contribution.
|
data/.github/workflows/test.yml
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
name: Test
|
2
|
-
|
3
|
-
on: [push, pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
RSpec:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
strategy:
|
9
|
-
fail-fast: false
|
10
|
-
matrix:
|
11
|
-
rails:
|
12
|
-
- "6.1"
|
13
|
-
- "7.0"
|
14
|
-
- "7.1"
|
15
|
-
ruby:
|
16
|
-
- "3.0"
|
17
|
-
- "3.1"
|
18
|
-
- "3.2"
|
19
|
-
database:
|
20
|
-
- mysql
|
21
|
-
- postgresql
|
22
|
-
- mariadb
|
23
|
-
env:
|
24
|
-
DB: ${{ matrix.database }}
|
25
|
-
DB_USER: alchemy_user
|
26
|
-
DB_PASSWORD: password
|
27
|
-
DB_HOST: "127.0.0.1"
|
28
|
-
RAILS_ENV: test
|
29
|
-
RAILS_VERSION: ${{ matrix.rails }}
|
30
|
-
services:
|
31
|
-
postgres:
|
32
|
-
image: postgres:11
|
33
|
-
env:
|
34
|
-
POSTGRES_USER: alchemy_user
|
35
|
-
POSTGRES_PASSWORD: password
|
36
|
-
POSTGRES_DB: alchemy_cms_dummy_test
|
37
|
-
ports: ["5432:5432"]
|
38
|
-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
39
|
-
mysql:
|
40
|
-
image: mysql:latest
|
41
|
-
ports: ["3306:3306"]
|
42
|
-
env:
|
43
|
-
MYSQL_USER: alchemy_user
|
44
|
-
MYSQL_PASSWORD: password
|
45
|
-
MYSQL_DATABASE: alchemy_cms_dummy_test
|
46
|
-
MYSQL_ROOT_PASSWORD: password
|
47
|
-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
48
|
-
mariadb:
|
49
|
-
image: mariadb:latest
|
50
|
-
ports: ["3307:3306"]
|
51
|
-
env:
|
52
|
-
MARIADB_USER: alchemy_user
|
53
|
-
MARIADB_PASSWORD: password
|
54
|
-
MARIADB_DATABASE: alchemy_cms_dummy_test
|
55
|
-
MARIADB_ROOT_PASSWORD: password
|
56
|
-
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
57
|
-
steps:
|
58
|
-
- uses: actions/checkout@v3
|
59
|
-
- name: Set up Ruby
|
60
|
-
uses: ruby/setup-ruby@v1
|
61
|
-
with:
|
62
|
-
ruby-version: ${{ matrix.ruby }}
|
63
|
-
bundler-cache: true
|
64
|
-
- name: Restore apt cache
|
65
|
-
id: apt-cache
|
66
|
-
uses: actions/cache@v3
|
67
|
-
with:
|
68
|
-
path: /home/runner/apt/cache
|
69
|
-
key: ${{ runner.os }}-apt-${{ matrix.database }}
|
70
|
-
restore-keys: |
|
71
|
-
${{ runner.os }}-apt-
|
72
|
-
- name: Install Postgres headers
|
73
|
-
if: matrix.database == 'postgresql'
|
74
|
-
run: |
|
75
|
-
mkdir -p /home/runner/apt/cache
|
76
|
-
sudo apt update -qq
|
77
|
-
sudo apt install -qq --fix-missing libpq-dev -o dir::cache::archives="/home/runner/apt/cache"
|
78
|
-
sudo chown -R runner /home/runner/apt/cache
|
79
|
-
- name: Install MySQL headers
|
80
|
-
if: matrix.database == 'mysql' || matrix.database == 'mariadb'
|
81
|
-
run: |
|
82
|
-
mkdir -p /home/runner/apt/cache
|
83
|
-
sudo apt update -qq
|
84
|
-
sudo apt install -qq --fix-missing libmysqlclient-dev -o dir::cache::archives="/home/runner/apt/cache"
|
85
|
-
sudo chown -R runner /home/runner/apt/cache
|
86
|
-
- name: Restore node modules cache
|
87
|
-
id: yarn-cache
|
88
|
-
uses: actions/cache@v3
|
89
|
-
with:
|
90
|
-
path: spec/dummy/node_modules
|
91
|
-
key: ${{ runner.os }}-yarn-dummy-${{ hashFiles('./package.json') }}
|
92
|
-
restore-keys: |
|
93
|
-
${{ runner.os }}-yarn-dummy-
|
94
|
-
- name: Prepare database
|
95
|
-
run: |
|
96
|
-
bundle exec rake alchemy:spec:prepare
|
97
|
-
- name: Run tests & publish code coverage
|
98
|
-
uses: paambaati/codeclimate-action@v3.2.0
|
99
|
-
env:
|
100
|
-
CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22
|
101
|
-
with:
|
102
|
-
coverageCommand: bundle exec rspec
|
103
|
-
- uses: actions/upload-artifact@main
|
104
|
-
if: failure()
|
105
|
-
with:
|
106
|
-
name: Screenshots
|
107
|
-
path: spec/dummy/tmp/screenshots
|
108
|
-
Jest:
|
109
|
-
runs-on: ubuntu-latest
|
110
|
-
env:
|
111
|
-
NODE_ENV: test
|
112
|
-
steps:
|
113
|
-
- uses: actions/checkout@v3
|
114
|
-
- name: Restore node modules cache
|
115
|
-
uses: actions/cache@v3
|
116
|
-
with:
|
117
|
-
path: node_modules
|
118
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('./package.json') }}
|
119
|
-
restore-keys: |
|
120
|
-
${{ runner.os }}-yarn-
|
121
|
-
- name: Install yarn
|
122
|
-
run: yarn install
|
123
|
-
- name: Run jest
|
124
|
-
run: yarn jest
|
data/.gitignore
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
.idea
|
2
|
-
.yardoc
|
3
|
-
.DS_Store
|
4
|
-
.svn
|
5
|
-
doc/
|
6
|
-
rdoc/
|
7
|
-
Gemfile.lock
|
8
|
-
pkg
|
9
|
-
tmp
|
10
|
-
log
|
11
|
-
.sass-cache
|
12
|
-
spec/dummy/config/alchemy/config.yml
|
13
|
-
spec/dummy/db/*.sqlite3*
|
14
|
-
spec/dummy/postcss.config.js
|
15
|
-
spec/dummy/public/assets/
|
16
|
-
spec/dummy/uploads/
|
17
|
-
.rvmrc
|
18
|
-
/coverage/
|
19
|
-
*.gem
|
20
|
-
/index/
|
21
|
-
/.bundle/
|
22
|
-
.rbenv-version
|
23
|
-
.ruby-gemset
|
24
|
-
.ruby-version
|
25
|
-
.env
|
26
|
-
node_modules
|
27
|
-
yarn-error.log
|
28
|
-
yarn-debug.log*
|
29
|
-
.yarn-integrity
|
30
|
-
yarn.lock
|
31
|
-
/spec/dummy/public/pictures
|
data/.hound.yml
DELETED
data/.localeapp/config.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require 'dotenv/load'
|
2
|
-
|
3
|
-
Localeapp.configure do |config|
|
4
|
-
config.api_key = ENV['LOCALEAPP_API_KEY']
|
5
|
-
config.translation_data_directory = 'config/locales'
|
6
|
-
config.synchronization_data_file = '.localeapp/log.yml'
|
7
|
-
config.daemon_pid_file = '.localeapp/localeapp.pid'
|
8
|
-
end
|
data/.prettierrc
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--require spec_helper
|
data/.rubocop.yml
DELETED
data/.standard.yml
DELETED
data/.yardopts
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
|
2
|
-
|
3
|
-
Alchemy.Autocomplete =
|
4
|
-
|
5
|
-
tags: (scope) ->
|
6
|
-
field = $('[data-autocomplete]', scope)
|
7
|
-
url = field.data('autocomplete')
|
8
|
-
field.select2
|
9
|
-
tags: true
|
10
|
-
tokenSeparators: [","]
|
11
|
-
minimumInputLength: 1
|
12
|
-
openOnEnter: false
|
13
|
-
createSearchChoice: @_createResultItem
|
14
|
-
ajax:
|
15
|
-
url: url
|
16
|
-
dataType: 'json'
|
17
|
-
data: (term, page) -> term: term
|
18
|
-
results: (data, page) -> results: data
|
19
|
-
initSelection: @_initializeSelection
|
20
|
-
|
21
|
-
_createResultItem: (term, data) ->
|
22
|
-
if $(data).filter(-> @text.localeCompare(term) is 0).length is 0
|
23
|
-
id: term
|
24
|
-
text: term
|
25
|
-
|
26
|
-
_initializeSelection: (element, callback) ->
|
27
|
-
data = []
|
28
|
-
$(element.val().split(",")).each ->
|
29
|
-
data.push id: $.trim(this), text: this
|
30
|
-
callback(data)
|
@@ -1,53 +0,0 @@
|
|
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
|
-
url = $this.attr("href") + "?" + picture_ids
|
28
|
-
Alchemy.openDialog url, {title: $this.attr("title"), size: '400x295'}
|
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
|
-
if show
|
37
|
-
spinner = new Alchemy.Spinner('medium')
|
38
|
-
spinner.spin $overlay
|
39
|
-
$overlay.show()
|
40
|
-
else
|
41
|
-
$overlay.find('.spinner').remove()
|
42
|
-
$overlay.hide()
|
43
|
-
return
|
44
|
-
|
45
|
-
# Initializes all select tag with .alchemy_selectbox class as select2 instance
|
46
|
-
# Pass a jQuery scope to only init a subset of selectboxes.
|
47
|
-
SelectBox: (scope) ->
|
48
|
-
$("select.alchemy_selectbox", scope).select2
|
49
|
-
minimumResultsForSearch: 7
|
50
|
-
dropdownAutoWidth: true
|
51
|
-
return
|
52
|
-
|
53
|
-
|
@@ -1,45 +0,0 @@
|
|
1
|
-
window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
|
2
|
-
|
3
|
-
Alchemy.Buttons =
|
4
|
-
|
5
|
-
observe: (scope) ->
|
6
|
-
$('form', scope).not('.button_with_label form').on 'submit', (event) ->
|
7
|
-
$form = $(this)
|
8
|
-
$btn = $form.find(':submit')
|
9
|
-
$outside_button = $('[data-alchemy-button][form="'+$form.attr('id')+'"]')
|
10
|
-
|
11
|
-
if ($btn.attr('disabled') == 'disabled') || ($outside_button.attr('disabled') == 'disabled')
|
12
|
-
event.preventDefault()
|
13
|
-
event.stopPropagation()
|
14
|
-
false
|
15
|
-
else
|
16
|
-
Alchemy.Buttons.disable($btn)
|
17
|
-
if $outside_button
|
18
|
-
Alchemy.Buttons.disable($outside_button)
|
19
|
-
true
|
20
|
-
|
21
|
-
disable: (button) ->
|
22
|
-
$button = $(button)
|
23
|
-
spinner = new Alchemy.Spinner('small')
|
24
|
-
$button.data('content', $button.html())
|
25
|
-
$button.attr('disabled', true)
|
26
|
-
$button.attr('tabindex', '-1')
|
27
|
-
$button.addClass('disabled')
|
28
|
-
$button.css
|
29
|
-
width: $button.outerWidth()
|
30
|
-
height: $button.outerHeight()
|
31
|
-
$button.empty()
|
32
|
-
spinner.spin($button)
|
33
|
-
return true
|
34
|
-
|
35
|
-
enable: (scope) ->
|
36
|
-
$buttons = $('form :submit:disabled, [data-alchemy-button].disabled', scope)
|
37
|
-
$.each $buttons, ->
|
38
|
-
$button = $(this)
|
39
|
-
$button.removeClass('disabled')
|
40
|
-
$button.removeAttr('disabled')
|
41
|
-
$button.removeAttr('tabindex')
|
42
|
-
$button.css("width", "")
|
43
|
-
$button.css("height", "")
|
44
|
-
$button.html($button.data('content'))
|
45
|
-
return true
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class window.Alchemy.CharCounter
|
2
|
-
|
3
|
-
constructor: (field) ->
|
4
|
-
@$field = $(field)
|
5
|
-
@max_chars = @$field.data('alchemy-char-counter')
|
6
|
-
@text = Alchemy.t('allowed_chars', @max_chars)
|
7
|
-
@$display = $('<small class="alchemy-char-counter"/>')
|
8
|
-
@$field.after(@$display)
|
9
|
-
countChars.call(this)
|
10
|
-
@$field.keyup =>
|
11
|
-
countChars.call(this)
|
12
|
-
true
|
13
|
-
|
14
|
-
countChars = ->
|
15
|
-
char_length = @$field.val().length
|
16
|
-
@$display.removeClass('too-long')
|
17
|
-
@$display.text("#{char_length} #{@text}")
|
18
|
-
if char_length > @max_chars
|
19
|
-
@$display.addClass('too-long')
|
@@ -1,59 +0,0 @@
|
|
1
|
-
window.Alchemy = {} if typeof (window.Alchemy) is "undefined"
|
2
|
-
|
3
|
-
$.extend Alchemy,
|
4
|
-
|
5
|
-
ElementDirtyObserver: (selector) ->
|
6
|
-
$(selector).find('input[type="text"], select').change (e) =>
|
7
|
-
$content = $(e.target)
|
8
|
-
$content.addClass('dirty')
|
9
|
-
@setElementDirty $content.closest(".element-editor")
|
10
|
-
return
|
11
|
-
|
12
|
-
setElementDirty: (element) ->
|
13
|
-
$element = $(element)
|
14
|
-
$element.addClass('dirty')
|
15
|
-
window.onbeforeunload = @pageUnload
|
16
|
-
|
17
|
-
pageUnload: ->
|
18
|
-
Alchemy.t('page_dirty_notice')
|
19
|
-
|
20
|
-
setElementClean: (element) ->
|
21
|
-
$element = $(element)
|
22
|
-
$element.removeClass('dirty')
|
23
|
-
$element.find('> .element-body .dirty').removeClass('dirty')
|
24
|
-
window.onbeforeunload = undefined
|
25
|
-
|
26
|
-
isPageDirty: ->
|
27
|
-
$('#element_area').find('.element-editor.dirty').length > 0
|
28
|
-
|
29
|
-
isElementDirty: (element) ->
|
30
|
-
$(element).hasClass('dirty')
|
31
|
-
|
32
|
-
checkPageDirtyness: (element) ->
|
33
|
-
callback = undefined
|
34
|
-
if $(element).is("form")
|
35
|
-
callback = ->
|
36
|
-
$form = $("<form action=\"#{element.action}\" method=\"POST\" style=\"display: none\" />")
|
37
|
-
$form.append $(element).find("input")
|
38
|
-
$form.appendTo "body"
|
39
|
-
Alchemy.pleaseWaitOverlay()
|
40
|
-
$form.submit()
|
41
|
-
else if $(element).is("a")
|
42
|
-
callback = ->
|
43
|
-
Turbo.visit(element.pathname)
|
44
|
-
if Alchemy.isPageDirty()
|
45
|
-
Alchemy.openConfirmDialog Alchemy.t('page_dirty_notice'),
|
46
|
-
title: Alchemy.t('warning')
|
47
|
-
ok_label: Alchemy.t('ok')
|
48
|
-
cancel_label: Alchemy.t('cancel')
|
49
|
-
on_ok: ->
|
50
|
-
window.onbeforeunload = undefined
|
51
|
-
callback()
|
52
|
-
false
|
53
|
-
else
|
54
|
-
true
|
55
|
-
|
56
|
-
PageLeaveObserver: ->
|
57
|
-
$('#main_navi a').click (event) ->
|
58
|
-
unless Alchemy.checkPageDirtyness(event.currentTarget)
|
59
|
-
event.preventDefault()
|
@@ -1,79 +0,0 @@
|
|
1
|
-
#= require jquery-ui/widgets/draggable
|
2
|
-
#= require jquery-ui/widgets/sortable
|
3
|
-
#
|
4
|
-
window.Alchemy = {} if typeof (window.Alchemy) is "undefined"
|
5
|
-
|
6
|
-
$.extend Alchemy,
|
7
|
-
|
8
|
-
SortableElements: (page_id, form_token, selector = '#element_area .sortable-elements') ->
|
9
|
-
Alchemy.initializedSortableElements = false
|
10
|
-
$sortable_area = $(selector)
|
11
|
-
|
12
|
-
getTinymceIDs = (ui) ->
|
13
|
-
ids = []
|
14
|
-
$textareas = ui.item.find('textarea.has_tinymce')
|
15
|
-
$($textareas).each ->
|
16
|
-
id = this.id.replace(/tinymce_/, '')
|
17
|
-
ids.push parseInt(id, 10)
|
18
|
-
return ids
|
19
|
-
|
20
|
-
sortable_options =
|
21
|
-
items: "> .element-editor"
|
22
|
-
handle: "> .element-header .element-handle"
|
23
|
-
placeholder: "droppable_element_placeholder"
|
24
|
-
dropOnEmpty: true
|
25
|
-
opacity: 0.5
|
26
|
-
cursor: "move"
|
27
|
-
containment: $('#element_area')
|
28
|
-
tolerance: "pointer"
|
29
|
-
update: (event, ui) ->
|
30
|
-
# This callback is called twice for both elements, the source and the receiving
|
31
|
-
# but, we only want to call ajax callback once on the receiving element.
|
32
|
-
return if Alchemy.initializedSortableElements
|
33
|
-
$this = ui.item.parent().closest('.ui-sortable')
|
34
|
-
params = {}
|
35
|
-
Alchemy.initializedSortableElements = true
|
36
|
-
element_ids = $.map $this.children(), (child) ->
|
37
|
-
$(child).attr("data-element-id")
|
38
|
-
parent_element_id = ui.item.parent().closest("[data-element-id]").data('element-id')
|
39
|
-
params =
|
40
|
-
page_id: page_id
|
41
|
-
authenticity_token: encodeURIComponent(form_token)
|
42
|
-
element_ids: element_ids
|
43
|
-
if parent_element_id?
|
44
|
-
params['parent_element_id'] = parent_element_id
|
45
|
-
$(event.target).css("cursor", "progress")
|
46
|
-
$.ajax
|
47
|
-
url: Alchemy.routes.order_admin_elements_path
|
48
|
-
type: "POST"
|
49
|
-
data: params
|
50
|
-
complete: ->
|
51
|
-
Alchemy.initializedSortableElements = false
|
52
|
-
$(event.target).css("cursor", "")
|
53
|
-
return
|
54
|
-
start: (event, ui) ->
|
55
|
-
$this = $(this)
|
56
|
-
name = ui.item.data('element-name')
|
57
|
-
$dropzone = $("[data-droppable-elements~='#{name}']")
|
58
|
-
ids = getTinymceIDs(ui)
|
59
|
-
$this.sortable('option', 'connectWith', $dropzone)
|
60
|
-
$this.sortable('refresh')
|
61
|
-
$dropzone.css('minHeight', 36)
|
62
|
-
ui.item.addClass('dragged')
|
63
|
-
if ui.item.hasClass('compact')
|
64
|
-
ui.placeholder.addClass('compact').css
|
65
|
-
height: ui.item.outerHeight()
|
66
|
-
Alchemy.Tinymce.remove(ids)
|
67
|
-
return
|
68
|
-
stop: (event, ui) ->
|
69
|
-
ids = getTinymceIDs(ui)
|
70
|
-
name = ui.item.data('element-name')
|
71
|
-
$dropzone = $("[data-droppable-elements~='#{name}']")
|
72
|
-
$dropzone.css('minHeight', '')
|
73
|
-
ui.item.removeClass('dragged')
|
74
|
-
Alchemy.Tinymce.init(ids)
|
75
|
-
return
|
76
|
-
|
77
|
-
$sortable_area.sortable(sortable_options)
|
78
|
-
$sortable_area.find('.nested-elements').sortable(sortable_options)
|
79
|
-
return
|