browsercms-artirix 4.0.0.rc1.art4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +5 -0
- data/COPYRIGHT.txt +27 -0
- data/GPL.txt +674 -0
- data/LICENSE.txt +165 -0
- data/README.markdown +45 -0
- data/app/assets/fonts/icomoon.dev.svg +61 -0
- data/app/assets/fonts/icomoon.eot +0 -0
- data/app/assets/fonts/icomoon.svg +61 -0
- data/app/assets/fonts/icomoon.ttf +0 -0
- data/app/assets/fonts/icomoon.woff +0 -0
- data/app/assets/images/ckeditor/plugins/delete_content/icons/deletecontent.png +0 -0
- data/app/assets/images/ckeditor/plugins/edit_content/icons/editcontent.png +0 -0
- data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentdown.png +0 -0
- data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentup.png +0 -0
- data/app/assets/images/cms/administration/user_browser_bg.gif +0 -0
- data/app/assets/images/cms/arrow-down.png +0 -0
- data/app/assets/images/cms/arrow-up.png +0 -0
- data/app/assets/images/cms/bg.png +0 -0
- data/app/assets/images/cms/bl_curve.png +0 -0
- data/app/assets/images/cms/bottom_cap.png +0 -0
- data/app/assets/images/cms/bottom_cap_content.png +0 -0
- data/app/assets/images/cms/browse.gif +0 -0
- data/app/assets/images/cms/browser_media_logo.png +0 -0
- data/app/assets/images/cms/browsercms_logo.png +0 -0
- data/app/assets/images/cms/buttons/button.png +0 -0
- data/app/assets/images/cms/buttons/button_bg.png +0 -0
- data/app/assets/images/cms/buttons/button_cap.png +0 -0
- data/app/assets/images/cms/buttons/button_cap_h.png +0 -0
- data/app/assets/images/cms/buttons/button_cap_off.gif +0 -0
- data/app/assets/images/cms/buttons/button_cap_off_middle.gif +0 -0
- data/app/assets/images/cms/buttons/button_h.png +0 -0
- data/app/assets/images/cms/buttons/button_left_bg.png +0 -0
- data/app/assets/images/cms/buttons/button_off.png +0 -0
- data/app/assets/images/cms/buttons/button_off_middle.png +0 -0
- data/app/assets/images/cms/buttons/delete_x.png +0 -0
- data/app/assets/images/cms/buttons/delete_x_disabled.png +0 -0
- data/app/assets/images/cms/buttons/delete_x_h.png +0 -0
- data/app/assets/images/cms/buttons/sm_button.gif +0 -0
- data/app/assets/images/cms/buttons/sm_button_2.gif +0 -0
- data/app/assets/images/cms/buttons/sm_button_2_h.gif +0 -0
- data/app/assets/images/cms/buttons/sm_button_h.gif +0 -0
- data/app/assets/images/cms/cogs.png +0 -0
- data/app/assets/images/cms/containers/add.gif +0 -0
- data/app/assets/images/cms/containers/alpha.png +0 -0
- data/app/assets/images/cms/containers/beta.png +0 -0
- data/app/assets/images/cms/containers/delete.gif +0 -0
- data/app/assets/images/cms/containers/down.gif +0 -0
- data/app/assets/images/cms/containers/edit.gif +0 -0
- data/app/assets/images/cms/containers/up.gif +0 -0
- data/app/assets/images/cms/containers/view.gif +0 -0
- data/app/assets/images/cms/content_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/bottom_cap.png +0 -0
- data/app/assets/images/cms/dashboard/bottom_cap_content.png +0 -0
- data/app/assets/images/cms/dashboard/header_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/header_left_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/home.png +0 -0
- data/app/assets/images/cms/dashboard/table_header_bg.gif +0 -0
- data/app/assets/images/cms/dashboard/top_cap.png +0 -0
- data/app/assets/images/cms/dashed.gif +0 -0
- data/app/assets/images/cms/datepicker/clear.gif +0 -0
- data/app/assets/images/cms/datepicker/close.gif +0 -0
- data/app/assets/images/cms/dk_button_l.gif +0 -0
- data/app/assets/images/cms/dk_button_r.gif +0 -0
- data/app/assets/images/cms/dot.png +0 -0
- data/app/assets/images/cms/draft_status.gif +0 -0
- data/app/assets/images/cms/file-uploading.gif +0 -0
- data/app/assets/images/cms/gray_long_bg.gif +0 -0
- data/app/assets/images/cms/home.png +0 -0
- data/app/assets/images/cms/icons/actions/add.png +0 -0
- data/app/assets/images/cms/icons/actions/config.png +0 -0
- data/app/assets/images/cms/icons/actions/connect.png +0 -0
- data/app/assets/images/cms/icons/actions/delete.png +0 -0
- data/app/assets/images/cms/icons/actions/down.png +0 -0
- data/app/assets/images/cms/icons/actions/edit.png +0 -0
- data/app/assets/images/cms/icons/actions/folder.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_add.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_delete.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_edit.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_move.png +0 -0
- data/app/assets/images/cms/icons/actions/folder_open.png +0 -0
- data/app/assets/images/cms/icons/actions/history.png +0 -0
- data/app/assets/images/cms/icons/actions/home.png +0 -0
- data/app/assets/images/cms/icons/actions/left.png +0 -0
- data/app/assets/images/cms/icons/actions/link.png +0 -0
- data/app/assets/images/cms/icons/actions/page.png +0 -0
- data/app/assets/images/cms/icons/actions/page_add.png +0 -0
- data/app/assets/images/cms/icons/actions/page_edit.png +0 -0
- data/app/assets/images/cms/icons/actions/page_move.png +0 -0
- data/app/assets/images/cms/icons/actions/redo.png +0 -0
- data/app/assets/images/cms/icons/actions/refresh.png +0 -0
- data/app/assets/images/cms/icons/actions/right.png +0 -0
- data/app/assets/images/cms/icons/actions/root_folder.png +0 -0
- data/app/assets/images/cms/icons/actions/root_link.png +0 -0
- data/app/assets/images/cms/icons/actions/root_page.png +0 -0
- data/app/assets/images/cms/icons/actions/undo.png +0 -0
- data/app/assets/images/cms/icons/actions/up.png +0 -0
- data/app/assets/images/cms/icons/actions/view.png +0 -0
- data/app/assets/images/cms/icons/file_types/doc.png +0 -0
- data/app/assets/images/cms/icons/file_types/file.png +0 -0
- data/app/assets/images/cms/icons/file_types/gif.png +0 -0
- data/app/assets/images/cms/icons/file_types/htm.png +0 -0
- data/app/assets/images/cms/icons/file_types/pdf.png +0 -0
- data/app/assets/images/cms/icons/file_types/ppt.png +0 -0
- data/app/assets/images/cms/icons/file_types/swf.png +0 -0
- data/app/assets/images/cms/icons/file_types/txt.png +0 -0
- data/app/assets/images/cms/icons/file_types/xls.png +0 -0
- data/app/assets/images/cms/icons/file_types/xml.png +0 -0
- data/app/assets/images/cms/icons/file_types/zip.png +0 -0
- data/app/assets/images/cms/icons/status/archived.gif +0 -0
- data/app/assets/images/cms/icons/status/draft.gif +0 -0
- data/app/assets/images/cms/icons/status/hidden.gif +0 -0
- data/app/assets/images/cms/icons/status/locked.gif +0 -0
- data/app/assets/images/cms/icons/status/published.gif +0 -0
- data/app/assets/images/cms/icons/status/unlocked.gif +0 -0
- data/app/assets/images/cms/icons/user.png +0 -0
- data/app/assets/images/cms/login_bg.jpg +0 -0
- data/app/assets/images/cms/login_bottom.jpg +0 -0
- data/app/assets/images/cms/login_top.gif +0 -0
- data/app/assets/images/cms/logo.png +0 -0
- data/app/assets/images/cms/lt_button_bg.gif +0 -0
- data/app/assets/images/cms/lt_button_l.gif +0 -0
- data/app/assets/images/cms/lt_button_r.gif +0 -0
- data/app/assets/images/cms/menu/block_cap_h.gif +0 -0
- data/app/assets/images/cms/menu/bottom_cap.png +0 -0
- data/app/assets/images/cms/menu/bottom_cap_menu.png +0 -0
- data/app/assets/images/cms/menu/bottom_cap_menu_first.png +0 -0
- data/app/assets/images/cms/menu/menu_header_first_bg.gif +0 -0
- data/app/assets/images/cms/menu/selected_block_cap.gif +0 -0
- data/app/assets/images/cms/menu/top_cap.png +0 -0
- data/app/assets/images/cms/menu/top_cap_menu_header.png +0 -0
- data/app/assets/images/cms/menu.png +0 -0
- data/app/assets/images/cms/menu_h.gif +0 -0
- data/app/assets/images/cms/menu_header.png +0 -0
- data/app/assets/images/cms/menu_open.png +0 -0
- data/app/assets/images/cms/menu_open_bg.gif +0 -0
- data/app/assets/images/cms/nav/on_bg.gif +0 -0
- data/app/assets/images/cms/nav.png +0 -0
- data/app/assets/images/cms/nav_admin.gif +0 -0
- data/app/assets/images/cms/nav_admin_h.gif +0 -0
- data/app/assets/images/cms/nav_admin_on.gif +0 -0
- data/app/assets/images/cms/nav_cap.png +0 -0
- data/app/assets/images/cms/nav_cap_h.gif +0 -0
- data/app/assets/images/cms/nav_content_library.gif +0 -0
- data/app/assets/images/cms/nav_content_library_h.gif +0 -0
- data/app/assets/images/cms/nav_content_library_on.gif +0 -0
- data/app/assets/images/cms/nav_dash.gif +0 -0
- data/app/assets/images/cms/nav_dash_h.gif +0 -0
- data/app/assets/images/cms/nav_dash_on.gif +0 -0
- data/app/assets/images/cms/nav_h.gif +0 -0
- data/app/assets/images/cms/nav_sitemap.gif +0 -0
- data/app/assets/images/cms/nav_sitemap_h.gif +0 -0
- data/app/assets/images/cms/nav_sitemap_on.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_inset_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/page_toolbar_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_draft_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_draft_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_published_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/status_published_l.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_bg.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_end.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_r.gif +0 -0
- data/app/assets/images/cms/page_toolbar/visual_editor_state_bg.gif +0 -0
- data/app/assets/images/cms/pages/add_connectable.gif +0 -0
- data/app/assets/images/cms/pages/connect_connectable.gif +0 -0
- data/app/assets/images/cms/pages/container_border.gif +0 -0
- data/app/assets/images/cms/pages/container_border_l.gif +0 -0
- data/app/assets/images/cms/pages/container_border_r.gif +0 -0
- data/app/assets/images/cms/pages/delete_connectable.gif +0 -0
- data/app/assets/images/cms/pages/down_connectable.gif +0 -0
- data/app/assets/images/cms/pages/down_connectable_disabled.gif +0 -0
- data/app/assets/images/cms/pages/edit_connectable.gif +0 -0
- data/app/assets/images/cms/pages/edit_connectable_2.gif +0 -0
- data/app/assets/images/cms/pages/show_connectable.gif +0 -0
- data/app/assets/images/cms/pages/up_connectable.gif +0 -0
- data/app/assets/images/cms/pages/up_connectable_disabled.gif +0 -0
- data/app/assets/images/cms/pagination/first.gif +0 -0
- data/app/assets/images/cms/pagination/first_h.gif +0 -0
- data/app/assets/images/cms/pagination/input.gif +0 -0
- data/app/assets/images/cms/pagination/last.gif +0 -0
- data/app/assets/images/cms/pagination/last_h.gif +0 -0
- data/app/assets/images/cms/pagination/next.gif +0 -0
- data/app/assets/images/cms/pagination/next_h.gif +0 -0
- data/app/assets/images/cms/pagination/previous.gif +0 -0
- data/app/assets/images/cms/pagination/previous_h.gif +0 -0
- data/app/assets/images/cms/pencil.png +0 -0
- data/app/assets/images/cms/plus.png +0 -0
- data/app/assets/images/cms/published_status.gif +0 -0
- data/app/assets/images/cms/search.png +0 -0
- data/app/assets/images/cms/search_submit.gif +0 -0
- data/app/assets/images/cms/search_submit_h.gif +0 -0
- data/app/assets/images/cms/searchbox_gradient.gif +0 -0
- data/app/assets/images/cms/select_bg.gif +0 -0
- data/app/assets/images/cms/select_bg_2.gif +0 -0
- data/app/assets/images/cms/sitemap/bottom_cap.png +0 -0
- data/app/assets/images/cms/sitemap/buffer_caps.png +0 -0
- data/app/assets/images/cms/sitemap/contract.png +0 -0
- data/app/assets/images/cms/sitemap/corners.gif +0 -0
- data/app/assets/images/cms/sitemap/corners_hover.gif +0 -0
- data/app/assets/images/cms/sitemap/divider.gif +0 -0
- data/app/assets/images/cms/sitemap/expand.png +0 -0
- data/app/assets/images/cms/sitemap/gradient.gif +0 -0
- data/app/assets/images/cms/sitemap/gray_contract.png +0 -0
- data/app/assets/images/cms/sitemap/gray_expand.png +0 -0
- data/app/assets/images/cms/sitemap/no_contents.png +0 -0
- data/app/assets/images/cms/sitemap/site_root_cap.png +0 -0
- data/app/assets/images/cms/sitemap/tooltip.gif +0 -0
- data/app/assets/images/cms/sitemap/top_cap_content.png +0 -0
- data/app/assets/images/cms/solid.gif +0 -0
- data/app/assets/images/cms/table/bl.gif +0 -0
- data/app/assets/images/cms/table/br.gif +0 -0
- data/app/assets/images/cms/table/divider.gif +0 -0
- data/app/assets/images/cms/table/td_cap_first_h.gif +0 -0
- data/app/assets/images/cms/table/td_cap_first_s.gif +0 -0
- data/app/assets/images/cms/table/td_cap_last_h.gif +0 -0
- data/app/assets/images/cms/table/td_cap_last_s.gif +0 -0
- data/app/assets/images/cms/table/td_last_bg.gif +0 -0
- data/app/assets/images/cms/table/th_bg.gif +0 -0
- data/app/assets/images/cms/table/th_divider.gif +0 -0
- data/app/assets/images/cms/table/th_last_bg.gif +0 -0
- data/app/assets/images/cms/table/tl.gif +0 -0
- data/app/assets/images/cms/table/tr.gif +0 -0
- data/app/assets/images/cms/table/tr_bg.gif +0 -0
- data/app/assets/images/cms/toolbar_bg.png +0 -0
- data/app/assets/images/cms/top_cap.png +0 -0
- data/app/assets/images/cms/top_cap_content.png +0 -0
- data/app/assets/images/cms/top_cap_menu_header.png +0 -0
- data/app/assets/images/cms/user.png +0 -0
- data/app/assets/images/cms/user_search_submit.gif +0 -0
- data/app/assets/images/cms/usercontrols_bg.png +0 -0
- data/app/assets/images/cms/usercontrols_bg_cap.png +0 -0
- data/app/assets/javascripts/bcms/ckeditor.js +8 -0
- data/app/assets/javascripts/bcms/ckeditor_inline.js +23 -0
- data/app/assets/javascripts/bcms/ckeditor_load.js +54 -0
- data/app/assets/javascripts/bcms/ckeditor_standard_config.js +10 -0
- data/app/assets/javascripts/ckeditor/plugins/delete_content/plugin.js +36 -0
- data/app/assets/javascripts/ckeditor/plugins/edit_content/plugin.js +24 -0
- data/app/assets/javascripts/ckeditor/plugins/move_content/plugin.js +25 -0
- data/app/assets/javascripts/cms/ajax.js +60 -0
- data/app/assets/javascripts/cms/application.js +18 -0
- data/app/assets/javascripts/cms/attachment_manager.js +88 -0
- data/app/assets/javascripts/cms/content_library.js +121 -0
- data/app/assets/javascripts/cms/content_types.js +13 -0
- data/app/assets/javascripts/cms/core_library.js.erb +210 -0
- data/app/assets/javascripts/cms/form_builder.js +250 -0
- data/app/assets/javascripts/cms/namespace.js +2 -0
- data/app/assets/javascripts/cms/new_content_button.js +27 -0
- data/app/assets/javascripts/cms/page_editor.js +189 -0
- data/app/assets/javascripts/cms/page_toolbar.js +13 -0
- data/app/assets/javascripts/cms/site.js +2 -0
- data/app/assets/javascripts/cms/sitemap.js +219 -0
- data/app/assets/javascripts/cms/toolbar.js +21 -0
- data/app/assets/javascripts/cms/user.js +40 -0
- data/app/assets/javascripts/jquery.exists.js +5 -0
- data/app/assets/javascripts/jquery.taglist.js +157 -0
- data/app/assets/stylesheets/cms/_assets.scss +60 -0
- data/app/assets/stylesheets/cms/_base.scss +42 -0
- data/app/assets/stylesheets/cms/_cms-buttons.scss +73 -0
- data/app/assets/stylesheets/cms/_cms-forms.scss +70 -0
- data/app/assets/stylesheets/cms/_colors.scss +20 -0
- data/app/assets/stylesheets/cms/_dashboard.scss +25 -0
- data/app/assets/stylesheets/cms/_glyph.scss +60 -0
- data/app/assets/stylesheets/cms/_main-area.scss +62 -0
- data/app/assets/stylesheets/cms/_nav.scss +197 -0
- data/app/assets/stylesheets/cms/_sidebar.scss +64 -0
- data/app/assets/stylesheets/cms/_sitemap.scss +209 -0
- data/app/assets/stylesheets/cms/_submenu.scss +48 -0
- data/app/assets/stylesheets/cms/application.scss +49 -0
- data/app/assets/stylesheets/cms/core.scss +96 -0
- data/app/assets/stylesheets/cms/default-forms.scss +3 -0
- data/app/assets/stylesheets/cms/includes/_animation.scss +2 -0
- data/app/assets/stylesheets/cms/includes/_rem.scss +120 -0
- data/app/assets/stylesheets/cms/includes/animation/_animate.scss +31 -0
- data/app/assets/stylesheets/cms/includes/animation/_core.scss +127 -0
- data/app/assets/stylesheets/cms/includes/animation/_shared.scss +22 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss +152 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss +3 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_classes.scss +21 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_fading.scss +3 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss +87 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss +24 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss +3 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/_specials.scss +42 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss +68 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss +60 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss +86 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss +86 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss +58 -0
- data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss +58 -0
- data/app/assets/stylesheets/cms/page_content_editing.scss +4 -0
- data/app/assets/stylesheets/cms/page_editor.scss +4 -0
- data/app/assets/stylesheets/cms/style.scss +138 -0
- data/app/assets/stylesheets/cms/styles/_alerts.scss +150 -0
- data/app/assets/stylesheets/cms/styles/_base-grid.scss +299 -0
- data/app/assets/stylesheets/cms/styles/_buttons.scss +247 -0
- data/app/assets/stylesheets/cms/styles/_dropdown.scss +155 -0
- data/app/assets/stylesheets/cms/styles/_forms.scss +728 -0
- data/app/assets/stylesheets/cms/styles/_glyph.scss +86 -0
- data/app/assets/stylesheets/cms/styles/_images.scss +86 -0
- data/app/assets/stylesheets/cms/styles/_lists.scss +115 -0
- data/app/assets/stylesheets/cms/styles/_modal.scss +174 -0
- data/app/assets/stylesheets/cms/styles/_progress.scss +43 -0
- data/app/assets/stylesheets/cms/styles/_tables.scss +141 -0
- data/app/assets/stylesheets/cms/styles/_text.scss +134 -0
- data/app/controllers/cms/application_controller.rb +11 -0
- data/app/controllers/cms/attachments_controller.rb +48 -0
- data/app/controllers/cms/base_controller.rb +22 -0
- data/app/controllers/cms/cache_controller.rb +23 -0
- data/app/controllers/cms/categories_controller.rb +7 -0
- data/app/controllers/cms/category_types_controller.rb +12 -0
- data/app/controllers/cms/connectors_controller.rb +70 -0
- data/app/controllers/cms/content_block_controller.rb +361 -0
- data/app/controllers/cms/content_controller.rb +173 -0
- data/app/controllers/cms/content_types_controller.rb +14 -0
- data/app/controllers/cms/dashboard_controller.rb +13 -0
- data/app/controllers/cms/dynamic_views_controller.rb +81 -0
- data/app/controllers/cms/email_messages_controller.rb +21 -0
- data/app/controllers/cms/file_blocks_controller.rb +4 -0
- data/app/controllers/cms/form_entries_controller.rb +140 -0
- data/app/controllers/cms/form_fields_controller.rb +74 -0
- data/app/controllers/cms/forms_controller.rb +35 -0
- data/app/controllers/cms/groups_controller.rb +25 -0
- data/app/controllers/cms/home_controller.rb +10 -0
- data/app/controllers/cms/html_blocks_controller.rb +4 -0
- data/app/controllers/cms/image_blocks_controller.rb +4 -0
- data/app/controllers/cms/inline_content_controller.rb +50 -0
- data/app/controllers/cms/links_controller.rb +81 -0
- data/app/controllers/cms/page_components_controller.rb +20 -0
- data/app/controllers/cms/page_route_conditions_controller.rb +4 -0
- data/app/controllers/cms/page_route_options_controller.rb +58 -0
- data/app/controllers/cms/page_route_requirements_controller.rb +4 -0
- data/app/controllers/cms/page_routes_controller.rb +51 -0
- data/app/controllers/cms/pages_controller.rb +151 -0
- data/app/controllers/cms/passwords_controller.rb +22 -0
- data/app/controllers/cms/portlet_controller.rb +21 -0
- data/app/controllers/cms/portlets_controller.rb +35 -0
- data/app/controllers/cms/redirects_controller.rb +25 -0
- data/app/controllers/cms/resource_controller.rb +125 -0
- data/app/controllers/cms/routes_controller.rb +22 -0
- data/app/controllers/cms/section_nodes_controller.rb +24 -0
- data/app/controllers/cms/sections_controller.rb +100 -0
- data/app/controllers/cms/sessions_controller.rb +15 -0
- data/app/controllers/cms/sites/passwords_controller.rb +32 -0
- data/app/controllers/cms/sites/sessions_controller.rb +20 -0
- data/app/controllers/cms/tags_controller.rb +16 -0
- data/app/controllers/cms/tasks_controller.rb +56 -0
- data/app/controllers/cms/toolbar_controller.rb +18 -0
- data/app/controllers/cms/user_controller.rb +8 -0
- data/app/controllers/cms/users_controller.rb +125 -0
- data/app/controllers/tests/pretend_controller.rb +32 -0
- data/app/helpers/cms/application_helper.rb +258 -0
- data/app/helpers/cms/content_block_helper.rb +55 -0
- data/app/helpers/cms/content_types_helper.rb +4 -0
- data/app/helpers/cms/form_tag_helper.rb +36 -0
- data/app/helpers/cms/menu_helper.rb +167 -0
- data/app/helpers/cms/mobile_helper.rb +29 -0
- data/app/helpers/cms/nav_menu_helper.rb +23 -0
- data/app/helpers/cms/page_helper.rb +169 -0
- data/app/helpers/cms/path_helper.rb +113 -0
- data/app/helpers/cms/rendering_helper.rb +112 -0
- data/app/helpers/cms/section_nodes_helper.rb +112 -0
- data/app/helpers/cms/sites/authentication_helper.rb +25 -0
- data/app/helpers/cms/sites/devise_shim_helper.rb +31 -0
- data/app/helpers/cms/template_support.rb +18 -0
- data/app/helpers/cms/ui_elements_helper.rb +168 -0
- data/app/helpers/forgot_password_portlet_helper.rb +9 -0
- data/app/helpers/login_portlet_helper.rb +10 -0
- data/app/inputs/attachments_input.rb +14 -0
- data/app/inputs/cms_text_area_input.rb +10 -0
- data/app/inputs/date_picker_input.rb +8 -0
- data/app/inputs/file_picker_input.rb +75 -0
- data/app/inputs/name_input.rb +42 -0
- data/app/inputs/path_input.rb +18 -0
- data/app/inputs/tag_list_input.rb +3 -0
- data/app/inputs/template_editor_input.rb +24 -0
- data/app/inputs/text_editor_input.rb +19 -0
- data/app/models/cms/abstract_file_block.rb +50 -0
- data/app/models/cms/attachment.rb +267 -0
- data/app/models/cms/category.rb +56 -0
- data/app/models/cms/category_type.rb +43 -0
- data/app/models/cms/connector.rb +99 -0
- data/app/models/cms/content.rb +31 -0
- data/app/models/cms/content_type.rb +191 -0
- data/app/models/cms/dynamic_view.rb +81 -0
- data/app/models/cms/email_message.rb +63 -0
- data/app/models/cms/email_message_mailer.rb +12 -0
- data/app/models/cms/external_user.rb +60 -0
- data/app/models/cms/file_block.rb +19 -0
- data/app/models/cms/form.rb +47 -0
- data/app/models/cms/form_entry.rb +75 -0
- data/app/models/cms/form_field.rb +78 -0
- data/app/models/cms/group.rb +62 -0
- data/app/models/cms/group_permission.rb +12 -0
- data/app/models/cms/group_section.rb +9 -0
- data/app/models/cms/group_type.rb +16 -0
- data/app/models/cms/group_type_permission.rb +8 -0
- data/app/models/cms/guest_user.rb +57 -0
- data/app/models/cms/html_block.rb +38 -0
- data/app/models/cms/image_block.rb +23 -0
- data/app/models/cms/link.rb +20 -0
- data/app/models/cms/page.rb +437 -0
- data/app/models/cms/page_component.rb +43 -0
- data/app/models/cms/page_partial.rb +40 -0
- data/app/models/cms/page_route.rb +140 -0
- data/app/models/cms/page_route_condition.rb +5 -0
- data/app/models/cms/page_route_option.rb +7 -0
- data/app/models/cms/page_route_requirement.rb +5 -0
- data/app/models/cms/page_template.rb +45 -0
- data/app/models/cms/permission.rb +17 -0
- data/app/models/cms/persistent_user.rb +223 -0
- data/app/models/cms/portlet.rb +237 -0
- data/app/models/cms/redirect.rb +12 -0
- data/app/models/cms/search_filter.rb +18 -0
- data/app/models/cms/section.rb +224 -0
- data/app/models/cms/section_node.rb +144 -0
- data/app/models/cms/site.rb +45 -0
- data/app/models/cms/tag.rb +69 -0
- data/app/models/cms/tagging.rb +14 -0
- data/app/models/cms/task.rb +75 -0
- data/app/models/cms/templates.rb +31 -0
- data/app/models/cms/user.rb +43 -0
- data/app/models/cms/user_group_membership.rb +9 -0
- data/app/models/cms/view_context.rb +81 -0
- data/app/portlets/deprecated_placeholder.rb +12 -0
- data/app/portlets/dynamic_portlet.rb +7 -0
- data/app/portlets/email_page_portlet.rb +32 -0
- data/app/portlets/forgot_password_portlet.rb +15 -0
- data/app/portlets/helpers/cms/list_portlet_helper.rb +5 -0
- data/app/portlets/list_portlet.rb +40 -0
- data/app/portlets/login_portlet.rb +13 -0
- data/app/portlets/tag_cloud_portlet.rb +15 -0
- data/app/presenters/cms/user_presenter.rb +47 -0
- data/app/views/cms/application/_add_content_modal.html.erb +3 -0
- data/app/views/cms/application/_buttons.html.erb +7 -0
- data/app/views/cms/application/_exception.html.erb +6 -0
- data/app/views/cms/application/_form_errors.html.erb +7 -0
- data/app/views/cms/application/_form_with_buttons.html.erb +10 -0
- data/app/views/cms/application/_main_content.html.erb +3 -0
- data/app/views/cms/application/_main_with_sidebar.html.erb +8 -0
- data/app/views/cms/application/_mobile_toolbar.html.erb +16 -0
- data/app/views/cms/application/_page_title.html.erb +5 -0
- data/app/views/cms/application/_pagination.html.erb +26 -0
- data/app/views/cms/application/_row.html.erb +1 -0
- data/app/views/cms/application/_save_buttons.html.erb +7 -0
- data/app/views/cms/application/_sidebar_layout.html.erb +3 -0
- data/app/views/cms/application/_version.html.erb +23 -0
- data/app/views/cms/application/_version_conflict_diff.html.erb +11 -0
- data/app/views/cms/application/_version_conflict_error.html.erb +6 -0
- data/app/views/cms/attachments/_attachment.html.erb +16 -0
- data/app/views/cms/attachments/_attachment_manager.html.erb +39 -0
- data/app/views/cms/attachments/_attachment_table.html.erb +22 -0
- data/app/views/cms/attachments/_attachment_wrapper.html.erb +4 -0
- data/app/views/cms/attachments/_no_attachments_defined.html.erb +1 -0
- data/app/views/cms/cache/show.html.erb +7 -0
- data/app/views/cms/categories/_form.html.erb +27 -0
- data/app/views/cms/category_types/_form.html.erb +1 -0
- data/app/views/cms/connectors/new.html.erb +38 -0
- data/app/views/cms/content/editing_frame.html.erb +1 -0
- data/app/views/cms/content/no_page.html.erb +19 -0
- data/app/views/cms/content/show.html.erb +21 -0
- data/app/views/cms/content_block/_block_form.html.erb +15 -0
- data/app/views/cms/content_block/_buttonbar.html.erb +29 -0
- data/app/views/cms/content_block/_buttons.html.erb +13 -0
- data/app/views/cms/content_block/_hidden_fields.html.erb +13 -0
- data/app/views/cms/content_block/_sidebar.html.erb +36 -0
- data/app/views/cms/content_block/edit.html.erb +3 -0
- data/app/views/cms/content_block/index.html.erb +87 -0
- data/app/views/cms/content_block/new.html.erb +3 -0
- data/app/views/cms/content_block/render_block_in_main_container.html.erb +10 -0
- data/app/views/cms/content_block/show.html.erb +1 -0
- data/app/views/cms/content_block/show_in_isolation.html.erb +15 -0
- data/app/views/cms/content_block/versions.html.erb +24 -0
- data/app/views/cms/content_types/_order_field.html.erb +5 -0
- data/app/views/cms/content_types/index.html.erb +3 -0
- data/app/views/cms/dashboard/_page_drafts.html.erb +39 -0
- data/app/views/cms/dashboard/_tasks.html.erb +41 -0
- data/app/views/cms/dashboard/index.html.erb +13 -0
- data/app/views/cms/dynamic_views/_form.html.erb +9 -0
- data/app/views/cms/dynamic_views/edit.html.erb +2 -0
- data/app/views/cms/dynamic_views/index.html.erb +33 -0
- data/app/views/cms/dynamic_views/new.html.erb +2 -0
- data/app/views/cms/email_messages/index.html.erb +36 -0
- data/app/views/cms/email_messages/show.html.erb +50 -0
- data/app/views/cms/file_blocks/_form.html.erb +3 -0
- data/app/views/cms/file_blocks/_section_selector.html.erb +13 -0
- data/app/views/cms/file_blocks/render.html.erb +5 -0
- data/app/views/cms/forgot_password_mailer/reset_password.text.html.erb +3 -0
- data/app/views/cms/forgot_password_mailer/reset_password.text.plain.erb +3 -0
- data/app/views/cms/form_entries/_buttons.html.erb +2 -0
- data/app/views/cms/form_entries/_form.html.erb +7 -0
- data/app/views/cms/form_entries/_internal_form.html.erb +9 -0
- data/app/views/cms/form_entries/edit.html.erb +5 -0
- data/app/views/cms/form_entries/error.html.erb +3 -0
- data/app/views/cms/form_entries/index.html.erb +5 -0
- data/app/views/cms/form_entries/new.html.erb +5 -0
- data/app/views/cms/form_entries/show.html.erb +13 -0
- data/app/views/cms/form_entries/submit.html.erb +1 -0
- data/app/views/cms/form_fields/_form.html.erb +8 -0
- data/app/views/cms/form_fields/_select.html.erb +3 -0
- data/app/views/cms/form_fields/_text_area.html.erb +3 -0
- data/app/views/cms/form_fields/_text_field.html.erb +3 -0
- data/app/views/cms/form_fields/edit.html.erb +0 -0
- data/app/views/cms/form_fields/new.html.erb +26 -0
- data/app/views/cms/form_fields/preview.html.erb +16 -0
- data/app/views/cms/forms/_form.html.erb +67 -0
- data/app/views/cms/forms/render.html.erb +15 -0
- data/app/views/cms/forms/show.html.erb +6 -0
- data/app/views/cms/groups/_form.html.erb +38 -0
- data/app/views/cms/groups/_permissions.html.erb +14 -0
- data/app/views/cms/groups/_sections.html.erb +12 -0
- data/app/views/cms/groups/edit.html.erb +2 -0
- data/app/views/cms/groups/index.html.erb +36 -0
- data/app/views/cms/groups/new.html.erb +2 -0
- data/app/views/cms/html_blocks/_form.html.erb +3 -0
- data/app/views/cms/html_blocks/render.html.erb +1 -0
- data/app/views/cms/image_blocks/_form.html.erb +3 -0
- data/app/views/cms/image_blocks/render.html.erb +4 -0
- data/app/views/cms/links/_form.html.erb +8 -0
- data/app/views/cms/links/edit.html.erb +4 -0
- data/app/views/cms/links/new.html.erb +5 -0
- data/app/views/cms/menus/_menu.html.erb +9 -0
- data/app/views/cms/menus/_menu_item.html.erb +11 -0
- data/app/views/cms/page_components/_content.html.erb +18 -0
- data/app/views/cms/page_components/new.html.erb +12 -0
- data/app/views/cms/page_routes/_form.html.erb +12 -0
- data/app/views/cms/page_routes/edit.html.erb +2 -0
- data/app/views/cms/page_routes/index.html.erb +33 -0
- data/app/views/cms/page_routes/new.html.erb +2 -0
- data/app/views/cms/pages/_edit_content.html.erb +28 -0
- data/app/views/cms/pages/_form.html.erb +21 -0
- data/app/views/cms/pages/_main_form.html.erb +23 -0
- data/app/views/cms/pages/_simple_container.html.erb +8 -0
- data/app/views/cms/pages/edit.html.erb +2 -0
- data/app/views/cms/pages/new.html.erb +19 -0
- data/app/views/cms/pages/versions.html.erb +22 -0
- data/app/views/cms/passwords/new.html.erb +16 -0
- data/app/views/cms/redirects/_form.html.erb +7 -0
- data/app/views/cms/redirects/edit.html.erb +2 -0
- data/app/views/cms/redirects/index.html.erb +25 -0
- data/app/views/cms/redirects/new.html.erb +2 -0
- data/app/views/cms/routes/index.html.erb +35 -0
- data/app/views/cms/section_nodes/_children.html.erb +5 -0
- data/app/views/cms/section_nodes/_row_buttons.html.erb +11 -0
- data/app/views/cms/section_nodes/_section_node.html.erb +24 -0
- data/app/views/cms/section_nodes/_sitemap_buttons.html.erb +47 -0
- data/app/views/cms/section_nodes/_status.html.erb +5 -0
- data/app/views/cms/section_nodes/show.html.erb +9 -0
- data/app/views/cms/sections/_buttons.html.erb +6 -0
- data/app/views/cms/sections/_form.html.erb +30 -0
- data/app/views/cms/sections/edit.html.erb +4 -0
- data/app/views/cms/sections/new.html.erb +5 -0
- data/app/views/cms/sessions/new.html.erb +16 -0
- data/app/views/cms/shared/access_denied.html.erb +2 -0
- data/app/views/cms/shared/error.html.erb +40 -0
- data/app/views/cms/shared/error.xml.erb +8 -0
- data/app/views/cms/sites/_flash.html.erb +8 -0
- data/app/views/cms/sites/passwords/new.html.erb +2 -0
- data/app/views/cms/sites/sessions/new.html.erb +2 -0
- data/app/views/cms/tags/_form.html.erb +1 -0
- data/app/views/cms/tags/render.html.erb +52 -0
- data/app/views/cms/tasks/new.html.erb +22 -0
- data/app/views/cms/toolbar/_new_pages_menu.html.erb +10 -0
- data/app/views/cms/users/_form.html.erb +9 -0
- data/app/views/cms/users/_password.html.erb +2 -0
- data/app/views/cms/users/_user_fields.html.erb +7 -0
- data/app/views/cms/users/change_password.html.erb +12 -0
- data/app/views/cms/users/edit.html.erb +2 -0
- data/app/views/cms/users/index.html.erb +65 -0
- data/app/views/cms/users/new.html.erb +2 -0
- data/app/views/devise/confirmations/new.html.erb +16 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +19 -0
- data/app/views/devise/passwords/new.html.erb +15 -0
- data/app/views/devise/registrations/edit.html.erb +28 -0
- data/app/views/devise/registrations/new.html.erb +18 -0
- data/app/views/devise/shared/_links.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +16 -0
- data/app/views/layouts/cms/_content_types.html.erb +13 -0
- data/app/views/layouts/cms/_footer.erb +4 -0
- data/app/views/layouts/cms/_head.html.erb +8 -0
- data/app/views/layouts/cms/_main_menu.html.erb +78 -0
- data/app/views/layouts/cms/application.html.erb +23 -0
- data/app/views/layouts/cms/content_page.html.erb +5 -0
- data/app/views/layouts/cms/page_editor.html.erb +90 -0
- data/app/views/portlets/deprecated_placeholders/_form.html.erb +1 -0
- data/app/views/portlets/deprecated_placeholders/render.html.erb +8 -0
- data/app/views/portlets/dynamic/_form.html.erb +3 -0
- data/app/views/portlets/email_page/_form.html.erb +5 -0
- data/app/views/portlets/email_page/render.html.erb +17 -0
- data/app/views/portlets/forgot_password/_form.html.erb +5 -0
- data/app/views/portlets/forgot_password/render.html.erb +2 -0
- data/app/views/portlets/list/_form.html.erb +33 -0
- data/app/views/portlets/list/_list.html.erb +6 -0
- data/app/views/portlets/list/_table.html.erb +13 -0
- data/app/views/portlets/list/render.html.erb +1 -0
- data/app/views/portlets/login/_form.html.erb +4 -0
- data/app/views/portlets/login/render.html.erb +10 -0
- data/app/views/portlets/portlets/_form.html.erb +20 -0
- data/app/views/portlets/tag_cloud/_form.html.erb +4 -0
- data/app/views/portlets/tag_cloud/render.html.erb +5 -0
- data/app/views/tests/pretend/open_with_layout.html.erb +5 -0
- data/bin/bcms +321 -0
- data/bin/browsercms +4 -0
- data/bin/rake +16 -0
- data/config/routes.rb +135 -0
- data/db/browsercms.seeds.rb +63 -0
- data/db/migrate/20080815014337_browsercms300.rb +287 -0
- data/db/migrate/20130327184912_browsercms400.rb +120 -0
- data/db/migrate/20150715173336_create_default_users.rb +12 -0
- data/db/seeds.rb +1 -0
- data/doc/README_FOR_APP +6 -0
- data/doc/design/blue_button.psd +0 -0
- data/doc/design/gray_box.psd +0 -0
- data/doc/design/main_nav.psd +0 -0
- data/doc/features/design_integration.md +45 -0
- data/doc/features/external_user.md +7 -0
- data/doc/features/form_builder.md +40 -0
- data/doc/features/simple_form_refactor.md +60 -0
- data/doc/performance_tuning_notes.md +12 -0
- data/doc/release_notes.md +837 -0
- data/doc/test_procedure.txt +141 -0
- data/lib/acts_as_list.rb +257 -0
- data/lib/browsercms-artirix.rb +1 -0
- data/lib/browsercms.rb +73 -0
- data/lib/cms/acts/cms_user.rb +131 -0
- data/lib/cms/acts/content_block.rb +61 -0
- data/lib/cms/acts/content_page.rb +90 -0
- data/lib/cms/acts.rb +7 -0
- data/lib/cms/admin_tab.rb +15 -0
- data/lib/cms/attachments/attachment_serving.rb +59 -0
- data/lib/cms/attachments/configuration.rb +88 -0
- data/lib/cms/authentication/controller.rb +120 -0
- data/lib/cms/authentication/test_password_strategy.rb +28 -0
- data/lib/cms/authentication.rb +4 -0
- data/lib/cms/authoring.rb +9 -0
- data/lib/cms/behaviors/archiving.rb +43 -0
- data/lib/cms/behaviors/attaching.rb +363 -0
- data/lib/cms/behaviors/categorizing.rb +31 -0
- data/lib/cms/behaviors/connecting.rb +141 -0
- data/lib/cms/behaviors/dynamic_attributes.rb +384 -0
- data/lib/cms/behaviors/flush_cache_on_change.rb +31 -0
- data/lib/cms/behaviors/hiding.rb +46 -0
- data/lib/cms/behaviors/namespacing.rb +15 -0
- data/lib/cms/behaviors/naming.rb +16 -0
- data/lib/cms/behaviors/publishing.rb +205 -0
- data/lib/cms/behaviors/rendering.rb +195 -0
- data/lib/cms/behaviors/searching.rb +45 -0
- data/lib/cms/behaviors/soft_deleting.rb +103 -0
- data/lib/cms/behaviors/taggable.rb +66 -0
- data/lib/cms/behaviors/userstamping.rb +42 -0
- data/lib/cms/behaviors/versioning.rb +360 -0
- data/lib/cms/behaviors.rb +34 -0
- data/lib/cms/caching.rb +62 -0
- data/lib/cms/commands/actions.rb +107 -0
- data/lib/cms/commands/to_version400.rb +10 -0
- data/lib/cms/concerns/can_be_addressable.rb +326 -0
- data/lib/cms/concerns/has_content_type.rb +46 -0
- data/lib/cms/concerns/ignores_publishing.rb +9 -0
- data/lib/cms/concerns.rb +7 -0
- data/lib/cms/configuration/configurable_template.rb +24 -0
- data/lib/cms/configuration/devise.rb +256 -0
- data/lib/cms/configuration.rb +79 -0
- data/lib/cms/configure_simple_form.rb +142 -0
- data/lib/cms/configure_simple_form_bootstrap.rb +58 -0
- data/lib/cms/content_filter.rb +18 -0
- data/lib/cms/content_page.rb +77 -0
- data/lib/cms/content_rendering_support.rb +114 -0
- data/lib/cms/controllers/admin_controller.rb +78 -0
- data/lib/cms/data_loader.rb +54 -0
- data/lib/cms/date_picker.rb +23 -0
- data/lib/cms/default_accessible.rb +13 -0
- data/lib/cms/domain_support.rb +38 -0
- data/lib/cms/engine.rb +135 -0
- data/lib/cms/engine_helper.rb +103 -0
- data/lib/cms/error_handling.rb +84 -0
- data/lib/cms/error_pages.rb +8 -0
- data/lib/cms/extensions/action_view/base.rb +13 -0
- data/lib/cms/extensions/active_model/name.rb +13 -0
- data/lib/cms/extensions/active_record/base.rb +37 -0
- data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +94 -0
- data/lib/cms/extensions/active_record/errors.rb +12 -0
- data/lib/cms/extensions/active_support/cache/file_store.rb +9 -0
- data/lib/cms/extensions/hash.rb +11 -0
- data/lib/cms/extensions/integer.rb +16 -0
- data/lib/cms/extensions/nil.rb +19 -0
- data/lib/cms/extensions/string.rb +24 -0
- data/lib/cms/extensions.rb +5 -0
- data/lib/cms/form_builder/content_block_form_builder.rb +45 -0
- data/lib/cms/form_builder/default_input.rb +13 -0
- data/lib/cms/form_builder/deprecated_inputs.rb +40 -0
- data/lib/cms/form_builder/workflow_buttons.rb +38 -0
- data/lib/cms/installation_actions.rb +8 -0
- data/lib/cms/mobile_aware.rb +67 -0
- data/lib/cms/module.rb +36 -0
- data/lib/cms/module_installation.rb +31 -0
- data/lib/cms/polymorphic_single_table_inheritance.rb +19 -0
- data/lib/cms/publish_workflow.rb +26 -0
- data/lib/cms/responders/content_responder.rb +14 -0
- data/lib/cms/route_extensions.rb +157 -0
- data/lib/cms/users_service.rb +208 -0
- data/lib/cms/version.rb +11 -0
- data/lib/command_line.rb +39 -0
- data/lib/generators/browser_cms/demo_site/USAGE +3 -0
- data/lib/generators/browser_cms/demo_site/templates/demo.seeds.rb +249 -0
- data/lib/generators/browser_cms/demo_site/templates/demo_site.rake +14 -0
- data/lib/generators/browser_cms/demo_site/templates/logo.jpg +0 -0
- data/lib/generators/browser_cms/demo_site/templates/splash.jpg +0 -0
- data/lib/generators/browser_cms/demo_site/templates/style.css +257 -0
- data/lib/generators/browser_cms.rb +12 -0
- data/lib/generators/cms/content_block/USAGE +22 -0
- data/lib/generators/cms/content_block/content_block_generator.rb +103 -0
- data/lib/generators/cms/content_block/templates/_form.html.erb +27 -0
- data/lib/generators/cms/content_block/templates/application_controller.rb.erb +4 -0
- data/lib/generators/cms/content_block/templates/render.html.erb +23 -0
- data/lib/generators/cms/install/USAGE +8 -0
- data/lib/generators/cms/install/install_generator.rb +16 -0
- data/lib/generators/cms/portlet/USAGE +26 -0
- data/lib/generators/cms/portlet/portlet_generator.rb +38 -0
- data/lib/generators/cms/portlet/templates/_form.html.erb +5 -0
- data/lib/generators/cms/portlet/templates/portlet.rb +12 -0
- data/lib/generators/cms/portlet/templates/portlet_helper.rb +5 -0
- data/lib/generators/cms/portlet/templates/render.html.erb +1 -0
- data/lib/generators/cms/portlet/templates/unit_test.erb +9 -0
- data/lib/generators/cms/project/USAGE +1 -0
- data/lib/generators/cms/project/templates/COPYRIGHT.txt +23 -0
- data/lib/generators/cms/project/templates/GPL.txt +674 -0
- data/lib/generators/cms/project/templates/LICENSE.txt +165 -0
- data/lib/generators/cms/project/templates/USAGE +3 -0
- data/lib/generators/cms/project/templates/devise.rb.erb +7 -0
- data/lib/generators/cms/project/templates/gitignore.erb +11 -0
- data/lib/generators/cms/project/templates/install_generator.erb +21 -0
- data/lib/generators/cms/project/templates/module_tasks.rake +10 -0
- data/lib/generators/cms/template/USAGE +10 -0
- data/lib/generators/cms/template/template_generator.rb +29 -0
- data/lib/generators/cms/template/templates/template.erb +2 -0
- data/lib/sequence.rb +6 -0
- data/lib/tasks/cms.rake +23 -0
- data/lib/templates/active_record/model/model.rb +17 -0
- data/vendor/assets/javascripts/jquery.cookie.js +91 -0
- data/vendor/assets/javascripts/jquery.selectbox.js +209 -0
- metadata +1048 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'cms/module_installation'
|
|
2
|
+
|
|
3
|
+
class <%= module_class %>::InstallGenerator < Cms::ModuleInstallation
|
|
4
|
+
add_migrations_directory_to_source_root __FILE__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def copy_migrations
|
|
8
|
+
rake '<%= current_project %>:install:migrations'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Uncomment to add module specific seed data to a project.
|
|
12
|
+
#def add_seed_data_to_project
|
|
13
|
+
# copy_file "../<%= current_project %>.seeds.rb", "db/<%= current_project %>.seeds.rb"
|
|
14
|
+
# append_to_file "db/seeds.rb", "load File.expand_path('../<%= current_project %>.seeds.rb', __FILE__)\n"
|
|
15
|
+
#end
|
|
16
|
+
|
|
17
|
+
def add_routes
|
|
18
|
+
mount_engine(<%= module_class %>)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Provides tasks to make developing BrowserCMS modules easier.
|
|
2
|
+
# Should not be packaged with the gem.
|
|
3
|
+
namespace :db do
|
|
4
|
+
|
|
5
|
+
# This copy of the core CMS task is necessary because Engines push all existing Rails tasks under app:db:install
|
|
6
|
+
desc 'Creates and populates the initial BrowserCMS database for a new project.'
|
|
7
|
+
task :install => %w{ db:create db:migrate db:seed }
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Cms
|
|
2
|
+
module Generators
|
|
3
|
+
class TemplateGenerator < Rails::Generators::NamedBase
|
|
4
|
+
|
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
6
|
+
class_option :mobile, :type => :boolean, :default => false, :desc => "mobile?"
|
|
7
|
+
|
|
8
|
+
def create_template
|
|
9
|
+
if mobile?
|
|
10
|
+
subdir = 'mobile'
|
|
11
|
+
else
|
|
12
|
+
subdir = 'templates'
|
|
13
|
+
end
|
|
14
|
+
template_dir = "app/views/layouts/#{subdir}"
|
|
15
|
+
template 'template.erb', File.join(template_dir, "#{template_name}.html.erb")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def mobile?
|
|
21
|
+
options[:mobile]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def template_name
|
|
25
|
+
file_name
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/sequence.rb
ADDED
data/lib/tasks/cms.rake
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Provides Rake tasks for BrowserCMS projects.
|
|
2
|
+
|
|
3
|
+
namespace :db do
|
|
4
|
+
|
|
5
|
+
desc "[BrowserCMS] Creates and populates the initial database for a new project."
|
|
6
|
+
task :install => ["db:create", "db:migrate", "db:seed"]
|
|
7
|
+
|
|
8
|
+
desc "[BrowserCMS] Drop, create and migrate the database"
|
|
9
|
+
task :reinstall => ["db:drop", "db:install"]
|
|
10
|
+
|
|
11
|
+
namespace :seed do
|
|
12
|
+
|
|
13
|
+
desc "[BrowserCMS] Loads just the seed data from db/browsercms.seeds.rb"
|
|
14
|
+
task :browsercms => :environment do
|
|
15
|
+
load File.join("db", "browsercms.seeds.rb")
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<% module_namespacing do -%>
|
|
2
|
+
class <%= class_name %> < <%= parent_class_name.classify %>
|
|
3
|
+
<% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
|
|
4
|
+
belongs_to :<%= attribute.name %>
|
|
5
|
+
<% end -%>
|
|
6
|
+
<% # These are BrowserCMS specific extensions to the model generator. -%>
|
|
7
|
+
<% attributes.select {|attr| attr.type == :category }.each do |attribute| -%>
|
|
8
|
+
belongs_to_category
|
|
9
|
+
<% end -%>
|
|
10
|
+
<% attributes.select {|attr| attr.type == :attachment }.each do |attribute| -%>
|
|
11
|
+
has_attachment :<%= attribute.name %>
|
|
12
|
+
<% end -%>
|
|
13
|
+
<% attributes.select {|attr| attr.type == :attachments }.each do |attribute| -%>
|
|
14
|
+
has_many_attachments :<%= attribute.name %>
|
|
15
|
+
<% end -%>
|
|
16
|
+
end
|
|
17
|
+
<% end -%>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*jslint browser: true */ /*global jQuery: true */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* jQuery Cookie plugin
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
|
|
7
|
+
* Dual licensed under the MIT and GPL licenses:
|
|
8
|
+
* http://www.opensource.org/licenses/mit-license.php
|
|
9
|
+
* http://www.gnu.org/licenses/gpl.html
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// TODO JsDoc
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create a cookie with the given key and value and other optional parameters.
|
|
17
|
+
*
|
|
18
|
+
* @example $.cookie('the_cookie', 'the_value');
|
|
19
|
+
* @desc Set the value of a cookie.
|
|
20
|
+
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
|
21
|
+
* @desc Create a cookie with all available options.
|
|
22
|
+
* @example $.cookie('the_cookie', 'the_value');
|
|
23
|
+
* @desc Create a session cookie.
|
|
24
|
+
* @example $.cookie('the_cookie', null);
|
|
25
|
+
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
|
26
|
+
* used when the cookie was set.
|
|
27
|
+
*
|
|
28
|
+
* @param String key The key of the cookie.
|
|
29
|
+
* @param String value The value of the cookie.
|
|
30
|
+
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
|
31
|
+
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
|
32
|
+
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
|
33
|
+
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
|
34
|
+
* when the the browser exits.
|
|
35
|
+
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
|
36
|
+
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
|
37
|
+
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
|
38
|
+
* require a secure protocol (like HTTPS).
|
|
39
|
+
* @type undefined
|
|
40
|
+
*
|
|
41
|
+
* @name $.cookie
|
|
42
|
+
* @cat Plugins/Cookie
|
|
43
|
+
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get the value of a cookie with the given key.
|
|
48
|
+
*
|
|
49
|
+
* @example $.cookie('the_cookie');
|
|
50
|
+
* @desc Get the value of a cookie.
|
|
51
|
+
*
|
|
52
|
+
* @param String key The key of the cookie.
|
|
53
|
+
* @return The value of the cookie.
|
|
54
|
+
* @type String
|
|
55
|
+
*
|
|
56
|
+
* @name $.cookie
|
|
57
|
+
* @cat Plugins/Cookie
|
|
58
|
+
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
|
59
|
+
*/
|
|
60
|
+
jQuery.cookie = function (key, value, options) {
|
|
61
|
+
|
|
62
|
+
// key and at least value given, set cookie...
|
|
63
|
+
if (arguments.length > 1 && String(value) !== "[object Object]") {
|
|
64
|
+
options = jQuery.extend({}, options);
|
|
65
|
+
|
|
66
|
+
if (value === null || value === undefined) {
|
|
67
|
+
options.expires = -1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (typeof options.expires === 'number') {
|
|
71
|
+
var days = options.expires, t = options.expires = new Date();
|
|
72
|
+
t.setDate(t.getDate() + days);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
value = String(value);
|
|
76
|
+
|
|
77
|
+
return (document.cookie = [
|
|
78
|
+
encodeURIComponent(key), '=',
|
|
79
|
+
options.raw ? value : encodeURIComponent(value),
|
|
80
|
+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
|
81
|
+
options.path ? '; path=' + options.path : '',
|
|
82
|
+
options.domain ? '; domain=' + options.domain : '',
|
|
83
|
+
options.secure ? '; secure' : ''
|
|
84
|
+
].join(''));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// key and possibly options given, get cookie...
|
|
88
|
+
options = value || {};
|
|
89
|
+
var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
|
|
90
|
+
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
|
|
91
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* jQuery selectbox plugin
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2007 Sadri Sahraoui (brainfault.com)
|
|
5
|
+
* Licensed under the GPL license and MIT:
|
|
6
|
+
* http://www.opensource.org/licenses/GPL-license.php
|
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
|
8
|
+
*
|
|
9
|
+
* The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete)
|
|
10
|
+
*
|
|
11
|
+
* Revision: $Id$
|
|
12
|
+
* Version: 0.5
|
|
13
|
+
*
|
|
14
|
+
* Changelog :
|
|
15
|
+
* Version 0.5
|
|
16
|
+
* - separate css style for current selected element and hover element which solve the highlight issue
|
|
17
|
+
* Version 0.4
|
|
18
|
+
* - Fix width when the select is in a hidden div @Pawel Maziarz
|
|
19
|
+
* - Add a unique id for generated li to avoid conflict with other selects and empty values @Pawel Maziarz
|
|
20
|
+
*/
|
|
21
|
+
jQuery.fn.extend({
|
|
22
|
+
selectbox: function(options) {
|
|
23
|
+
return this.each(function() {
|
|
24
|
+
new jQuery.SelectBox(this, options);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/* pawel maziarz: work around for ie logging */
|
|
31
|
+
if (!window.console) {
|
|
32
|
+
var console = {
|
|
33
|
+
log: function(msg) {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/* */
|
|
38
|
+
|
|
39
|
+
jQuery.SelectBox = function(selectobj, options) {
|
|
40
|
+
|
|
41
|
+
var opt = options || {};
|
|
42
|
+
opt.inputClass = opt.inputClass || "selectbox";
|
|
43
|
+
opt.containerClass = opt.containerClass || "selectbox-wrapper";
|
|
44
|
+
opt.hoverClass = opt.hoverClass || "current";
|
|
45
|
+
opt.currentClass = opt.selectedClass || "selected"
|
|
46
|
+
opt.debug = opt.debug || false;
|
|
47
|
+
|
|
48
|
+
var elm_id = selectobj.id;
|
|
49
|
+
var active = -1;
|
|
50
|
+
var inFocus = false;
|
|
51
|
+
var hasfocus = 0;
|
|
52
|
+
//jquery object for select element
|
|
53
|
+
var $select = $(selectobj);
|
|
54
|
+
// jquery container object
|
|
55
|
+
var $container = setupContainer(opt);
|
|
56
|
+
//jquery input object
|
|
57
|
+
var $input = setupInput(opt);
|
|
58
|
+
// hide select and append newly created elements
|
|
59
|
+
$select.hide().before($input).before($container);
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
init();
|
|
63
|
+
|
|
64
|
+
$input
|
|
65
|
+
.click(function(){
|
|
66
|
+
if (!inFocus) {
|
|
67
|
+
$container.toggle();
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
.focus(function(){
|
|
71
|
+
if ($container.not(':visible')) {
|
|
72
|
+
inFocus = true;
|
|
73
|
+
$container.show();
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
.keydown(function(event) {
|
|
77
|
+
switch(event.keyCode) {
|
|
78
|
+
case 38: // up
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
moveSelect(-1);
|
|
81
|
+
break;
|
|
82
|
+
case 40: // down
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
moveSelect(1);
|
|
85
|
+
break;
|
|
86
|
+
//case 9: // tab
|
|
87
|
+
case 13: // return
|
|
88
|
+
event.preventDefault(); // seems not working in mac !
|
|
89
|
+
$('li.'+opt.hoverClass).trigger('click');
|
|
90
|
+
break;
|
|
91
|
+
case 27: //escape
|
|
92
|
+
hideMe();
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
.blur(function() {
|
|
97
|
+
if ($container.is(':visible') && hasfocus > 0 ) {
|
|
98
|
+
if(opt.debug) console.log('container visible and has focus')
|
|
99
|
+
} else {
|
|
100
|
+
hideMe();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
function hideMe() {
|
|
106
|
+
hasfocus = 0;
|
|
107
|
+
$container.hide();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function init() {
|
|
111
|
+
$container.append(getSelectOptions($input.attr('id'))).hide();
|
|
112
|
+
var width = opt.width || $input.css('width');
|
|
113
|
+
$container.width(width);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function setupContainer(options) {
|
|
117
|
+
var container = document.createElement("div");
|
|
118
|
+
$container = $(container);
|
|
119
|
+
$container.attr('id', elm_id+'_container');
|
|
120
|
+
$container.addClass(options.containerClass);
|
|
121
|
+
|
|
122
|
+
return $container;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function setupInput(options) {
|
|
126
|
+
var input = document.createElement("input");
|
|
127
|
+
var $input = $(input);
|
|
128
|
+
$input.attr("id", elm_id+"_input");
|
|
129
|
+
$input.attr("type", "text");
|
|
130
|
+
$input.addClass(options.inputClass);
|
|
131
|
+
$input.attr("autocomplete", "off");
|
|
132
|
+
$input.attr("readonly", "readonly");
|
|
133
|
+
$input.attr("tabIndex", $select.attr("tabindex")); // "I" capital is important for ie
|
|
134
|
+
|
|
135
|
+
return $input;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function moveSelect(step) {
|
|
139
|
+
var lis = $("li", $container);
|
|
140
|
+
if (!lis) return;
|
|
141
|
+
|
|
142
|
+
active += step;
|
|
143
|
+
|
|
144
|
+
if (active < 0) {
|
|
145
|
+
active = 0;
|
|
146
|
+
} else if (active >= lis.size()) {
|
|
147
|
+
active = lis.size() - 1;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
lis.removeClass(opt.hoverClass);
|
|
151
|
+
|
|
152
|
+
$(lis[active]).addClass(opt.hoverClass);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function setCurrent() {
|
|
156
|
+
var li = $("li."+opt.currentClass, $container).get(0);
|
|
157
|
+
var el = li.id.replace($select[0].id+'_input_','');
|
|
158
|
+
$select.val(el);
|
|
159
|
+
$select.change(); //trigger the change event for the select
|
|
160
|
+
$input.val($(li).html());
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// select value
|
|
165
|
+
function getCurrentSelected() {
|
|
166
|
+
return $select.val();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// input value
|
|
170
|
+
function getCurrentValue() {
|
|
171
|
+
return $input.val();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function getSelectOptions(parentid) {
|
|
175
|
+
var select_options = new Array();
|
|
176
|
+
var ul = document.createElement('ul');
|
|
177
|
+
$select.children('option').each(function() {
|
|
178
|
+
var li = document.createElement('li');
|
|
179
|
+
li.setAttribute('id', parentid + '_' + $(this).val());
|
|
180
|
+
li.innerHTML = $(this).html();
|
|
181
|
+
if ($(this).is(':selected')) {
|
|
182
|
+
$input.val($(this).html());
|
|
183
|
+
$(li).addClass(opt.currentClass);
|
|
184
|
+
}
|
|
185
|
+
ul.appendChild(li);
|
|
186
|
+
$(li)
|
|
187
|
+
.mouseover(function(event) {
|
|
188
|
+
hasfocus = 1;
|
|
189
|
+
if (opt.debug) console.log('over on : '+this.id);
|
|
190
|
+
jQuery(event.target, $container).addClass(opt.hoverClass);
|
|
191
|
+
})
|
|
192
|
+
.mouseout(function(event) {
|
|
193
|
+
hasfocus = -1;
|
|
194
|
+
if (opt.debug) console.log('out on : '+this.id);
|
|
195
|
+
jQuery(event.target, $container).removeClass(opt.hoverClass);
|
|
196
|
+
})
|
|
197
|
+
.click(function(event) {
|
|
198
|
+
var fl = $('li.'+opt.hoverClass, $container).get(0);
|
|
199
|
+
if (opt.debug) console.log('click on :'+this.id);
|
|
200
|
+
$('li.'+opt.currentClass).removeClass(opt.currentClass);
|
|
201
|
+
$(this).addClass(opt.currentClass);
|
|
202
|
+
setCurrent();
|
|
203
|
+
hideMe();
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
return ul;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
};
|