releaf 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +24 -0
- data/README.md +74 -0
- data/Rakefile +62 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/close.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/loading.gif +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/next.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/prev.png +0 -0
- data/app/assets/images/releaf/add.png +0 -0
- data/app/assets/images/releaf/background.jpg +0 -0
- data/app/assets/images/releaf/button/button_bgr.gif +0 -0
- data/app/assets/images/releaf/button/button_hover_bgr.png +0 -0
- data/app/assets/images/releaf/controllers/content/close.gif +0 -0
- data/app/assets/images/releaf/controllers/content/close_active.gif +0 -0
- data/app/assets/images/releaf/controllers/content/close_hover.gif +0 -0
- data/app/assets/images/releaf/controllers/content/global_fields_bgr.png +0 -0
- data/app/assets/images/releaf/controllers/content/open.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_2.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_active.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_hover.gif +0 -0
- data/app/assets/images/releaf/controllers/sessions/background.jpg +0 -0
- data/app/assets/images/releaf/controllers/sessions/logo.jpg +0 -0
- data/app/assets/images/releaf/expand_tool/close.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_hover.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_hover_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/loader.gif +0 -0
- data/app/assets/images/releaf/expand_tool/open.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_hover.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_hover_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_shim.png +0 -0
- data/app/assets/images/releaf/favicon.ico +0 -0
- data/app/assets/images/releaf/globalFieldContainerBgr.png +0 -0
- data/app/assets/images/releaf/icons/129.png +0 -0
- data/app/assets/images/releaf/icons/130.png +0 -0
- data/app/assets/images/releaf/icons/accept.png +0 -0
- data/app/assets/images/releaf/icons/add.png +0 -0
- data/app/assets/images/releaf/icons/arrow_down.png +0 -0
- data/app/assets/images/releaf/icons/arrow_left.png +0 -0
- data/app/assets/images/releaf/icons/arrow_refresh.png +0 -0
- data/app/assets/images/releaf/icons/arrow_up.png +0 -0
- data/app/assets/images/releaf/icons/bin_empty.png +0 -0
- data/app/assets/images/releaf/icons/bullet_black.png +0 -0
- data/app/assets/images/releaf/icons/bullet_connect.png +0 -0
- data/app/assets/images/releaf/icons/bullet_start.png +0 -0
- data/app/assets/images/releaf/icons/bullet_tick.png +0 -0
- data/app/assets/images/releaf/icons/chrome.png +0 -0
- data/app/assets/images/releaf/icons/control_play.png +0 -0
- data/app/assets/images/releaf/icons/date.png +0 -0
- data/app/assets/images/releaf/icons/delete.png +0 -0
- data/app/assets/images/releaf/icons/disk.png +0 -0
- data/app/assets/images/releaf/icons/drag-handle.png +0 -0
- data/app/assets/images/releaf/icons/error.png +0 -0
- data/app/assets/images/releaf/icons/eye.png +0 -0
- data/app/assets/images/releaf/icons/firefox.png +0 -0
- data/app/assets/images/releaf/icons/google-not-available.gif +0 -0
- data/app/assets/images/releaf/icons/google.gif +0 -0
- data/app/assets/images/releaf/icons/keyboard.png +0 -0
- data/app/assets/images/releaf/icons/left_16.png +0 -0
- data/app/assets/images/releaf/icons/link.png +0 -0
- data/app/assets/images/releaf/icons/magnifier.png +0 -0
- data/app/assets/images/releaf/icons/notAllowed.png +0 -0
- data/app/assets/images/releaf/icons/page_white_add.png +0 -0
- data/app/assets/images/releaf/icons/page_white_edit.png +0 -0
- data/app/assets/images/releaf/icons/page_white_put.png +0 -0
- data/app/assets/images/releaf/icons/page_white_text.png +0 -0
- data/app/assets/images/releaf/icons/pencil.png +0 -0
- data/app/assets/images/releaf/icons/picture.png +0 -0
- data/app/assets/images/releaf/icons/right_16.png +0 -0
- data/app/assets/images/releaf/icons/tick.png +0 -0
- data/app/assets/images/releaf/icons/warning.png +0 -0
- data/app/assets/images/releaf/icons/world_go.png +0 -0
- data/app/assets/images/releaf/icons/world_link.png +0 -0
- data/app/assets/images/releaf/input/autocompleteExpandIcon.png +0 -0
- data/app/assets/images/releaf/input/input_bgr.gif +0 -0
- data/app/assets/images/releaf/language_root.png +0 -0
- data/app/assets/images/releaf/loader.gif +0 -0
- data/app/assets/images/releaf/logout.png +0 -0
- data/app/assets/images/releaf/main_menu/active_bgr.png +0 -0
- data/app/assets/images/releaf/main_menu/bgr.png +0 -0
- data/app/assets/images/releaf/main_menu/hover_bgr.png +0 -0
- data/app/assets/images/releaf/module.png +0 -0
- data/app/assets/images/releaf/panel_layout/active_bgr.png +0 -0
- data/app/assets/images/releaf/panel_layout/secondary_panel_horizontal_bgr.png +0 -0
- data/app/assets/images/releaf/panel_layout/secondary_panel_vertical_bgr.png +0 -0
- data/app/assets/images/releaf/releaf_table/selected_bgr.png +0 -0
- data/app/assets/images/releaf/releaf_table/th_bgr.gif +0 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/README.md +73 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/jquery.cookie.js +47 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/server.js +24 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.html +19 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.js +80 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-ui-timepicker-addon.js +1882 -0
- data/app/assets/javascripts/releaf/3rd_party/lightbox.js.erb +379 -0
- data/app/assets/javascripts/releaf/application.js +14 -0
- data/app/assets/javascripts/releaf/controllers/base.js +170 -0
- data/app/assets/javascripts/releaf/controllers/releaf/content.js +90 -0
- data/app/assets/javascripts/releaf/controllers/releaf/translations.js +31 -0
- data/app/assets/javascripts/releaf/include/continuous_scroll.js +321 -0
- data/app/assets/javascripts/releaf/include/field.type_autocomplete.js +58 -0
- data/app/assets/javascripts/releaf/include/field.type_richtext.js +90 -0
- data/app/assets/javascripts/releaf/include/localization.js +12 -0
- data/app/assets/javascripts/releaf/include/nested_fields.js +71 -0
- data/app/assets/javascripts/releaf/include/sortable.js +27 -0
- data/app/assets/javascripts/releaf/lib/request_url.js +183 -0
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-1.9.2.custom.css.erb +464 -0
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-timepicker-addon.css +10 -0
- data/app/assets/stylesheets/releaf/3rd_party/lightbox.css.erb +157 -0
- data/app/assets/stylesheets/releaf/application.css.erb +122 -0
- data/app/assets/stylesheets/releaf/controllers/base.css.erb +205 -0
- data/app/assets/stylesheets/releaf/controllers/releaf/content.css.erb +416 -0
- data/app/assets/stylesheets/releaf/controllers/releaf/sessions.css.scss.erb +116 -0
- data/app/assets/stylesheets/releaf/controllers/releaf/translations.css.erb +205 -0
- data/app/assets/stylesheets/releaf/include/button.css.erb +176 -0
- data/app/assets/stylesheets/releaf/include/field.css.erb +257 -0
- data/app/assets/stylesheets/releaf/include/input.css.erb +40 -0
- data/app/assets/stylesheets/releaf/include/main_menu.css.erb +66 -0
- data/app/assets/stylesheets/releaf/include/pagination.css.erb +29 -0
- data/app/assets/stylesheets/releaf/include/panel_layout.css.erb +251 -0
- data/app/assets/stylesheets/releaf/include/releaf_table.css.erb +112 -0
- data/app/assets/stylesheets/releaf/include/sortable.css.erb +12 -0
- data/app/controllers/releaf/admins_controller.rb +48 -0
- data/app/controllers/releaf/application_controller.rb +11 -0
- data/app/controllers/releaf/base_application_controller.rb +15 -0
- data/app/controllers/releaf/base_controller.rb +310 -0
- data/app/controllers/releaf/content_controller.rb +166 -0
- data/app/controllers/releaf/roles_controller.rb +36 -0
- data/app/controllers/releaf/sessions_controller.rb +5 -0
- data/app/controllers/releaf/tinymce_assets_controller.rb +26 -0
- data/app/controllers/releaf/translations_controller.rb +121 -0
- data/app/helpers/releaf/admin_helper.rb +79 -0
- data/app/helpers/releaf/application_helper.rb +4 -0
- data/app/helpers/releaf/pagination_renderer.rb +44 -0
- data/app/helpers/releaf/releaf_devise_helper.rb +8 -0
- data/app/models/releaf/admin.rb +51 -0
- data/app/models/releaf/node.rb +221 -0
- data/app/models/releaf/node_base.rb +25 -0
- data/app/models/releaf/role.rb +119 -0
- data/app/models/releaf/tinymce_asset.rb +6 -0
- data/app/views/layouts/releaf/admin.html.haml +51 -0
- data/app/views/releaf/aliases/_edit.body.haml +50 -0
- data/app/views/releaf/aliases/_edit.header.haml +19 -0
- data/app/views/releaf/aliases/_index.row.haml +5 -0
- data/app/views/releaf/aliases/_secondary_panel.haml +13 -0
- data/app/views/releaf/base/_edit.body.haml +19 -0
- data/app/views/releaf/base/_edit.field.haml +96 -0
- data/app/views/releaf/base/_edit.field.type_autocomplete.haml +15 -0
- data/app/views/releaf/base/_edit.field.type_checkbox.haml +5 -0
- data/app/views/releaf/base/_edit.field.type_date.haml +8 -0
- data/app/views/releaf/base/_edit.field.type_datetime.haml +8 -0
- data/app/views/releaf/base/_edit.field.type_delete_nested.haml +3 -0
- data/app/views/releaf/base/_edit.field.type_file.haml +10 -0
- data/app/views/releaf/base/_edit.field.type_image.haml +14 -0
- data/app/views/releaf/base/_edit.field.type_link.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_password.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_richtext.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_richtext_i18n.haml +27 -0
- data/app/views/releaf/base/_edit.field.type_select.haml +11 -0
- data/app/views/releaf/base/_edit.field.type_text.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_text_i18n.haml +27 -0
- data/app/views/releaf/base/_edit.field.type_textarea.haml +4 -0
- data/app/views/releaf/base/_edit.field.type_textarea_i18n.haml +27 -0
- data/app/views/releaf/base/_edit.field.type_time.haml +8 -0
- data/app/views/releaf/base/_edit.footer.haml +14 -0
- data/app/views/releaf/base/_edit.form.haml +4 -0
- data/app/views/releaf/base/_edit.has_many_associations.haml +45 -0
- data/app/views/releaf/base/_edit.header.haml +3 -0
- data/app/views/releaf/base/_index.body.haml +6 -0
- data/app/views/releaf/base/_index.cell.haml +19 -0
- data/app/views/releaf/base/_index.footer.haml +22 -0
- data/app/views/releaf/base/_index.header.haml +4 -0
- data/app/views/releaf/base/_index.row.haml +6 -0
- data/app/views/releaf/base/_index.search.haml +5 -0
- data/app/views/releaf/base/_index.table.haml +8 -0
- data/app/views/releaf/base/_secondary_panel.haml +9 -0
- data/app/views/releaf/base/_show.body.haml +7 -0
- data/app/views/releaf/base/_show.field.haml +78 -0
- data/app/views/releaf/base/_show.field.type_html.haml +1 -0
- data/app/views/releaf/base/_show.footer.haml +16 -0
- data/app/views/releaf/base/_show.header.haml +3 -0
- data/app/views/releaf/base/confirm_destroy.haml +10 -0
- data/app/views/releaf/base/edit.haml +1 -0
- data/app/views/releaf/base/index.haml +3 -0
- data/app/views/releaf/base/new.haml +1 -0
- data/app/views/releaf/base/show.haml +3 -0
- data/app/views/releaf/content/_edit.body.haml +45 -0
- data/app/views/releaf/content/_edit.content_fields.haml +19 -0
- data/app/views/releaf/content/_edit.slug.haml +12 -0
- data/app/views/releaf/content/_get_content_form.haml +7 -0
- data/app/views/releaf/content/_secondary_panel.haml +3 -0
- data/app/views/releaf/content/_show.field.content.haml +11 -0
- data/app/views/releaf/content/_tree_level.haml +16 -0
- data/app/views/releaf/content/ajax.new.haml +3 -0
- data/app/views/releaf/content/index.haml +0 -0
- data/app/views/releaf/roles/_edit.field.admins.haml +0 -0
- data/app/views/releaf/roles/_edit.field.permissions.haml +5 -0
- data/app/views/releaf/roles/_show.field.default.haml +6 -0
- data/app/views/releaf/roles/_show.field.permissions.haml +11 -0
- data/app/views/releaf/sessions/new.html.haml +17 -0
- data/app/views/releaf/translations/_edit.body.haml +50 -0
- data/app/views/releaf/translations/_edit.header.haml +19 -0
- data/app/views/releaf/translations/_index.row.haml +5 -0
- data/app/views/releaf/translations/_secondary_panel.haml +13 -0
- data/bin/releaf +25 -0
- data/lib/generators/releaf/install_generator.rb +87 -0
- data/lib/generators/releaf/templates/config/common_fields.yml.example +17 -0
- data/lib/generators/releaf/templates/controllers/home_controller.rb +4 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/close.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/loading.gif +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/next.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/prev.png +0 -0
- data/lib/generators/releaf/templates/initializers/releaf.rb +59 -0
- data/lib/generators/releaf/templates/initializers/releaf_i18n.rb +8 -0
- data/lib/generators/releaf/templates/initializers/releaf_store_current_template.rb +25 -0
- data/lib/generators/releaf/templates/javascripts/3rd_party/jquery_ui.js +14850 -0
- data/lib/generators/releaf/templates/javascripts/3rd_party/lightbox.js.erb +379 -0
- data/lib/generators/releaf/templates/javascripts/application.js +15 -0
- data/lib/generators/releaf/templates/javascripts/lib/js_check.js +8 -0
- data/lib/generators/releaf/templates/javascripts/lib/request_url.js +169 -0
- data/lib/generators/releaf/templates/javascripts/lib/sortable.js +29 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_admins.rb +53 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_nodes.rb +25 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_roles.rb +11 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_tinymce_assets.rb +10 -0
- data/lib/generators/releaf/templates/migrations/create_releaf_translations.rb +31 -0
- data/lib/generators/releaf/templates/models/admin_ability.rb +51 -0
- data/lib/generators/releaf/templates/seeds.rb +64 -0
- data/lib/generators/releaf/templates/stylesheets/3rd_party/jquery_ui/smoothness.css.erb +1174 -0
- data/lib/generators/releaf/templates/stylesheets/3rd_party/lightbox.css.erb +157 -0
- data/lib/generators/releaf/templates/stylesheets/3rd_party/reset.css +48 -0
- data/lib/generators/releaf/templates/stylesheets/application.scss +15 -0
- data/lib/generators/releaf/templates/stylesheets/style.scss +45 -0
- data/lib/generators/releaf/templates/views/home/index.html.haml +1 -0
- data/lib/generators/releaf/templates/views/layouts/application.html.haml +26 -0
- data/lib/i18n/backend/releaf.rb +96 -0
- data/lib/i18n/backend/releaf/translation.rb +56 -0
- data/lib/i18n/backend/releaf/translation_data.rb +32 -0
- data/lib/i18n/backend/releaf/translation_group.rb +30 -0
- data/lib/i18n/releaf.rb +1 -0
- data/lib/releaf.rb +30 -0
- data/lib/releaf/engine.rb +4 -0
- data/lib/releaf/slug.rb +79 -0
- data/lib/releaf/version.rb +3 -0
- data/lib/tasks/releaf_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/admin_ability.rb +51 -0
- data/spec/dummy/app/models/settings.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.haml +10 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +68 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/common_fields.yml.example +17 -0
- data/spec/dummy/config/database.yml +42 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +232 -0
- data/spec/dummy/config/initializers/dragonfly.rb +1 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/releaf.rb +59 -0
- data/spec/dummy/config/initializers/releaf_i18n.rb +8 -0
- data/spec/dummy/config/initializers/releaf_store_current_template.rb +25 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/devise.en.yml +58 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/spec/dummy/db/migrate/20130204164516_create_settings.rb +17 -0
- data/spec/dummy/db/migrate/20130204164523_create_releaf_nodes.rb +25 -0
- data/spec/dummy/db/migrate/20130204164524_create_releaf_roles.rb +11 -0
- data/spec/dummy/db/migrate/20130204164525_create_releaf_translations.rb +31 -0
- data/spec/dummy/db/migrate/20130204164526_create_releaf_admins.rb +53 -0
- data/spec/dummy/db/schema.rb +112 -0
- data/spec/dummy/db/seeds.rb +64 -0
- data/spec/dummy/doc/README_FOR_APP +2 -0
- data/spec/dummy/log/development.log +74 -0
- data/spec/dummy/log/test.log +129 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/9C5/660/settings%3Ai18n_updated_at +1 -0
- data/spec/factories/factories.rb +24 -0
- data/spec/features/admin_spec.rb +41 -0
- data/spec/spec_helper.rb +23 -0
- data/templates/releaf/installer.rb +196 -0
- metadata +777 -0
@@ -0,0 +1,379 @@
|
|
1
|
+
// Place any jQuery/helper plugins in here.
|
2
|
+
// Lightbox
|
3
|
+
|
4
|
+
/*
|
5
|
+
Lightbox v2.51
|
6
|
+
by Lokesh Dhakar - http://www.lokeshdhakar.com
|
7
|
+
|
8
|
+
For more information, visit:
|
9
|
+
http://lokeshdhakar.com/projects/lightbox2/
|
10
|
+
|
11
|
+
Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
|
12
|
+
- free for use in both personal and commercial projects
|
13
|
+
- attribution requires leaving author name, author link, and the license info intact
|
14
|
+
|
15
|
+
Thanks
|
16
|
+
- Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), and Thomas Fuchs(mir.aculo.us) for ideas, libs, and snippets.
|
17
|
+
- Artemy Tregubenko (arty.name) for cleanup and help in updating to latest proto-aculous in v2.05.
|
18
|
+
|
19
|
+
|
20
|
+
Table of Contents
|
21
|
+
=================
|
22
|
+
LightboxOptions
|
23
|
+
|
24
|
+
Lightbox
|
25
|
+
- constructor
|
26
|
+
- init
|
27
|
+
- enable
|
28
|
+
- build
|
29
|
+
- start
|
30
|
+
- changeImage
|
31
|
+
- sizeContainer
|
32
|
+
- showImage
|
33
|
+
- updateNav
|
34
|
+
- updateDetails
|
35
|
+
- preloadNeigbhoringImages
|
36
|
+
- enableKeyboardNav
|
37
|
+
- disableKeyboardNav
|
38
|
+
- keyboardAction
|
39
|
+
- end
|
40
|
+
|
41
|
+
options = new LightboxOptions
|
42
|
+
lightbox = new Lightbox options
|
43
|
+
*/
|
44
|
+
|
45
|
+
(function() {
|
46
|
+
var $, Lightbox, LightboxOptions;
|
47
|
+
|
48
|
+
$ = jQuery;
|
49
|
+
|
50
|
+
LightboxOptions = (function() {
|
51
|
+
|
52
|
+
function LightboxOptions() {
|
53
|
+
this.fileLoadingImage = '<%= asset_path('3rd_party/lightbox/loading.gif') %>';
|
54
|
+
this.fileCloseImage = '<%= asset_path('3rd_party/lightbox/close.png') %>';
|
55
|
+
this.resizeDuration = 700;
|
56
|
+
this.fadeDuration = 500;
|
57
|
+
this.labelImage = "Image";
|
58
|
+
this.labelOf = "of";
|
59
|
+
}
|
60
|
+
|
61
|
+
return LightboxOptions;
|
62
|
+
|
63
|
+
})();
|
64
|
+
|
65
|
+
Lightbox = (function() {
|
66
|
+
|
67
|
+
function Lightbox(options) {
|
68
|
+
this.options = options;
|
69
|
+
this.album = [];
|
70
|
+
this.currentImageIndex = void 0;
|
71
|
+
this.init();
|
72
|
+
}
|
73
|
+
|
74
|
+
Lightbox.prototype.init = function() {
|
75
|
+
this.enable();
|
76
|
+
return this.build();
|
77
|
+
};
|
78
|
+
|
79
|
+
Lightbox.prototype.enable = function() {
|
80
|
+
var _this = this;
|
81
|
+
return $('body').on('click', 'a[data-lightbox], area[data-lightbox]', function(e) {
|
82
|
+
_this.start($(e.currentTarget));
|
83
|
+
return false;
|
84
|
+
});
|
85
|
+
};
|
86
|
+
|
87
|
+
Lightbox.prototype.build = function() {
|
88
|
+
var $lightbox,
|
89
|
+
_this = this;
|
90
|
+
$("<div>", {
|
91
|
+
id: 'lightboxOverlay'
|
92
|
+
}).after($('<div/>', {
|
93
|
+
id: 'lightbox'
|
94
|
+
}).append($('<div/>', {
|
95
|
+
"class": 'lb-outerContainer'
|
96
|
+
}).append($('<div/>', {
|
97
|
+
"class": 'lb-container'
|
98
|
+
}).append($('<img/>', {
|
99
|
+
"class": 'lb-image'
|
100
|
+
}), $('<div/>', {
|
101
|
+
"class": 'lb-nav'
|
102
|
+
}).append($('<a/>', {
|
103
|
+
"class": 'lb-prev'
|
104
|
+
}), $('<a/>', {
|
105
|
+
"class": 'lb-next'
|
106
|
+
})), $('<div/>', {
|
107
|
+
"class": 'lb-loader'
|
108
|
+
}).append($('<a/>', {
|
109
|
+
"class": 'lb-cancel'
|
110
|
+
}).append($('<img/>', {
|
111
|
+
src: this.options.fileLoadingImage
|
112
|
+
}))))), $('<div/>', {
|
113
|
+
"class": 'lb-dataContainer'
|
114
|
+
}).append($('<div/>', {
|
115
|
+
"class": 'lb-data'
|
116
|
+
}).append($('<div/>', {
|
117
|
+
"class": 'lb-details'
|
118
|
+
}).append($('<span/>', {
|
119
|
+
"class": 'lb-caption'
|
120
|
+
}), $('<span/>', {
|
121
|
+
"class": 'lb-number'
|
122
|
+
})), $('<div/>', {
|
123
|
+
"class": 'lb-closeContainer'
|
124
|
+
}).append($('<a/>', {
|
125
|
+
"class": 'lb-close'
|
126
|
+
}).append($('<img/>', {
|
127
|
+
src: this.options.fileCloseImage
|
128
|
+
}))))))).appendTo($('body'));
|
129
|
+
$('#lightboxOverlay').hide().on('click', function(e) {
|
130
|
+
_this.end();
|
131
|
+
return false;
|
132
|
+
});
|
133
|
+
$lightbox = $('#lightbox');
|
134
|
+
$lightbox.hide().on('click', function(e) {
|
135
|
+
if ($(e.target).attr('id') === 'lightbox') _this.end();
|
136
|
+
return false;
|
137
|
+
});
|
138
|
+
$lightbox.find('.lb-outerContainer').on('click', function(e) {
|
139
|
+
if ($(e.target).attr('id') === 'lightbox') _this.end();
|
140
|
+
return false;
|
141
|
+
});
|
142
|
+
$lightbox.find('.lb-prev').on('click', function(e) {
|
143
|
+
_this.changeImage(_this.currentImageIndex - 1);
|
144
|
+
return false;
|
145
|
+
});
|
146
|
+
$lightbox.find('.lb-next').on('click', function(e) {
|
147
|
+
_this.changeImage(_this.currentImageIndex + 1);
|
148
|
+
return false;
|
149
|
+
});
|
150
|
+
$lightbox.find('.lb-loader, .lb-close').on('click', function(e) {
|
151
|
+
_this.end();
|
152
|
+
return false;
|
153
|
+
});
|
154
|
+
};
|
155
|
+
|
156
|
+
Lightbox.prototype.start = function($link) {
|
157
|
+
var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref;
|
158
|
+
$(window).on("resize", this.sizeOverlay);
|
159
|
+
$('select, object, embed').css({
|
160
|
+
visibility: "hidden"
|
161
|
+
});
|
162
|
+
$('#lightboxOverlay').width($(document).width()).height($(document).height()).fadeIn(this.options.fadeDuration);
|
163
|
+
this.album = [];
|
164
|
+
imageNumber = 0;
|
165
|
+
if ($link.attr('data-lightbox-group') == undefined) {
|
166
|
+
this.album.push({
|
167
|
+
link: $link.attr('href'),
|
168
|
+
title: $link.attr('title')
|
169
|
+
});
|
170
|
+
} else {
|
171
|
+
_ref = $($link.prop("tagName") + '[data-lightbox-group="' + $link.attr('data-lightbox-group') + '"]');
|
172
|
+
for (i = 0, _len = _ref.length; i < _len; i++) {
|
173
|
+
a = _ref[i];
|
174
|
+
this.album.push({
|
175
|
+
link: $(a).attr('href'),
|
176
|
+
title: $(a).attr('title')
|
177
|
+
});
|
178
|
+
if ($(a).attr('href') === $link.attr('href')) imageNumber = i;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
$window = $(window);
|
182
|
+
top = $window.scrollTop() + $window.height() / 10;
|
183
|
+
left = $window.scrollLeft();
|
184
|
+
$lightbox = $('#lightbox');
|
185
|
+
$lightbox.css({
|
186
|
+
top: top + 'px',
|
187
|
+
left: left + 'px'
|
188
|
+
}).fadeIn(this.options.fadeDuration);
|
189
|
+
this.changeImage(imageNumber);
|
190
|
+
};
|
191
|
+
|
192
|
+
Lightbox.prototype.changeImage = function(imageNumber) {
|
193
|
+
var $image, $lightbox, preloader,
|
194
|
+
_this = this;
|
195
|
+
this.disableKeyboardNav();
|
196
|
+
$lightbox = $('#lightbox');
|
197
|
+
$image = $lightbox.find('.lb-image');
|
198
|
+
this.sizeOverlay();
|
199
|
+
$('#lightboxOverlay').fadeIn(this.options.fadeDuration);
|
200
|
+
$('.loader').fadeIn('slow');
|
201
|
+
$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
|
202
|
+
$lightbox.find('.lb-outerContainer').addClass('animating');
|
203
|
+
preloader = new Image;
|
204
|
+
preloader.onload = function() {
|
205
|
+
$image.attr('src', _this.album[imageNumber].link);
|
206
|
+
|
207
|
+
var containerWidth, containerHeight;
|
208
|
+
var doc = {
|
209
|
+
w: $(window).width() - 100,
|
210
|
+
h: $(window).height() - 160
|
211
|
+
};
|
212
|
+
var cont = {
|
213
|
+
w: preloader.width,
|
214
|
+
h: preloader.height
|
215
|
+
};
|
216
|
+
|
217
|
+
var aspect = preloader.width / preloader.height;
|
218
|
+
if(preloader.width > doc.w) {
|
219
|
+
if(doc.w / aspect > doc.h) {
|
220
|
+
cont.w = doc.h * aspect;
|
221
|
+
cont.h = doc.h;
|
222
|
+
} else {
|
223
|
+
cont.w = doc.w;
|
224
|
+
cont.h = doc.w / aspect;
|
225
|
+
}
|
226
|
+
} else if(preloader.height > doc.h) {
|
227
|
+
cont.w = doc.h * aspect;
|
228
|
+
cont.h = doc.h;
|
229
|
+
}
|
230
|
+
$image.css({
|
231
|
+
height: cont.h,
|
232
|
+
width: cont.w
|
233
|
+
});
|
234
|
+
return _this.sizeContainer(cont.w, cont.h);
|
235
|
+
};
|
236
|
+
preloader.src = this.album[imageNumber].link;
|
237
|
+
this.currentImageIndex = imageNumber;
|
238
|
+
};
|
239
|
+
|
240
|
+
Lightbox.prototype.sizeOverlay = function() {
|
241
|
+
return $('#lightboxOverlay').width($(document).width()).height($(document).height());
|
242
|
+
};
|
243
|
+
|
244
|
+
Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
|
245
|
+
var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth,
|
246
|
+
_this = this;
|
247
|
+
$lightbox = $('#lightbox');
|
248
|
+
$outerContainer = $lightbox.find('.lb-outerContainer');
|
249
|
+
oldWidth = $outerContainer.outerWidth();
|
250
|
+
oldHeight = $outerContainer.outerHeight();
|
251
|
+
$container = $lightbox.find('.lb-container');
|
252
|
+
containerTopPadding = parseInt($container.css('padding-top'), 10);
|
253
|
+
containerRightPadding = parseInt($container.css('padding-right'), 10);
|
254
|
+
containerBottomPadding = parseInt($container.css('padding-bottom'), 10);
|
255
|
+
containerLeftPadding = parseInt($container.css('padding-left'), 10);
|
256
|
+
newWidth = imageWidth + containerLeftPadding + containerRightPadding;
|
257
|
+
newHeight = imageHeight + containerTopPadding + containerBottomPadding;
|
258
|
+
if (newWidth !== oldWidth && newHeight !== oldHeight) {
|
259
|
+
$outerContainer.animate({
|
260
|
+
width: newWidth,
|
261
|
+
height: newHeight
|
262
|
+
}, this.options.resizeDuration, 'swing');
|
263
|
+
} else if (newWidth !== oldWidth) {
|
264
|
+
$outerContainer.animate({
|
265
|
+
width: newWidth
|
266
|
+
}, this.options.resizeDuration, 'swing');
|
267
|
+
} else if (newHeight !== oldHeight) {
|
268
|
+
$outerContainer.animate({
|
269
|
+
height: newHeight
|
270
|
+
}, this.options.resizeDuration, 'swing');
|
271
|
+
}
|
272
|
+
setTimeout(function() {
|
273
|
+
$lightbox.find('.lb-dataContainer').width(newWidth);
|
274
|
+
$lightbox.find('.lb-prevLink').height(newHeight);
|
275
|
+
$lightbox.find('.lb-nextLink').height(newHeight);
|
276
|
+
_this.showImage();
|
277
|
+
}, this.options.resizeDuration);
|
278
|
+
};
|
279
|
+
|
280
|
+
Lightbox.prototype.showImage = function() {
|
281
|
+
var $lightbox;
|
282
|
+
$lightbox = $('#lightbox');
|
283
|
+
$lightbox.find('.lb-loader').hide();
|
284
|
+
$lightbox.find('.lb-image').fadeIn('slow');
|
285
|
+
this.updateNav();
|
286
|
+
this.updateDetails();
|
287
|
+
this.preloadNeighboringImages();
|
288
|
+
this.enableKeyboardNav();
|
289
|
+
};
|
290
|
+
|
291
|
+
Lightbox.prototype.updateNav = function() {
|
292
|
+
var $lightbox;
|
293
|
+
$lightbox = $('#lightbox');
|
294
|
+
$lightbox.find('.lb-nav').show();
|
295
|
+
if (this.currentImageIndex > 0) $lightbox.find('.lb-prev').show();
|
296
|
+
if (this.currentImageIndex < this.album.length - 1) {
|
297
|
+
$lightbox.find('.lb-next').show();
|
298
|
+
}
|
299
|
+
};
|
300
|
+
|
301
|
+
Lightbox.prototype.updateDetails = function() {
|
302
|
+
var $lightbox,
|
303
|
+
_this = this;
|
304
|
+
$lightbox = $('#lightbox');
|
305
|
+
if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {
|
306
|
+
$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast');
|
307
|
+
}
|
308
|
+
if (this.album.length > 1) {
|
309
|
+
$lightbox.find('.lb-number').html(this.options.labelImage + ' ' + (this.currentImageIndex + 1) + ' ' + this.options.labelOf + ' ' + this.album.length).fadeIn('fast');
|
310
|
+
} else {
|
311
|
+
$lightbox.find('.lb-number').hide();
|
312
|
+
}
|
313
|
+
$lightbox.find('.lb-outerContainer').removeClass('animating');
|
314
|
+
$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function() {
|
315
|
+
return _this.sizeOverlay();
|
316
|
+
});
|
317
|
+
};
|
318
|
+
|
319
|
+
Lightbox.prototype.preloadNeighboringImages = function() {
|
320
|
+
var preloadNext, preloadPrev;
|
321
|
+
if (this.album.length > this.currentImageIndex + 1) {
|
322
|
+
preloadNext = new Image;
|
323
|
+
preloadNext.src = this.album[this.currentImageIndex + 1].link;
|
324
|
+
}
|
325
|
+
if (this.currentImageIndex > 0) {
|
326
|
+
preloadPrev = new Image;
|
327
|
+
preloadPrev.src = this.album[this.currentImageIndex - 1].link;
|
328
|
+
}
|
329
|
+
};
|
330
|
+
|
331
|
+
Lightbox.prototype.enableKeyboardNav = function() {
|
332
|
+
$(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
|
333
|
+
};
|
334
|
+
|
335
|
+
Lightbox.prototype.disableKeyboardNav = function() {
|
336
|
+
$(document).off('.keyboard');
|
337
|
+
};
|
338
|
+
|
339
|
+
Lightbox.prototype.keyboardAction = function(event) {
|
340
|
+
var KEYCODE_ESC, KEYCODE_LEFTARROW, KEYCODE_RIGHTARROW, key, keycode;
|
341
|
+
KEYCODE_ESC = 27;
|
342
|
+
KEYCODE_LEFTARROW = 37;
|
343
|
+
KEYCODE_RIGHTARROW = 39;
|
344
|
+
keycode = event.keyCode;
|
345
|
+
key = String.fromCharCode(keycode).toLowerCase();
|
346
|
+
if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
|
347
|
+
this.end();
|
348
|
+
} else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {
|
349
|
+
if (this.currentImageIndex !== 0) {
|
350
|
+
this.changeImage(this.currentImageIndex - 1);
|
351
|
+
}
|
352
|
+
} else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {
|
353
|
+
if (this.currentImageIndex !== this.album.length - 1) {
|
354
|
+
this.changeImage(this.currentImageIndex + 1);
|
355
|
+
}
|
356
|
+
}
|
357
|
+
};
|
358
|
+
|
359
|
+
Lightbox.prototype.end = function() {
|
360
|
+
this.disableKeyboardNav();
|
361
|
+
$(window).off("resize", this.sizeOverlay);
|
362
|
+
$('#lightbox').fadeOut(this.options.fadeDuration);
|
363
|
+
$('#lightboxOverlay').fadeOut(this.options.fadeDuration);
|
364
|
+
return $('select, object, embed').css({
|
365
|
+
visibility: "visible"
|
366
|
+
});
|
367
|
+
};
|
368
|
+
|
369
|
+
return Lightbox;
|
370
|
+
|
371
|
+
})();
|
372
|
+
|
373
|
+
$(function() {
|
374
|
+
var lightbox, options;
|
375
|
+
options = new LightboxOptions;
|
376
|
+
return lightbox = new Lightbox(options);
|
377
|
+
});
|
378
|
+
|
379
|
+
}).call(this);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require 3rd_party/jquery_ui
|
@@ -0,0 +1,169 @@
|
|
1
|
+
// EXAMPLE: var newurl = new RequestUrl().add({ 'do': 'import', ajax: 1 }).getUrl();
|
2
|
+
|
3
|
+
// constructor
|
4
|
+
function RequestUrl( params )
|
5
|
+
{
|
6
|
+
if( params === undefined )
|
7
|
+
{
|
8
|
+
params = {};
|
9
|
+
}
|
10
|
+
var keepCurrentQuery = true;
|
11
|
+
if( params === false || params.baseUrl !== undefined )
|
12
|
+
{
|
13
|
+
keepCurrentQuery = false;
|
14
|
+
}
|
15
|
+
if( typeof params == 'string' )
|
16
|
+
{
|
17
|
+
params = { baseUrl: params };
|
18
|
+
}
|
19
|
+
// setup members
|
20
|
+
this.path = '';
|
21
|
+
this.query = {};
|
22
|
+
// get url
|
23
|
+
var baseUrl = params.baseUrl || location.href;
|
24
|
+
// remove anchor
|
25
|
+
baseUrl = baseUrl.split( '#' ).shift();
|
26
|
+
// split url
|
27
|
+
var urlParts = baseUrl.split( '?' );
|
28
|
+
this.path = urlParts.shift();
|
29
|
+
if( keepCurrentQuery && urlParts.length > 0 )
|
30
|
+
{
|
31
|
+
var queryParts = urlParts.shift().split( '&' );
|
32
|
+
for( var i = 0; i < queryParts.length; i++ )
|
33
|
+
{
|
34
|
+
var variable = queryParts[ i ].split( '=' );
|
35
|
+
var name = variable.shift();
|
36
|
+
|
37
|
+
if( variable.length > 0 )
|
38
|
+
{
|
39
|
+
var value = variable.shift();
|
40
|
+
}
|
41
|
+
else
|
42
|
+
{
|
43
|
+
var value = '';
|
44
|
+
}
|
45
|
+
|
46
|
+
if( unescape( name ).substr( unescape( name ).length - 2, 2 ) == '[]' )
|
47
|
+
{
|
48
|
+
name = unescape( name );
|
49
|
+
}
|
50
|
+
|
51
|
+
if( name.substr( name.length - 2, 2 ) == '[]' )
|
52
|
+
{
|
53
|
+
name = name.substr( 0, name.length - 2 );
|
54
|
+
if( this.query[ name ] === undefined || !(this.query[ name ] instanceof Array) )
|
55
|
+
{
|
56
|
+
this.query[ name ] = [];
|
57
|
+
}
|
58
|
+
this.query[ name ].push( value );
|
59
|
+
}
|
60
|
+
else
|
61
|
+
{
|
62
|
+
this.query[ name ] = value;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
if( params.keep !== undefined && params.keep instanceof Array )
|
67
|
+
{
|
68
|
+
var filteredQuery = {};
|
69
|
+
for( var i = 0; i < params.keep.length; i++ )
|
70
|
+
{
|
71
|
+
if( this.query[ params.keep[i] ] !== undefined )
|
72
|
+
{
|
73
|
+
filteredQuery[ params.keep[i] ] = this.query[ params.keep[i] ];
|
74
|
+
}
|
75
|
+
}
|
76
|
+
this.query = filteredQuery;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
RequestUrl.prototype.add = function( params, value )
|
81
|
+
{
|
82
|
+
if( params instanceof Array )
|
83
|
+
{
|
84
|
+
for( var i = 0; i < params.length; i++ )
|
85
|
+
{
|
86
|
+
if( params[ i ].name !== undefined && params[ i ].value !== undefined )
|
87
|
+
{
|
88
|
+
this.query[ params[ i ].name ] = params[ i ].value;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
else if( params instanceof Object )
|
93
|
+
{
|
94
|
+
for( var i in params )
|
95
|
+
{
|
96
|
+
this.query[ i ] = params[ i ];
|
97
|
+
}
|
98
|
+
}
|
99
|
+
else if( typeof params == 'string' )
|
100
|
+
{
|
101
|
+
if( value === undefined )
|
102
|
+
{
|
103
|
+
var temp = new RequestUrl( '?' + params );
|
104
|
+
for( var i in temp.query )
|
105
|
+
{
|
106
|
+
this.query[ i ] = temp.query[i];
|
107
|
+
}
|
108
|
+
}
|
109
|
+
else
|
110
|
+
{
|
111
|
+
this.query[ params ] = value;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
return this;
|
115
|
+
}
|
116
|
+
|
117
|
+
RequestUrl.prototype.removeAll = function( preserveParams )
|
118
|
+
{
|
119
|
+
for( var i in this.query )
|
120
|
+
{
|
121
|
+
if( preserveParams === undefined || jQuery.inArray(i, preserveParams) == -1 )
|
122
|
+
{
|
123
|
+
this.remove(i);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
return this;
|
127
|
+
}
|
128
|
+
|
129
|
+
RequestUrl.prototype.remove = function( name )
|
130
|
+
{
|
131
|
+
delete this.query[ name ];
|
132
|
+
return this;
|
133
|
+
}
|
134
|
+
|
135
|
+
RequestUrl.prototype.get = function( name )
|
136
|
+
{
|
137
|
+
if( this.query[ name ] !== undefined )
|
138
|
+
{
|
139
|
+
return this.query[ name ];
|
140
|
+
}
|
141
|
+
return null;
|
142
|
+
}
|
143
|
+
|
144
|
+
RequestUrl.prototype.getUrl = function()
|
145
|
+
{
|
146
|
+
var query = '';
|
147
|
+
var isFirst = true;
|
148
|
+
for( var i in this.query )
|
149
|
+
{
|
150
|
+
if( !isFirst )
|
151
|
+
{
|
152
|
+
query += '&';
|
153
|
+
}
|
154
|
+
else
|
155
|
+
{
|
156
|
+
isFirst = false;
|
157
|
+
}
|
158
|
+
if( this.query[ i ] instanceof Array )
|
159
|
+
{
|
160
|
+
query += i + '[]=' + this.query[ i ].join( '&' + i + '[]=' );
|
161
|
+
}
|
162
|
+
else
|
163
|
+
{
|
164
|
+
query += i + '=' + this.query[ i ];
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
return this.path + '?' + query;
|
169
|
+
}
|