forgeos_cms 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +2 -0
- data/README.textile +42 -0
- data/app/assets/images/forgeos/admin/favicon.gif +0 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/carousels.js +56 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/menus.js +93 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/overlay.js +86 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/trees.js +8 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/widget_actualities.js +117 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/carousels.js +131 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/menus.js +294 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/overlays.js +71 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/trees.js +94 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/widget_actualities.js +23 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/widget_faq.js +13 -0
- data/app/assets/stylesheets/forgeos/admin/base.css.sass +2 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_all.css.sass +1 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_blocks.css.sass +220 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/check-checked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/check-unchecked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/dark-blue-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/dark-blue-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/folder.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/style.css.sass +219 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/throbber.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/brown-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/brown-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/style.css.sass +138 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/throbber.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/big-drag-and-drop.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/check-checked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/check-unchecked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/dark-blue-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/dark-blue-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/drag-drop.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/folder.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/style.css.sass +186 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/throbber.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/brown-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/brown-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/style.css.sass +138 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/throbber.gif +0 -0
- data/app/controllers/actualities_controller.rb +11 -0
- data/app/controllers/admin/actualities_controller.rb +100 -0
- data/app/controllers/admin/base_controller.rb +11 -0
- data/app/controllers/admin/carousels_controller.rb +101 -0
- data/app/controllers/admin/import_controller.rb +20 -0
- data/app/controllers/admin/menus_controller.rb +104 -0
- data/app/controllers/admin/newsletters_controller.rb +110 -0
- data/app/controllers/admin/pages_controller.rb +169 -0
- data/app/controllers/admin/static_content_blocks_controller.rb +174 -0
- data/app/controllers/admin/statistics_controller.rb +29 -0
- data/app/controllers/admin/widget_actualities_controller.rb +101 -0
- data/app/controllers/admin/widget_faqs_controller.rb +71 -0
- data/app/controllers/admin/widgets_controller.rb +83 -0
- data/app/controllers/forgeos/application_controller.rb +21 -0
- data/app/controllers/newsletters_controller.rb +11 -0
- data/app/controllers/pages_controller.rb +24 -0
- data/app/controllers/search_controller.rb +7 -0
- data/app/helpers/application_helper.rb +43 -0
- data/app/helpers/menu_helper.rb +46 -0
- data/app/helpers/routes_helper.rb +19 -0
- data/app/models/actuality.rb +21 -0
- data/app/models/block.rb +65 -0
- data/app/models/block_category.rb +7 -0
- data/app/models/carousel.rb +14 -0
- data/app/models/carousel_item.rb +12 -0
- data/app/models/category_link.rb +2 -0
- data/app/models/comment.rb +6 -0
- data/app/models/external_link.rb +5 -0
- data/app/models/faq.rb +10 -0
- data/app/models/link_page.rb +2 -0
- data/app/models/menu.rb +30 -0
- data/app/models/menu_category.rb +7 -0
- data/app/models/menu_link.rb +57 -0
- data/app/models/newsletter.rb +5 -0
- data/app/models/page.rb +85 -0
- data/app/models/page_category.rb +11 -0
- data/app/models/page_col.rb +14 -0
- data/app/models/page_link.rb +17 -0
- data/app/models/page_sweeper.rb +54 -0
- data/app/models/static_content_block.rb +2 -0
- data/app/models/static_content_category.rb +2 -0
- data/app/models/widget.rb +2 -0
- data/app/models/widget_actuality.rb +19 -0
- data/app/models/widget_category.rb +2 -0
- data/app/models/widget_faq.rb +12 -0
- data/app/views/actualities/rss.rxml +20 -0
- data/app/views/admin/actualities/_form.html.haml +38 -0
- data/app/views/admin/actualities/_tabs.html.haml +5 -0
- data/app/views/admin/actualities/edit.html.haml +3 -0
- data/app/views/admin/actualities/index.html.haml +10 -0
- data/app/views/admin/actualities/index.json.erb +34 -0
- data/app/views/admin/actualities/new.html.haml +3 -0
- data/app/views/admin/blocks/_associated_pages.html.haml +33 -0
- data/app/views/admin/blocks/_tabs.html.haml +8 -0
- data/app/views/admin/carousels/_attachments_popups.html.haml +81 -0
- data/app/views/admin/carousels/_form.html.haml +95 -0
- data/app/views/admin/carousels/_form_item.html.haml +54 -0
- data/app/views/admin/carousels/_item.html.haml +25 -0
- data/app/views/admin/carousels/edit.html.haml +1 -0
- data/app/views/admin/carousels/new.html.haml +1 -0
- data/app/views/admin/carousels/show.html.haml +40 -0
- data/app/views/admin/categories/_block.html.haml +4 -0
- data/app/views/admin/categories/_list_blocks.html.haml +13 -0
- data/app/views/admin/categories/_list_pages.html.haml +13 -0
- data/app/views/admin/categories/_page.html.haml +2 -0
- data/app/views/admin/dashboard/index.html.haml +19 -0
- data/app/views/admin/menu_links/_show.html.haml +8 -0
- data/app/views/admin/menus/_empty_menu_link.html.haml +45 -0
- data/app/views/admin/menus/_form.html.haml +27 -0
- data/app/views/admin/menus/_form_menu_links.html.haml +60 -0
- data/app/views/admin/menus/_lang_switcher.html.haml +2 -0
- data/app/views/admin/menus/_tabs.html.haml +5 -0
- data/app/views/admin/menus/_types_popups.html.haml +21 -0
- data/app/views/admin/menus/edit.html.haml +1 -0
- data/app/views/admin/menus/index.html.haml +13 -0
- data/app/views/admin/menus/index.json.erb +31 -0
- data/app/views/admin/menus/new.html.haml +1 -0
- data/app/views/admin/menus/show.html.haml +22 -0
- data/app/views/admin/newsletters/_form.html.haml +19 -0
- data/app/views/admin/newsletters/_tabs.html.haml +3 -0
- data/app/views/admin/newsletters/edit.html.haml +2 -0
- data/app/views/admin/newsletters/index.html.haml +14 -0
- data/app/views/admin/newsletters/index.json.erb +22 -0
- data/app/views/admin/newsletters/new.html.haml +2 -0
- data/app/views/admin/pages/_block_popup.html.haml +18 -0
- data/app/views/admin/pages/_blocks.html.haml +29 -0
- data/app/views/admin/pages/_codes.html.haml +33 -0
- data/app/views/admin/pages/_form.html.haml +15 -0
- data/app/views/admin/pages/_general.html.haml +64 -0
- data/app/views/admin/pages/_seo.html.haml +31 -0
- data/app/views/admin/pages/_tabs.html.haml +5 -0
- data/app/views/admin/pages/_tabs_show.html.haml +9 -0
- data/app/views/admin/pages/edit.html.haml +1 -0
- data/app/views/admin/pages/index.html.haml +13 -0
- data/app/views/admin/pages/index.json.erb +37 -0
- data/app/views/admin/pages/new.html.haml +2 -0
- data/app/views/admin/pages/show.html.haml +100 -0
- data/app/views/admin/static_content_blocks/_form.html.haml +41 -0
- data/app/views/admin/static_content_blocks/edit.html.haml +1 -0
- data/app/views/admin/static_content_blocks/index.html.haml +16 -0
- data/app/views/admin/static_content_blocks/index.json.erb +28 -0
- data/app/views/admin/static_content_blocks/new.html.haml +1 -0
- data/app/views/admin/static_content_blocks/show.html.haml +23 -0
- data/app/views/admin/statistics/index.html.haml +57 -0
- data/app/views/admin/users/_tabs.html.haml +3 -0
- data/app/views/admin/widget_actualities/_form.html.haml +87 -0
- data/app/views/admin/widget_actualities/_form_item.html.haml +28 -0
- data/app/views/admin/widget_actualities/_item.html.haml +11 -0
- data/app/views/admin/widget_actualities/_tabs.html.haml +8 -0
- data/app/views/admin/widget_actualities/edit.html.haml +2 -0
- data/app/views/admin/widget_actualities/new.html.haml +2 -0
- data/app/views/admin/widget_actualities/show.html.haml +39 -0
- data/app/views/admin/widget_faqs/_form.html.haml +68 -0
- data/app/views/admin/widget_faqs/_tabs.html.haml +8 -0
- data/app/views/admin/widget_faqs/edit.html.haml +2 -0
- data/app/views/admin/widget_faqs/new.html.haml +2 -0
- data/app/views/admin/widgets/_tabs.html.haml +8 -0
- data/app/views/admin/widgets/index.html.haml +28 -0
- data/app/views/admin/widgets/index.json.erb +27 -0
- data/app/views/layouts/admin/_menu.html.haml +0 -0
- data/app/views/layouts/application.html.haml +21 -0
- data/app/views/pages/_linked_pages.html.haml +4 -0
- data/app/views/pages/_page.html.haml +15 -0
- data/app/views/pages/show.html.haml +9 -0
- data/app/views/search/index.html.haml +8 -0
- data/config/locales/activerecord/en.yml +48 -0
- data/config/locales/activerecord/fr.yml +77 -0
- data/config/locales/admin/actuality/en.yml +30 -0
- data/config/locales/admin/actuality/fr.yml +30 -0
- data/config/locales/admin/block/en.yml +38 -0
- data/config/locales/admin/block/fr.yml +38 -0
- data/config/locales/admin/carousel/en.yml +24 -0
- data/config/locales/admin/carousel/fr.yml +24 -0
- data/config/locales/admin/menu/en.yml +33 -0
- data/config/locales/admin/menu/fr.yml +38 -0
- data/config/locales/admin/newsletter/en.yml +30 -0
- data/config/locales/admin/newsletter/fr.yml +30 -0
- data/config/locales/admin/page/en.yml +77 -0
- data/config/locales/admin/page/fr.yml +77 -0
- data/config/locales/admin/section/en.yml +23 -0
- data/config/locales/admin/section/fr.yml +23 -0
- data/config/locales/admin/static_content_block/en.yml +43 -0
- data/config/locales/admin/static_content_block/fr.yml +42 -0
- data/config/locales/admin/widget/en.yml +34 -0
- data/config/locales/admin/widget/fr.yml +34 -0
- data/config/locales/admin/widget_actuality/en.yml +23 -0
- data/config/locales/admin/widget_actuality/fr.yml +23 -0
- data/config/locales/admin/widget_faq/en.yml +22 -0
- data/config/locales/admin/widget_faq/fr.yml +30 -0
- data/config/locales/common/en.yml +208 -0
- data/config/locales/common/fr.yml +209 -0
- data/config/routes.rb +73 -0
- data/db/fixtures/menu_link_translations.yml +5 -0
- data/db/fixtures/menu_links.yml +5 -0
- data/db/fixtures/menus.yml +3 -0
- data/db/fixtures/page_translations.yml +19 -0
- data/db/fixtures/pages.yml +5 -0
- data/db/fixtures/people.yml +11 -0
- data/db/migrate/20091009134405_create_actualities.rb +18 -0
- data/db/migrate/20091009134503_create_blocks.rb +15 -0
- data/db/migrate/20091009134510_create_blocks_pages.rb +13 -0
- data/db/migrate/20091009134518_create_carousel_items.rb +17 -0
- data/db/migrate/20091009134729_create_pages.rb +18 -0
- data/db/migrate/20091009134736_create_pages_links.rb +12 -0
- data/db/migrate/20091027153116_create_menus.rb +14 -0
- data/db/migrate/20091027153659_create_menu_links.rb +19 -0
- data/db/migrate/20091208113459_create_page_translations.rb +9 -0
- data/db/migrate/20091208113460_create_block_translations.rb +9 -0
- data/db/migrate/20091208113461_create_menu_link_translations.rb +9 -0
- data/db/migrate/20091208170256_remove_translations_to_page.rb +10 -0
- data/db/migrate/20091208170257_remove_translations_to_block.rb +9 -0
- data/db/migrate/20091208170258_remove_translations_to_menu_link.rb +9 -0
- data/db/migrate/20100203102853_add_actuality_translations.rb +9 -0
- data/db/migrate/20100203102914_add_carousel_item_translations.rb +9 -0
- data/db/migrate/20100203125804_remove_translated_columns_to_actualities.rb +9 -0
- data/db/migrate/20100203125820_remove_translated_columns_to_carousel_items.rb +10 -0
- data/db/migrate/20100405095844_create_page_cols_table.rb +12 -0
- data/db/migrate/20100405101416_create_blocks_page_cols.rb +13 -0
- data/db/migrate/20100407093551_create_table_translation_for_page_cols.rb +13 -0
- data/db/migrate/20100413134832_add_index_on_menu_links.rb +11 -0
- data/db/migrate/20100501150819_add_code_to_pages.rb +13 -0
- data/db/migrate/20100511161012_create_faqs.rb +13 -0
- data/db/migrate/20100526163534_add_popup_to_menu_link.rb +9 -0
- data/db/migrate/20100929183346_change_answer_type.rb +9 -0
- data/db/migrate/20101015095242_update_actualities.rb +11 -0
- data/db/migrate/20101216155044_create_newsletter.rb +12 -0
- data/db/migrate/20110310092311_add_indexes_to_menu.rb +9 -0
- data/db/migrate/20110408133955_add_summary_to_menu_link_translations.rb +7 -0
- data/lib/forgeos/admin_menu.rb +14 -0
- data/lib/forgeos/cms.rb +8 -0
- data/lib/forgeos/cms/engine.rb +8 -0
- data/lib/forgeos/cms/statistics.rb +16 -0
- data/lib/forgeos_cms.rb +3 -0
- data/lib/tasks/install.rake +9 -0
- data/lib/tasks/upgrade.rake +22 -0
- data/recipes/deploy.rb +14 -0
- metadata +375 -0
data/LICENSE
ADDED
data/README.textile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
h1. ForgeosCMS
|
2
|
+
|
3
|
+
ForgeosCMS is an extension of Ruby on Rails for CMS development
|
4
|
+
|
5
|
+
VERSION : 0.9.6
|
6
|
+
|
7
|
+
h1. Prerequisites
|
8
|
+
|
9
|
+
h2. Plugins
|
10
|
+
|
11
|
+
* ForgeosCore
|
12
|
+
|
13
|
+
h2. Initialize
|
14
|
+
|
15
|
+
<pre><code>
|
16
|
+
$ ./script/generate plugin_migration forgeos_cms
|
17
|
+
$ rake forgeos:cms:install
|
18
|
+
</code></pre>
|
19
|
+
|
20
|
+
h2. Update routes.rb
|
21
|
+
|
22
|
+
Add at the end of your routes :
|
23
|
+
<pre><code>
|
24
|
+
map.connect ':controller/:action/:id'
|
25
|
+
map.connect ':controller/:action/:id.:format'
|
26
|
+
map.page '*url', :controller => 'pages', :action => 'show'
|
27
|
+
</code></pre>
|
28
|
+
|
29
|
+
h1. Default settings
|
30
|
+
|
31
|
+
h2. Admin
|
32
|
+
|
33
|
+
URL: /admin
|
34
|
+
Login: admin@cms.forgeos.com
|
35
|
+
Password: admin
|
36
|
+
|
37
|
+
h2. Pages
|
38
|
+
|
39
|
+
* HomePage
|
40
|
+
* 404 page
|
41
|
+
|
42
|
+
Powered by "Webpulser":http://www.webpulser.com
|
Binary file
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/* --- CAROUSEL --- */
|
2
|
+
|
3
|
+
// copy carousel item div from empty carousel item and set new id
|
4
|
+
function add_new_carousel_item(){
|
5
|
+
var new_item = '<div id="item_' + false_id + '" class="block-container widget-modify carousel">';
|
6
|
+
new_item += jQuery('#empty_carousel_item').html().replace(/EMPTY_ID/g, false_id);
|
7
|
+
new_item += '</div>';
|
8
|
+
|
9
|
+
false_id--;
|
10
|
+
jQuery('#carousel_items').append(new_item);
|
11
|
+
update_block_container_positions(jQuery('#carousel_items'));
|
12
|
+
}
|
13
|
+
|
14
|
+
// clone content from div to form and then submit the form
|
15
|
+
function update_carousel_item(display_div, edition_div){
|
16
|
+
var form = jQuery('#hidden_form');
|
17
|
+
var url = jQuery(form).attr('action');
|
18
|
+
var div = jQuery(form).find('.item_form');
|
19
|
+
|
20
|
+
div.append(edition_div.html());
|
21
|
+
|
22
|
+
// copy value of each input/textarea
|
23
|
+
edition_div.find('input, textarea, select').each(function(){
|
24
|
+
var div_input = div.find('#' + jQuery(this).attr('id'));
|
25
|
+
div_input.val(jQuery(this).val());
|
26
|
+
});
|
27
|
+
|
28
|
+
// post carousel item data
|
29
|
+
jQuery.ajax({
|
30
|
+
url: url,
|
31
|
+
data: jQuery(form).serialize(),
|
32
|
+
success:function(request){
|
33
|
+
// close edition mode
|
34
|
+
jQuery(display_div).find('.edit-link').trigger('click');
|
35
|
+
},
|
36
|
+
type:'post'
|
37
|
+
});
|
38
|
+
|
39
|
+
// empty item form
|
40
|
+
div.html('');
|
41
|
+
}
|
42
|
+
|
43
|
+
// hide carousel item container and set item delete value to 1
|
44
|
+
function remove_carousel_item(destroy_link){
|
45
|
+
var block = jQuery(destroy_link).parents('.block-container');
|
46
|
+
jQuery(block).hide();
|
47
|
+
jQuery(block).find('.delete').val(1);
|
48
|
+
update_block_container_positions(jQuery('#carousel_items'));
|
49
|
+
}
|
50
|
+
|
51
|
+
function add_picture_to_carousel_item(link,path,id,name){
|
52
|
+
var image = jQuery(link).prevAll('img');
|
53
|
+
image.attr('src', path);
|
54
|
+
image.attr('alt', name);
|
55
|
+
jQuery(link).prevAll('input').attr('value', id);
|
56
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
function toggle_menu_types_overlays(id){
|
2
|
+
var overlay_to_turn_off = (id == 'target-link') ? '#external-link' : '#target-link';
|
3
|
+
var overlay_to_turn_on = (id == 'target-link') ? '#target-link' : '#external-link';
|
4
|
+
|
5
|
+
if (jQuery(overlay_to_turn_off).is(':visible'))
|
6
|
+
jQuery(overlay_to_turn_off).hide();
|
7
|
+
jQuery(overlay_to_turn_on).show();
|
8
|
+
}
|
9
|
+
|
10
|
+
function update_menu_link(title, link_span, link, url, link_type, target_id, target_type, data){
|
11
|
+
// update link
|
12
|
+
if (title.val() == '')
|
13
|
+
title.val(data.title);
|
14
|
+
link_span.addClass(data.type);
|
15
|
+
link.html(data.link_name);
|
16
|
+
link.attr('href', data.link_url);
|
17
|
+
|
18
|
+
// update hidden fields
|
19
|
+
url.val(data.hidden_url);
|
20
|
+
link_type.val(data.hidden_type);
|
21
|
+
target_id.val(data.hidden_target_id);
|
22
|
+
target_type.val(data.hidden_target_type);
|
23
|
+
}
|
24
|
+
|
25
|
+
function update_menu_span_icon(base_span, span_to_update){
|
26
|
+
span_to_update.removeClass('external page product category');
|
27
|
+
if (base_span.hasClass('external'))
|
28
|
+
span_to_update.addClass('external');
|
29
|
+
else if (base_span.hasClass('page'))
|
30
|
+
span_to_update.addClass('page');
|
31
|
+
else if (base_span.hasClass('product'))
|
32
|
+
span_to_update.addClass('product');
|
33
|
+
else if (base_span.hasClass('category'))
|
34
|
+
span_to_update.addClass('category');
|
35
|
+
}
|
36
|
+
|
37
|
+
// mode is either 'open' or 'closed'
|
38
|
+
function toggle_menu_link(menu_link, mode){
|
39
|
+
var folder = (mode == ('closed')) ? 'file' : 'folder';
|
40
|
+
|
41
|
+
if (!menu_link.hasClass(mode)){
|
42
|
+
menu_link.toggleClass('closed');
|
43
|
+
menu_link.toggleClass('open');
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!menu_link.hasClass(folder)){
|
47
|
+
menu_link.toggleClass('file');
|
48
|
+
menu_link.toggleClass('folder');
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// update position for each child of the list and for their children
|
53
|
+
function update_menu_positions(list){
|
54
|
+
jQuery(list).children('li').each(function(){
|
55
|
+
var index = jQuery(this).parent().children('li').index(this);
|
56
|
+
var position = jQuery(this).find('.menu_link:first').find('input:regex(id,.+_position)');
|
57
|
+
var child_list = jQuery(this).children('ul:first');
|
58
|
+
|
59
|
+
position.val(index);
|
60
|
+
|
61
|
+
// update those of its children
|
62
|
+
if (child_list.length > 0)
|
63
|
+
update_menu_positions(child_list);
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
// update name, id and parent_id for each child of the list and for their children
|
68
|
+
function update_menu_names_and_ids(list, base_name, base_id){
|
69
|
+
jQuery(list).children('li').each(function(){
|
70
|
+
var index = jQuery(this).parent().children('li').index(this);
|
71
|
+
var name = base_name + '[' + index + ']';
|
72
|
+
var id = base_id + index;
|
73
|
+
|
74
|
+
var parent_id = jQuery(this).parents('li:first').find('input:regex(id,.+_id)')[0];
|
75
|
+
var input_parent_id = jQuery(this).find('.menu_link:first').find('input:regex(id,.+_parent_id)');
|
76
|
+
var input_menu_id = jQuery(this).find('.menu_link:first').find('input:regex(id,.+_menu_id)');
|
77
|
+
|
78
|
+
var child_list = jQuery(this).children('ul:first');
|
79
|
+
|
80
|
+
// update parent_id
|
81
|
+
if (parent_id){
|
82
|
+
input_parent_id.val(jQuery(parent_id).val());
|
83
|
+
input_menu_id.val('');
|
84
|
+
}else{
|
85
|
+
input_parent_id.val('');
|
86
|
+
input_menu_id.val(get_id_from_rails_url());
|
87
|
+
}
|
88
|
+
|
89
|
+
// update those of its children
|
90
|
+
if (child_list.length > 0)
|
91
|
+
update_menu_names_and_ids(child_list, name + '[children_attributes]', id + '_children_attributes_');
|
92
|
+
});
|
93
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
//open widget/blocks tree's dialog box
|
2
|
+
function openBlockDialog(element, container){
|
3
|
+
removeClasses();
|
4
|
+
addBlockClasses();
|
5
|
+
if(container != null){
|
6
|
+
container.addClass('selectedPageCol');
|
7
|
+
}
|
8
|
+
jQuery('.lightbox-container').dialog('open');
|
9
|
+
if(element.hasClass('static-content')){
|
10
|
+
toggleHoverlayTrees('static-tab');
|
11
|
+
}
|
12
|
+
else if(element.hasClass('widget-content')){
|
13
|
+
toggleHoverlayTrees('widget-tab')
|
14
|
+
}
|
15
|
+
return false;
|
16
|
+
}
|
17
|
+
|
18
|
+
//open pages tree's dialog box
|
19
|
+
function openPageDialog(element){
|
20
|
+
var block_id = get_rails_element_id(element);
|
21
|
+
// changes all href to page block link url
|
22
|
+
jQuery('.lightbox-container .small-icons.page').each(function(){
|
23
|
+
var page_id = get_rails_element_id(this);
|
24
|
+
jQuery(this).attr('href', '/admin/pages/' + page_id + '/blocks/' + block_id + '/link');
|
25
|
+
});
|
26
|
+
|
27
|
+
removeClasses();
|
28
|
+
addPageClasses(block_id);
|
29
|
+
jQuery('.lightbox-container').dialog('open');
|
30
|
+
return false;
|
31
|
+
}
|
32
|
+
|
33
|
+
//Switch widget/blocks tree in dialog box
|
34
|
+
function toggleHoverlayTrees(elementname){
|
35
|
+
if(!jQuery('.'+elementname).hasClass('selected')){
|
36
|
+
jQuery('.'+elementname).addClass('selected');
|
37
|
+
jQuery('.'+elementname).siblings().removeClass('selected');
|
38
|
+
jQuery('#widgets, #blocks').toggleClass('hidden');
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
//the selected block/widget in dialog box, is put in block/widget list
|
43
|
+
function putInBlockList(type, name, id){
|
44
|
+
var content = '';
|
45
|
+
if(jQuery('.selectedPageCol').length > 0){
|
46
|
+
firstInput = jQuery('.selectedPageCol input')[0];
|
47
|
+
content = '\
|
48
|
+
<div class="block-container">\n\
|
49
|
+
<span class="block-type">\n\
|
50
|
+
<span class="handler">\n\
|
51
|
+
<span class="inner"> </span>\n\
|
52
|
+
</span>'+type+'</span>\n\
|
53
|
+
<span class="block-name">'+name+'\n\
|
54
|
+
</span>\n\
|
55
|
+
<a href="/admin/blocks/'+id+'/edit" onclick="window.open(this.href); return false;" class="small-icons edit-link">\n\
|
56
|
+
<a href="#" class="big-icons gray-destroy"/>\n\
|
57
|
+
<input id="page_block_ids_" type="hidden" value="'+id+'" class="block-selected" name="'+jQuery(firstInput).attr('name')+'"/>\n\
|
58
|
+
</div>';
|
59
|
+
jQuery('.selectedPageCol .nested_sortable').append(content);
|
60
|
+
}
|
61
|
+
else{
|
62
|
+
content = '\
|
63
|
+
<div class="block-container">\n\
|
64
|
+
<span class="block-type">\n\
|
65
|
+
<span class="handler">\n\
|
66
|
+
<span class="inner"> </span>\n\
|
67
|
+
</span>'+type+'</span>\n\
|
68
|
+
<span class="block-name">'+name+'\n\
|
69
|
+
</span>\n\
|
70
|
+
<a href="/admin/blocks/'+id+'/edit" onclick="window.open(this.href); return false;" class="small-icons edit-link">\n\
|
71
|
+
<a href="#" class="big-icons gray-destroy"/>\n\
|
72
|
+
<input id="page_block_ids_" type="hidden" value="'+id+'" class="block-selected" name="page[page_cols_attributes][0][block_ids][]"/>\n\
|
73
|
+
</div>';
|
74
|
+
jQuery('.fieldset .nested_sortable').append(content);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
//the selected page in dialog box, is put in page list
|
79
|
+
function putInPageList(name, confirm_msg, block_id, id){
|
80
|
+
jQuery('#links_block_' + block_id).append('\
|
81
|
+
<span id="block_' + block_id + '_page_' + id + '" class="block-selected">\n\
|
82
|
+
<a class="big-icons big-icons-verti-delete-icon" href="#" onclick="if (confirm(\'' + confirm_msg + '\')) { jQuery.ajax({data:\'_method=delete\' + \'&authenticity_token=\' + encodeURIComponent(window._forgeos_js_vars.token), dataType:\'script\', success:function(request){jQuery(\'#block_' + block_id + '_page_' + id + '\').remove()}, type:\'post\', url:\'/admin/pages/' + id + '/blocks/' + block_id + '/unlink\'}); }; return false;"/>\n\
|
83
|
+
<a href="/admin/pages/' + id + '">' + name + '</a>\n\
|
84
|
+
<br/>\n\
|
85
|
+
</span>');
|
86
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
// initialize tree for page associations
|
2
|
+
function init_association_page_tree(selector, object_name){
|
3
|
+
init_association_category_tree(selector, object_name, 'page_col', 'association_page');
|
4
|
+
}
|
5
|
+
// initialize block category associations
|
6
|
+
function init_association_block_category_tree(selector, object_name){
|
7
|
+
init_association_category_tree(selector, object_name, 'block_category', 'association_categories');
|
8
|
+
}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/* --- WIDGET ACTUALITIES --- */
|
2
|
+
|
3
|
+
function create_actuality(){
|
4
|
+
new_actuality = '<div id="item_' + false_id + '" class="block-container widget-modify actuality">';
|
5
|
+
new_actuality += jQuery('#empty_actuality').html().replace(/EMPTY_ID/g, false_id);
|
6
|
+
new_actuality += '</div>';
|
7
|
+
|
8
|
+
title = jQuery('#widget_actuality_items_attributes_FORM_ID_title').val();
|
9
|
+
content = jQuery('#widget_actuality_items_attributes_FORM_ID_content').val();
|
10
|
+
|
11
|
+
if (title == '' || content == '') {
|
12
|
+
alert('The two fields are required.')
|
13
|
+
} else {
|
14
|
+
jQuery('#widget_actuality_items_attributes_FORM_ID_title').val('');
|
15
|
+
jQuery('#widget_actuality_items_attributes_FORM_ID_content').val('');
|
16
|
+
|
17
|
+
jQuery('#actualities').append(new_actuality);
|
18
|
+
|
19
|
+
p_title = '<p id="widget_actuality_item_title_'+false_id+'" class="widget_actuality_title">'+title+'</p>';
|
20
|
+
p_content = '<p id="widget_actuality_item_content_'+false_id+'" class="widget_actuality_content">'+content+'</p>';
|
21
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_title').before(p_title);
|
22
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_title').val(title);
|
23
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_content').before(p_content);
|
24
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_content').val(content);
|
25
|
+
|
26
|
+
// inputs = jQuery(new_actuality).find('input');
|
27
|
+
// jQuery(inputs[inputs.length - 1]).val(title);
|
28
|
+
// jQuery(inputs[inputs.length - 1]).before(p_title);
|
29
|
+
//
|
30
|
+
// jQuery(new_actuality).find('textarea').val(content);
|
31
|
+
// jQuery(new_actuality).find('textarea').before(p_content);
|
32
|
+
|
33
|
+
jQuery('.lightbox-actuality').dialog('close');
|
34
|
+
false_id--;
|
35
|
+
update_block_container_positions(jQuery('#actualities'));
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
function duplicate_actuality(item_id) {
|
40
|
+
block = jQuery('#'+item_id);
|
41
|
+
|
42
|
+
block_array = item_id.split('_');
|
43
|
+
id = block_array[1];
|
44
|
+
|
45
|
+
inputs = block.find('input');
|
46
|
+
title = jQuery(inputs[inputs.length - 1]).val();
|
47
|
+
content = jQuery(block.find('textarea')).val();
|
48
|
+
|
49
|
+
new_actuality = '<div id="item_'+ false_id +'" class="block-container widget-modify">';
|
50
|
+
new_actuality += jQuery('#empty_actuality').clone().html().replace(/EMPTY_ID/g, false_id);
|
51
|
+
new_actuality += '</div>';
|
52
|
+
|
53
|
+
// new_actuality = block.clone();
|
54
|
+
// regexp = new RegExp('_'+id,"gi");
|
55
|
+
// new_actuality.html().replace(regexp, false_id);
|
56
|
+
|
57
|
+
|
58
|
+
block.after(new_actuality);
|
59
|
+
|
60
|
+
p_title = '<p id="widget_actuality_item_title_'+false_id+'" class="widget_actuality_title">'+title+'</p>';
|
61
|
+
p_content = '<p id="widget_actuality_item_content_'+false_id+'" class="widget_actuality_content">'+content+'</p>';
|
62
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_title').before(p_title);
|
63
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_title').val(title);
|
64
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_content').before(p_content);
|
65
|
+
jQuery('#widget_actuality_items_attributes_'+ false_id +'_content').val(content);
|
66
|
+
|
67
|
+
false_id--;
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
function edit_actuality(edit_link) {
|
72
|
+
block = jQuery(edit_link).parents('.block-container');
|
73
|
+
|
74
|
+
block_id = block.attr('id').split('_');
|
75
|
+
actuality_id = block_id[1];
|
76
|
+
|
77
|
+
inputs = block.find('input');
|
78
|
+
title = jQuery(inputs[inputs.length - 1]).val();
|
79
|
+
content = jQuery(block.find('textarea')).val();
|
80
|
+
|
81
|
+
jQuery('#widget_actuality_items_attributes_FORM_ID_title').val(title);
|
82
|
+
jQuery('#widget_actuality_items_attributes_FORM_ID_content').val(content);
|
83
|
+
}
|
84
|
+
|
85
|
+
function update_actuality() {
|
86
|
+
block = jQuery('#item_'+actuality_id);
|
87
|
+
|
88
|
+
title = jQuery('#widget_actuality_items_attributes_FORM_ID_title').val();
|
89
|
+
content = jQuery('#widget_actuality_items_attributes_FORM_ID_content').val();
|
90
|
+
|
91
|
+
jQuery('#widget_actuality_items_attributes_FORM_ID_title').val('');
|
92
|
+
jQuery('#widget_actuality_items_attributes_FORM_ID_content').val('');
|
93
|
+
|
94
|
+
inputs = block.find('input');
|
95
|
+
jQuery(inputs[inputs.length - 1]).val(title);
|
96
|
+
jQuery('#widget_actuality_item_title_'+actuality_id).html(title);
|
97
|
+
|
98
|
+
jQuery(block.find('textarea')).val(content);
|
99
|
+
jQuery('#widget_actuality_item_content_'+actuality_id).html(content);
|
100
|
+
|
101
|
+
jQuery('.lightbox-actuality').dialog('close');
|
102
|
+
}
|
103
|
+
|
104
|
+
// hide actuality container and set item delete value to 1
|
105
|
+
function remove_actuality(destroy_link){
|
106
|
+
block = jQuery(destroy_link).parents('.block-container');
|
107
|
+
jQuery(block).hide();
|
108
|
+
jQuery(block).find('.delete').val(1);
|
109
|
+
update_block_container_positions(jQuery('#actualities'));
|
110
|
+
}
|
111
|
+
|
112
|
+
// empty actuality form fields of overlay
|
113
|
+
function empty_actuality_overlay_fields(){
|
114
|
+
var box = jQuery('.lightbox-actuality');
|
115
|
+
jQuery(box).find('.widget_actuality_title input').val('');
|
116
|
+
jQuery(box).find('.widget_actuality_content textarea').val('');
|
117
|
+
}
|
@@ -0,0 +1,131 @@
|
|
1
|
+
var false_id = -1;
|
2
|
+
var current_carousel_item_link = null;
|
3
|
+
|
4
|
+
jQuery(document).ready(function(){
|
5
|
+
|
6
|
+
jQuery('.change-picture').live('click',function(){
|
7
|
+
current_carousel_item_link = jQuery(this).attr('id');
|
8
|
+
openimageUploadDialog(jQuery(this));
|
9
|
+
return false;
|
10
|
+
});
|
11
|
+
|
12
|
+
jQuery('.button-carousel-item').bind('click', function() {
|
13
|
+
add_new_carousel_item('item_' + false_id);
|
14
|
+
return false;
|
15
|
+
});
|
16
|
+
|
17
|
+
// Duplicate widget carousel item
|
18
|
+
jQuery('.block-container.widget-modify.carousel .duplicate-link').live('click',function(){
|
19
|
+
// get source carousel
|
20
|
+
var src_item = jQuery(this).parents('.block-container').find('.inner_block-container');
|
21
|
+
var display_block = jQuery(src_item.children('.block-name')[0]);
|
22
|
+
var link = jQuery(display_block).find('a');
|
23
|
+
|
24
|
+
// attribute values
|
25
|
+
var title = link.html();
|
26
|
+
var url = link.attr('href');
|
27
|
+
var description = jQuery(display_block).find('p').html();
|
28
|
+
|
29
|
+
// create new empty carousel item
|
30
|
+
var item_id = 'item_' + false_id;
|
31
|
+
add_new_carousel_item(item_id);
|
32
|
+
var new_item = jQuery('#carousel_items').find('#' + item_id);
|
33
|
+
|
34
|
+
// picture
|
35
|
+
var src_img = jQuery(src_item).find('img');
|
36
|
+
var new_img = jQuery(new_item).find('img');
|
37
|
+
|
38
|
+
jQuery(new_img).attr('src', jQuery(src_img).attr('src'));
|
39
|
+
jQuery(new_img).attr('alt', jQuery(src_img).attr('alt'));
|
40
|
+
jQuery(new_img).nextAll('input').val(jQuery(src_img).nextAll('input').val());
|
41
|
+
|
42
|
+
// copy value of each input/textarea
|
43
|
+
jQuery(new_item).find('input, textarea, select').each(function(){
|
44
|
+
switch(get_rails_element_id(jQuery(this)))
|
45
|
+
{
|
46
|
+
case 'title':
|
47
|
+
jQuery(this).val(title);
|
48
|
+
break;
|
49
|
+
case 'url':
|
50
|
+
jQuery(this).val(url.replace('http://', ''));
|
51
|
+
break;
|
52
|
+
case 'description':
|
53
|
+
jQuery(this).val(description);
|
54
|
+
break;
|
55
|
+
}
|
56
|
+
});
|
57
|
+
|
58
|
+
// copy value for display block
|
59
|
+
var new_display_block = jQuery(new_item.children('.block-name')[0]);
|
60
|
+
jQuery(new_display_block).children('a').html(title);
|
61
|
+
jQuery(new_display_block).children('href').html(url);
|
62
|
+
jQuery(new_display_block).find('p').html(description);
|
63
|
+
return false;
|
64
|
+
});
|
65
|
+
|
66
|
+
//Edition mode in widget carousel item edit
|
67
|
+
jQuery('.block-container.widget-modify.carousel .edit-link, .block-container.widget-modify.carousel .back-link').live('click',function(){
|
68
|
+
var blockContainer = jQuery(this).parents('.block-container.widget-modify').find('.inner_block-container');
|
69
|
+
var blockNameBlocks = blockContainer.children('.block-name');
|
70
|
+
var blockType = blockContainer.children('.block-type');
|
71
|
+
|
72
|
+
blockType.toggle();
|
73
|
+
blockNameBlocks.toggle();
|
74
|
+
blockContainer.toggleClass('open');
|
75
|
+
|
76
|
+
// on closing edition block
|
77
|
+
if (!jQuery(blockContainer).hasClass('open')){
|
78
|
+
var display_block = blockNameBlocks[0];
|
79
|
+
var edition_block = blockNameBlocks[1];
|
80
|
+
var link = jQuery(display_block).find('a');
|
81
|
+
var edition_img = jQuery(edition_block).find('img');
|
82
|
+
var display_img = jQuery(blockType).find('img');
|
83
|
+
|
84
|
+
// update attributes
|
85
|
+
if (jQuery(this).hasClass('edit-link')) {
|
86
|
+
// picture
|
87
|
+
jQuery(display_img).attr('src', jQuery(edition_img).attr('src'));
|
88
|
+
jQuery(display_img).attr('alt', jQuery(edition_img).attr('alt'));
|
89
|
+
|
90
|
+
// title, url and description
|
91
|
+
jQuery(edition_block).find('input, textarea, select').each(function(){
|
92
|
+
switch(get_rails_element_id(jQuery(this)))
|
93
|
+
{
|
94
|
+
case 'title':
|
95
|
+
link.html(jQuery(this).val());
|
96
|
+
break;
|
97
|
+
case 'url':
|
98
|
+
link.attr('href', 'http://' + jQuery(this).val());
|
99
|
+
break;
|
100
|
+
case 'description':
|
101
|
+
jQuery(display_block).find('p').html(jQuery(this).val());
|
102
|
+
break;
|
103
|
+
}
|
104
|
+
});
|
105
|
+
}
|
106
|
+
// reset attributes
|
107
|
+
else {
|
108
|
+
// picture
|
109
|
+
jQuery(edition_img).attr('src', jQuery(display_img).attr('src'));
|
110
|
+
jQuery(edition_img).attr('alt', jQuery(display_img).attr('alt'));
|
111
|
+
|
112
|
+
// title, url and description
|
113
|
+
jQuery(edition_block).find('input, textarea, select').each(function(){
|
114
|
+
switch(get_rails_element_id(jQuery(this)))
|
115
|
+
{
|
116
|
+
case 'title':
|
117
|
+
jQuery(this).val(link.html());
|
118
|
+
break;
|
119
|
+
case 'url':
|
120
|
+
jQuery(this).val(link.attr('href').replace('http://', ''));
|
121
|
+
break;
|
122
|
+
case 'description':
|
123
|
+
jQuery(this).val(jQuery(display_block).find('p').html());
|
124
|
+
break;
|
125
|
+
}
|
126
|
+
});
|
127
|
+
}
|
128
|
+
}
|
129
|
+
return false;
|
130
|
+
});
|
131
|
+
});
|