alchemy_cms 2.0.7 → 2.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -4
- data/.travis.yml +1 -1
- data/Gemfile +7 -2
- data/README.md +6 -6
- data/Rakefile +26 -18
- data/alchemy_cms.gemspec +14 -14
- data/{assets/stylesheets → app/assets/images/alchemy}/Jcrop.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/ajax_loader.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/alchemy-logo.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/flags.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/navi-tab.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/shading_90.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/toggle.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/icons.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/image_loader.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow_bg.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow_bg_hover.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/placeholder.png +0 -0
- data/{assets/images/gui → app/assets/images/alchemy}/shading.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/swfupload/browse_button.png +0 -0
- data/{assets/stylesheets/default/img → app/assets/images/alchemy}/tabs.gif +0 -0
- data/{assets/images/jquery-ui → app/assets/images/alchemy}/ui-icons_666666_256x240.png +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +212 -0
- data/app/assets/javascripts/alchemy/alchemy.buttons.js +36 -0
- data/app/assets/javascripts/alchemy/alchemy.dirty.js +91 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +114 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.element_editor_selector.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.growler.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.image_cropper.js +0 -0
- data/app/assets/javascripts/alchemy/alchemy.js +26 -0
- data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +17 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.link_overlay.js +1 -1
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.page_sorter.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.preview.js +0 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js +438 -0
- data/app/assets/stylesheets/alchemy/_defaults.scss +160 -0
- data/app/assets/stylesheets/alchemy/alchemy.css +9 -0
- data/{assets/stylesheets/alchemy.css → app/assets/stylesheets/alchemy/base.css.scss} +216 -353
- data/{assets/stylesheets/elements.css → app/assets/stylesheets/alchemy/elements.css.scss} +41 -70
- data/{assets/stylesheets/flags.css → app/assets/stylesheets/alchemy/flags.css.scss} +1 -1
- data/{assets/stylesheets/jquery-ui-1.8.7.alchemy.css → app/assets/stylesheets/alchemy/jquery-ui.alchemy.css} +15 -15
- data/{assets/stylesheets/jquery.Jcrop.css → app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss} +3 -3
- data/{assets/stylesheets/jquery.sb.css → app/assets/stylesheets/alchemy/jquery.sb.css.scss} +19 -29
- data/{assets/stylesheets → app/assets/stylesheets/alchemy}/print.css +6 -1
- data/{assets/stylesheets → app/assets/stylesheets/alchemy}/standard_set.css +0 -0
- data/{assets/stylesheets/alchemy_tinymce_content.css → app/assets/stylesheets/alchemy/tinymce_content.css} +0 -0
- data/{assets/stylesheets/alchemy_tinymce_dialog.css → app/assets/stylesheets/alchemy/tinymce_dialog.css} +2 -2
- data/app/controllers/admin/attachments_controller.rb +2 -8
- data/app/controllers/admin/clipboard_controller.rb +2 -2
- data/app/controllers/admin/contents_controller.rb +4 -16
- data/app/controllers/admin/elements_controller.rb +2 -2
- data/app/controllers/admin/essence_audios_controller.rb +0 -3
- data/app/controllers/admin/essence_files_controller.rb +0 -11
- data/app/controllers/admin/essence_flashes_controller.rb +0 -3
- data/app/controllers/admin/essence_pictures_controller.rb +2 -7
- data/app/controllers/admin/essence_videos_controller.rb +0 -3
- data/app/controllers/admin/languages_controller.rb +4 -10
- data/app/controllers/admin/pages_controller.rb +6 -4
- data/app/controllers/admin/pictures_controller.rb +13 -18
- data/app/controllers/admin/trash_controller.rb +0 -5
- data/app/controllers/admin/users_controller.rb +2 -3
- data/app/controllers/alchemy_controller.rb +18 -30
- data/app/controllers/pages_controller.rb +21 -24
- data/app/helpers/admin/elements_helper.rb +5 -0
- data/app/helpers/admin/pages_helper.rb +36 -1
- data/app/helpers/alchemy_helper.rb +39 -17
- data/app/models/attachment.rb +2 -2
- data/app/models/essence_file.rb +1 -1
- data/app/models/page.rb +1 -1
- data/app/sweepers/pages_sweeper.rb +10 -0
- data/app/views/admin/attachments/destroy.js.erb +4 -0
- data/app/views/admin/clipboard/insert.js.erb +12 -19
- data/app/views/admin/contents/create.js.erb +1 -1
- data/app/views/admin/contents/destroy.js.erb +7 -0
- data/app/views/admin/contents/order.js.erb +6 -0
- data/app/views/admin/elements/_element.html.erb +4 -2
- data/app/views/admin/elements/create.js.erb +19 -26
- data/app/views/admin/elements/fold.js.erb +1 -1
- data/app/views/admin/elements/index.html.erb +1 -1
- data/app/views/admin/essence_files/assign.js.erb +8 -0
- data/app/views/admin/essence_pictures/save_link.js.erb +3 -0
- data/app/views/admin/index.html.erb +37 -27
- data/app/views/admin/languages/destroy.js.erb +1 -0
- data/app/views/admin/pages/_page.html.erb +1 -1
- data/app/views/admin/pages/_sitemap.html.erb +1 -1
- data/app/views/admin/pages/edit.html.erb +2 -2
- data/app/views/admin/pages/update.js.erb +1 -1
- data/app/views/admin/partials/_upload_form.html.erb +11 -11
- data/app/views/admin/pictures/archive_overlay.js.erb +1 -0
- data/app/views/admin/pictures/flush.js.erb +2 -0
- data/app/views/admin/pictures/update.js.erb +1 -0
- data/app/views/admin/trash/clear.js.erb +3 -0
- data/app/views/alchemy/error_notice.js.erb +1 -0
- data/app/views/alchemy/permission_denied.js.erb +2 -0
- data/app/views/alchemy/redirect.js.erb +1 -0
- data/app/views/alchemy/remote_errors.js.erb +3 -0
- data/app/views/alchemy/update.js.erb +5 -0
- data/app/views/essences/_essence_file_editor.html.erb +0 -1
- data/app/views/essences/_essence_file_view.html.erb +1 -5
- data/app/views/essences/_essence_picture_tools.html.erb +1 -1
- data/app/views/layouts/alchemy.html.erb +22 -9
- data/app/views/pages/show.rss.builder +1 -1
- data/config/alchemy/elements.yml +0 -5
- data/config/alchemy/page_layouts.yml +1 -1
- data/config/asset_packages.yml +17 -19
- data/config/authorization_rules.rb +1 -0
- data/config/locales/de.yml +0 -1
- data/config/routes.rb +1 -1
- data/lib/alchemy/tinymce.rb +51 -0
- data/lib/alchemy/version.rb +3 -3
- data/lib/alchemy_cms.rb +4 -2
- data/script/rails +6 -0
- data/spec/controllers/admin/clipboard_controller_spec.rb +15 -13
- data/spec/controllers/admin/contents_controller_spec.rb +4 -4
- data/spec/controllers/admin/trash_controller_spec.rb +6 -9
- data/spec/controllers/pages_controller_spec.rb +9 -8
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +3 -3
- data/spec/dummy/config/application.rb +12 -6
- data/spec/dummy/config/database.yml +3 -0
- data/spec/dummy/config/environments/development.rb +7 -3
- data/spec/dummy/config/environments/production.rb +23 -12
- data/spec/dummy/config/environments/test.rb +5 -1
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +1 -1
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/factories.rb +8 -8
- data/spec/helpers/admin/elements_helper_spec.rb +2 -2
- data/spec/helpers/contents_helper_spec.rb +1 -1
- data/spec/helpers/elements_helper_spec.rb +6 -6
- data/spec/helpers/essences_helper_spec.rb +1 -1
- data/spec/helpers/pages_helper_spec.rb +37 -37
- data/spec/integration/pages_controller_spec.rb +29 -26
- data/spec/integration/security_spec.rb +2 -1
- data/spec/models/content_spec.rb +1 -1
- data/spec/models/element_spec.rb +11 -11
- data/spec/models/language_spec.rb +5 -5
- data/spec/models/page_spec.rb +54 -54
- data/spec/models/user_spec.rb +2 -1
- data/spec/routing_spec.rb +1 -1
- data/{assets/javascripts/jquery.js → vendor/assets/javascripts/jquery-1.6.2.min.js} +0 -0
- data/{assets/javascripts/jquery-ui.js → vendor/assets/javascripts/jquery-ui-custom-1.8.16.min.js} +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.Jcrop.min.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.dialogextend.min.js +7 -7
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.in-place-edit.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.sb.min.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.scrollTo-1.4.2-min.js +10 -10
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.ui.nestedSortable.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.ui.tabspaging.js +0 -0
- data/{assets → vendor/assets}/javascripts/swfupload/fileprogress.js +202 -202
- data/{assets → vendor/assets}/javascripts/swfupload/handlers.js +171 -171
- data/{assets → vendor/assets}/javascripts/swfupload/queue.js +97 -97
- data/{assets → vendor/assets}/javascripts/swfupload/swfupload.js +980 -980
- data/{assets → vendor/assets}/javascripts/swfupload/swfupload.swf +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/jquery.tinymce.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/license.txt +504 -504
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -110
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -0
- data/{assets/javascripts/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css → vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.erb} +8 -8
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -387
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -36
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -51
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/pastetext.htm +26 -26
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/pasteword.htm +21 -21
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/cell.htm +180 -180
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/cell.css +16 -16
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/row.css +25 -25
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/table.css +13 -13
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/cell.js +319 -319
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -27
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/row.js +237 -237
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/table.js +450 -450
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/merge_cells.htm +32 -32
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/row.htm +158 -158
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/table.htm +188 -188
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/about.htm +52 -52
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/anchor.htm +26 -26
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/charmap.htm +51 -51
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/color_picker.htm +74 -74
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/editor_template.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/image.htm +80 -80
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/iframe.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/trans.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/video.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/about.js +73 -73
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/anchor.js +43 -43
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/charmap.js +355 -355
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/color_picker.js +329 -329
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/image.js +251 -251
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/link.js +153 -153
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/source_editor.js +56 -56
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/link.htm +57 -57
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/shortcuts.htm +47 -47
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/content.css +50 -50
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -117
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +214 -214
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +48 -48
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +117 -117
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +217 -217
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +7 -7
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -5
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/source_editor.htm +25 -25
- data/{assets → vendor/assets}/javascripts/tiny_mce/tiny_mce.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/tiny_mce_popup.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/editable_selects.js +70 -70
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/form_utils.js +210 -210
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/mctabs.js +161 -161
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/validate.js +252 -252
- metadata +338 -369
- data/app/views/elements/_download_editor.html.erb +0 -1
- data/app/views/elements/_download_view.html.erb +0 -3
- data/assets/javascripts/alchemy.js +0 -903
- data/assets/javascripts/jquery.rails.js +0 -315
- data/assets/stylesheets/ie6.css +0 -18
- data/config/initializers/tinymce_hammer.rb +0 -31
@@ -5,29 +5,26 @@ class PagesController < AlchemyController
|
|
5
5
|
|
6
6
|
filter_access_to :show, :attribute_check => true
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
)
|
29
|
-
|
30
|
-
layout :layout_for_page
|
8
|
+
caches_action(
|
9
|
+
:show,
|
10
|
+
:cache_path => proc { url_for(:action => :show, :urlname => params[:urlname], :lang => multi_language? ? params[:lang] : nil) },
|
11
|
+
:if => proc do
|
12
|
+
if Alchemy::Config.get(:cache_pages)
|
13
|
+
page = Page.find_by_urlname_and_language_id_and_public(
|
14
|
+
params[:urlname],
|
15
|
+
session[:language_id],
|
16
|
+
true,
|
17
|
+
:select => 'page_layout, language_id, urlname'
|
18
|
+
)
|
19
|
+
if page
|
20
|
+
pagelayout = Alchemy::PageLayout.get(page.page_layout)
|
21
|
+
pagelayout['cache'].nil? || pagelayout['cache']
|
22
|
+
end
|
23
|
+
else
|
24
|
+
false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
)
|
31
28
|
|
32
29
|
# Showing page from params[:urlname]
|
33
30
|
# @page is fetched via before filter
|
@@ -40,7 +37,7 @@ class PagesController < AlchemyController
|
|
40
37
|
end
|
41
38
|
respond_to do |format|
|
42
39
|
format.html {
|
43
|
-
render
|
40
|
+
render :layout => params[:layout].blank? ? 'pages' : params[:layout] == 'none' ? false : params[:layout]
|
44
41
|
}
|
45
42
|
format.rss {
|
46
43
|
if @page.contains_feed?
|
@@ -1,3 +1,38 @@
|
|
1
1
|
module Admin::PagesHelper
|
2
2
|
|
3
|
-
|
3
|
+
def tinymce_javascript_tags
|
4
|
+
init = Alchemy::Tinymce.init
|
5
|
+
if init.is_a?(Hash)
|
6
|
+
init = HashWithIndifferentAccess.new(init)
|
7
|
+
init = init.keys.sort.collect(&:to_s).sort.collect do |key|
|
8
|
+
[key, init[key]]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
init = init.collect { |key, value| "#{key} : #{value.to_json}" }.join(', ')
|
12
|
+
|
13
|
+
setup = "init.setup = #{Alchemy::Tinymce.setup};" if Alchemy::Tinymce.setup
|
14
|
+
return "
|
15
|
+
<script src='/assets/tiny_mce/jquery.tinymce.js' type='text/javascript'></script>
|
16
|
+
<script type='text/javascript'>
|
17
|
+
jQuery(function($){
|
18
|
+
if (typeof(Alchemy) !== 'object') { Alchemy = {}; };
|
19
|
+
Alchemy.Tinymce = {
|
20
|
+
init : function() {
|
21
|
+
var init = { #{init} };
|
22
|
+
init.script_url = '/assets/tiny_mce/tiny_mce.js';
|
23
|
+
init.plugins = '#{Alchemy::Tinymce.plugins.join(',')}';
|
24
|
+
init.language = '#{I18n.locale}';
|
25
|
+
#{setup}
|
26
|
+
$('textarea.tinymce').tinymce(init);
|
27
|
+
},
|
28
|
+
addEditor : function(dom_id) {
|
29
|
+
tinyMCE.execCommand('mceAddControl', true, dom_id);
|
30
|
+
}
|
31
|
+
};
|
32
|
+
console.log('hello', Alchemy.Tinymce);
|
33
|
+
Alchemy.Tinymce.init();
|
34
|
+
});
|
35
|
+
</script>".html_safe
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -258,23 +258,36 @@ module AlchemyHelper
|
|
258
258
|
end
|
259
259
|
end
|
260
260
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
261
|
+
# Helper for including all nescessary javascripts and stylesheets.
|
262
|
+
# Under Rails 3.1 it uses the asset pipeline.
|
263
|
+
# Under Rails 3.0.x we use caching to combine the files into one big asset file.
|
264
|
+
def alchemy_assets_set
|
265
|
+
asset_sets = YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'config/asset_packages.yml'))
|
266
|
+
if Rails.version >= '3.1'
|
267
|
+
content_for(:javascript_includes) do
|
268
|
+
javascript_include_tag('alchemy/alchemy')
|
269
|
+
end
|
270
|
+
content_for(:stylesheets) do
|
271
|
+
stylesheet_link_tag('alchemy/alchemy', :media => 'screen')
|
272
|
+
end
|
273
|
+
content_for(:stylesheets) do
|
274
|
+
stylesheet_link_tag('alchemy/print', :media => 'print')
|
275
|
+
end
|
276
|
+
else
|
277
|
+
content_for(:javascript_includes) do
|
278
|
+
js_set = asset_sets['javascripts'].detect { |js| js[setname.to_s] }[setname.to_s]
|
279
|
+
javascript_include_tag(js_set, :cache => 'alchemy/' + setname.to_s)
|
280
|
+
end
|
281
|
+
css_set = asset_sets['stylesheets'].detect { |css| css[setname.to_s] }[setname.to_s]
|
282
|
+
content_for(:stylesheets) do
|
283
|
+
stylesheet_link_tag(css_set, :cache => 'alchemy/' + setname.to_s, :media => 'screen')
|
284
|
+
end
|
285
|
+
content_for(:stylesheets) do
|
286
|
+
print_set = css_set.clone << 'alchemy/print'
|
287
|
+
stylesheet_link_tag(print_set, :cache => 'alchemy/' + setname.to_s + '-print', :media => 'print')
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|
278
291
|
|
279
292
|
def parse_sitemap_name(page)
|
280
293
|
if multi_language?
|
@@ -354,4 +367,13 @@ module AlchemyHelper
|
|
354
367
|
)
|
355
368
|
end
|
356
369
|
|
370
|
+
# Taken from tinymce_hammer plugin
|
371
|
+
def append_class_name options, class_name #:nodoc:
|
372
|
+
key = options.has_key?('class') ? 'class' : :class
|
373
|
+
unless options[key].to_s =~ /(^|\s+)#{class_name}(\s+|$)/
|
374
|
+
options[key] = "#{options[key]} #{class_name}".strip
|
375
|
+
end
|
376
|
+
options
|
377
|
+
end
|
378
|
+
|
357
379
|
end
|
data/app/models/attachment.rb
CHANGED
data/app/models/essence_file.rb
CHANGED
@@ -10,7 +10,7 @@ class EssenceFile < ActiveRecord::Base
|
|
10
10
|
# Saves the ingredient
|
11
11
|
def save_ingredient(params, options = {})
|
12
12
|
return true if params.blank?
|
13
|
-
self.attachment_id = params["
|
13
|
+
self.attachment_id = params["attachment_id"].to_s
|
14
14
|
self.save
|
15
15
|
end
|
16
16
|
|
data/app/models/page.rb
CHANGED
@@ -34,4 +34,14 @@ private
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def expire_page(page)
|
38
|
+
return if page.do_not_sweep
|
39
|
+
expire_action(
|
40
|
+
:controller => '/pages',
|
41
|
+
:action => :show,
|
42
|
+
:urlname => page.urlname_was,
|
43
|
+
:lang => multi_language? ? page.language_code : nil
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
37
47
|
end
|
@@ -1,21 +1,14 @@
|
|
1
1
|
(function($) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Alchemy.growl('<%= escape_javascript(_("item %{name} copied to clipboard") % {:name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name}) -%>')
|
16
|
-
|
17
|
-
<% end %>
|
18
|
-
|
19
|
-
$('#clipboard_button .icon.clipboard').addClass('full');
|
20
|
-
|
2
|
+
|
3
|
+
<%- if params[:remove] -%>
|
4
|
+
$("#<%= @item.class.to_s.downcase -%>_<%= @item.id -%>").remove();
|
5
|
+
<%- if @item.class.to_s == 'Element' -%>
|
6
|
+
$('#element_area').sortable('refresh');
|
7
|
+
<%- end -%>
|
8
|
+
Alchemy.growl('<%= _("item %{name} moved to clipboard") % {:name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name} -%>');
|
9
|
+
<%- else -%>
|
10
|
+
Alchemy.growl('<%= _("item %{name} copied to clipboard") % {:name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name} -%>')
|
11
|
+
<%- end -%>
|
12
|
+
$('#clipboard_button .icon.clipboard').addClass('full');
|
13
|
+
|
21
14
|
})(jQuery);
|
@@ -4,8 +4,10 @@
|
|
4
4
|
<%= form_for(
|
5
5
|
[:admin, element],
|
6
6
|
:remote => true,
|
7
|
-
:
|
8
|
-
|
7
|
+
:html => {
|
8
|
+
:onsubmit => "Alchemy.saveElement(this)",
|
9
|
+
:id => "element_#{element.id}_form"
|
10
|
+
}
|
9
11
|
) do %>
|
10
12
|
<div id="element_<%= element.id %>_errors" class="element_errors" style="display: none"></div>
|
11
13
|
<div id="element_<%= element.id %>_content" class="element_content">
|
@@ -1,31 +1,24 @@
|
|
1
1
|
(function($) {
|
2
|
+
|
3
|
+
<%- if @page.can_have_cells? -%>
|
4
|
+
Alchemy.selectOrCreateCellTab('<%= @cell.nil? ? "for_other_elements" : @cell.name -%>', '<%= @cell.nil? ? _("other Elements") : @cell.name_for_label -%>');
|
5
|
+
<%- end -%>
|
6
|
+
$('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').append('<%= escape_javascript render(:partial => "element", :object => @element, :locals => {:draggable => true}) -%>');
|
7
|
+
$('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').sortable('refresh');
|
8
|
+
Alchemy.growl('<%= _("successfully_added_element") -%>');
|
9
|
+
Alchemy.closeCurrentWindow();
|
10
|
+
<%- @element.rtf_contents.each do |content| -%>
|
11
|
+
Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
|
12
|
+
<%- end -%>
|
13
|
+
Alchemy.PreviewWindow.refresh();
|
14
|
+
Alchemy.ElementEditorSelector.init();
|
15
|
+
$('.element_editor[data-element-id="<%= @element.id -%>"]').trigger('Alchemy.SelectElementEditor');
|
16
|
+
Alchemy.ElementDirtyObserver('#element_<%= @element.id -%>');
|
17
|
+
Alchemy.SelectBox('#element_<%= @element.id -%> select');
|
18
|
+
Alchemy.ButtonObserver('#element_<%= @element.id -%> button.button');
|
2
19
|
|
3
|
-
|
4
|
-
|
5
|
-
<% end %>
|
6
|
-
|
7
|
-
<%- if @page.can_have_cells? -%>
|
8
|
-
Alchemy.selectOrCreateCellTab('<%= @cell.nil? ? "for_other_elements" : @cell.name -%>', '<%= @cell.nil? ? _("other Elements") : @cell.name_for_label -%>');
|
9
|
-
<%- end -%>
|
10
|
-
|
11
|
-
$('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').append('<%= escape_javascript render(:partial => "element", :object => @element, :locals => {:draggable => true}) -%>');
|
12
|
-
$('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').sortable('refresh');
|
13
|
-
Alchemy.growl('<%= _("successfully_added_element") -%>');
|
14
|
-
Alchemy.closeCurrentWindow();
|
15
|
-
|
16
|
-
<%- @element.rtf_contents.each do |content| -%>
|
17
|
-
TinymceHammer.addEditor('<%= content.form_field_id -%>');
|
18
|
-
<%- end -%>
|
19
|
-
|
20
|
-
Alchemy.PreviewWindow.refresh();
|
21
|
-
Alchemy.ElementEditorSelector.init();
|
22
|
-
$('.element_editor[data-element-id="<%= @element.id -%>"]').trigger('Alchemy.SelectElementEditor');
|
23
|
-
Alchemy.ElementDirtyObserver('#element_<%= @element.id -%>');
|
24
|
-
Alchemy.SelectBox('#element_<%= @element.id -%> select');
|
25
|
-
Alchemy.ButtonObserver('#element_<%= @element.id -%> button.button');
|
26
|
-
|
27
|
-
<%- if @clipboard.blank? -%>
|
28
|
-
$('#clipboard_button .icon.clipboard').removeClass('full');
|
20
|
+
<%- if @clipboard.blank? -%>
|
21
|
+
$('#clipboard_button .icon.clipboard').removeClass('full');
|
29
22
|
<%- end -%>
|
30
23
|
|
31
24
|
})(jQuery);
|
@@ -28,7 +28,7 @@
|
|
28
28
|
Alchemy.SelectBox('#element_<%= @element.id -%> select');
|
29
29
|
|
30
30
|
<%- @element.rtf_contents.each do |content| -%>
|
31
|
-
|
31
|
+
Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
|
32
32
|
<%- end -%>
|
33
33
|
|
34
34
|
Alchemy.ElementDirtyObserver('#element_<%= @element.id -%>');
|
@@ -26,7 +26,7 @@
|
|
26
26
|
Alchemy.SortableElements(<%= @page.id %>, '<%= form_authenticity_token %>');
|
27
27
|
Alchemy.ElementEditorSelector.init();
|
28
28
|
Alchemy.SelectBox('.element_editor select');
|
29
|
-
|
29
|
+
Alchemy.Tinymce.init();
|
30
30
|
Alchemy.ElementDirtyObserver('#element_area');
|
31
31
|
jQuery('#cells').tabs();
|
32
32
|
jQuery('#cells').tabs('paging', { follow: true, followOnSelect: true } );
|
@@ -0,0 +1,8 @@
|
|
1
|
+
(function($) {
|
2
|
+
|
3
|
+
$('#<%= content_dom_id(@content) %>').replaceWith('<%= escape_javascript(render(:partial => "essences/essence_file_editor.html.erb", :locals => {:content => @content, :options => @options})) %>');
|
4
|
+
Alchemy.closeCurrentWindow();
|
5
|
+
Alchemy.reloadPreview();
|
6
|
+
Alchemy.setElementDirty('#element_<%= @content.element.id %>');
|
7
|
+
|
8
|
+
})(jQuery);
|
@@ -61,32 +61,42 @@
|
|
61
61
|
<div id="sideboard">
|
62
62
|
<%= image_tag("alchemy/alchemy-logo.png") %>
|
63
63
|
<p><%= _("Version") %>: <%= @alchemy_version %></p>
|
64
|
-
<
|
65
|
-
|
66
|
-
<
|
67
|
-
<
|
68
|
-
|
69
|
-
|
70
|
-
<
|
71
|
-
|
72
|
-
|
73
|
-
<
|
74
|
-
|
75
|
-
|
76
|
-
<
|
77
|
-
|
78
|
-
|
79
|
-
<
|
80
|
-
|
81
|
-
|
82
|
-
<
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
_('Read the License'),
|
88
|
-
"Alchemy.openLicencseWindow()"
|
89
|
-
) %>
|
90
|
-
</h2>
|
64
|
+
<div class="sideboard_body" style="display: none">
|
65
|
+
<p><%= _('Alchemy is open software and itself uses open software and free resources:') %></p>
|
66
|
+
<ul>
|
67
|
+
<li>
|
68
|
+
<a href="http://rubyonrails.org" target="_blank">RubyOnRails</a>
|
69
|
+
</li>
|
70
|
+
<li>
|
71
|
+
<a href="http://jquery.com" target="_blank">jQuery Javascript Library</a>
|
72
|
+
</li>
|
73
|
+
<li>
|
74
|
+
<a href="http://jqueryui.com" target="_blank">jQuery UI Javascript GUI Library</a>
|
75
|
+
</li>
|
76
|
+
<li>
|
77
|
+
<a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE - Javascript WYSIWYG Editor</a>
|
78
|
+
</li>
|
79
|
+
<li>
|
80
|
+
<a href="http://swfupload.org" target="_blank">SWFUpload</a>
|
81
|
+
</li>
|
82
|
+
<li>
|
83
|
+
<a href="http://p.yusukekamiyamane.com" target="_blank">Fugue Icons by Yusuke Kamiyamane</a>
|
84
|
+
</li>
|
85
|
+
</ul>
|
86
|
+
</div>
|
91
87
|
</div>
|
92
88
|
</div>
|
89
|
+
<%= content_for :javascripts do %>
|
90
|
+
<script type="text/javascript" charset="utf-8">
|
91
|
+
(function($) {
|
92
|
+
|
93
|
+
$('#sideboard img:first-child').click(function(e) {
|
94
|
+
e.preventDefault();
|
95
|
+
$('#sideboard .sideboard_body').toggle();
|
96
|
+
}).bind('mouseover', function() {
|
97
|
+
$(this).css({cursor: 'pointer'});
|
98
|
+
});
|
99
|
+
|
100
|
+
})(jQuery);
|
101
|
+
</script>
|
102
|
+
<% end %>
|