mail_engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +17 -0
- data/.yardoc/objects/ActionMailer/Base/collect_responses_and_parts_order_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/mail_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/origin_mail_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/set_layout_and_partials_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector/custom_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector.dat +0 -0
- data/.yardoc/objects/ActionMailer.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/acts_as_mail_receiver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/_40_40configurations.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/current_config_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/send_mail_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration/load_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig/create_config_file_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateMigration/create_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateMigration.dat +0 -0
- data/.yardoc/objects/MailEngine/Engine.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/check_21_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/process_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_filename_in_html_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_url_in_html_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber/deliver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods/sendgrid_header_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/InstanceMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/data_3D_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/data_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/initialize_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/validate_config_21_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/blocks_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/bounces_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/invalidemails_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/spamreports_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/stats_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApiError.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/add_sub_val_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/add_to_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/category_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/filters_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/initialize_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/set_unique_args_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_hash_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_json_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_s_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid.dat +0 -0
- data/.yardoc/objects/MailEngine/VERSION.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor/extract_all_files_c.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor.dat +0 -0
- data/.yardoc/objects/MailEngine.dat +0 -0
- data/.yardoc/objects/PLACEHOLDERS_IN_LAYOUT.dat +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +36 -0
- data/Gemfile.lock +159 -0
- data/MIT-LICENSE +20 -0
- data/README.mkd +152 -0
- data/Rakefile +57 -0
- data/VERSION +1 -0
- data/app/controllers/mail_engine/application_controller.rb +7 -0
- data/app/controllers/mail_engine/dashboard_controller.rb +9 -0
- data/app/controllers/mail_engine/mail_logs_controller.rb +20 -0
- data/app/controllers/mail_engine/mail_schedules_controller.rb +56 -0
- data/app/controllers/mail_engine/mail_template_files_controller.rb +46 -0
- data/app/controllers/mail_engine/mail_templates_controller.rb +141 -0
- data/app/controllers/mail_engine/reports_controller.rb +34 -0
- data/app/helpers/mail_engine/mail_engine_helper.rb +30 -0
- data/app/mailers/mail_engine/mail_dispatcher.rb +59 -0
- data/app/models/mail_engine/mail_log.rb +36 -0
- data/app/models/mail_engine/mail_schedule.rb +70 -0
- data/app/models/mail_engine/mail_template.rb +270 -0
- data/app/models/mail_engine/mail_template_file.rb +31 -0
- data/app/models/mail_engine/template_partial.rb +9 -0
- data/app/uploaders/mail_engine/template_file_uploader.rb +47 -0
- data/app/uploaders/mail_engine/zip_file_uploader.rb +47 -0
- data/app/views/layouts/mail_engine/mail_engine.html.erb +112 -0
- data/app/views/layouts/mail_engine/mail_template_layouts/header_and_footer.html.erb +10 -0
- data/app/views/layouts/mail_engine/mail_template_layouts/header_and_footer.text.erb +3 -0
- data/app/views/layouts/mail_engine/mail_template_layouts/none.html.erb +8 -0
- data/app/views/layouts/mail_engine/mail_template_layouts/none.text.erb +1 -0
- data/app/views/layouts/mail_engine/mail_template_layouts/only_footer.html.erb +9 -0
- data/app/views/layouts/mail_engine/mail_template_layouts/only_footer.text.erb +2 -0
- data/app/views/mail_engine/dashboard/index.html.erb +64 -0
- data/app/views/mail_engine/mail_logs/index.html.erb +34 -0
- data/app/views/mail_engine/mail_logs/show.html.erb +38 -0
- data/app/views/mail_engine/mail_schedules/_form.html.erb +45 -0
- data/app/views/mail_engine/mail_schedules/edit.html.erb +16 -0
- data/app/views/mail_engine/mail_schedules/index.html.erb +50 -0
- data/app/views/mail_engine/mail_schedules/new.html.erb +13 -0
- data/app/views/mail_engine/mail_schedules/show.html.erb +44 -0
- data/app/views/mail_engine/mail_template_files/_form.html.erb +28 -0
- data/app/views/mail_engine/mail_template_files/edit.html.erb +9 -0
- data/app/views/mail_engine/mail_template_files/new.html.erb +9 -0
- data/app/views/mail_engine/mail_templates/_form.html.erb +97 -0
- data/app/views/mail_engine/mail_templates/_layout_selector.html.erb +50 -0
- data/app/views/mail_engine/mail_templates/duplicate.html.erb +41 -0
- data/app/views/mail_engine/mail_templates/edit.html.erb +16 -0
- data/app/views/mail_engine/mail_templates/index.html.erb +69 -0
- data/app/views/mail_engine/mail_templates/new.html.erb +12 -0
- data/app/views/mail_engine/mail_templates/new_by_upload.html.erb +63 -0
- data/app/views/mail_engine/mail_templates/partial_options.html.erb +28 -0
- data/app/views/mail_engine/mail_templates/preview.html.erb +1 -0
- data/app/views/mail_engine/mail_templates/preview.text.erb +1 -0
- data/app/views/mail_engine/mail_templates/show.html.erb +64 -0
- data/app/views/mail_engine/reports/charts/blocks.html.erb +21 -0
- data/app/views/mail_engine/reports/charts/bounces.html.erb +21 -0
- data/app/views/mail_engine/reports/charts/invalidemails.html.erb +19 -0
- data/app/views/mail_engine/reports/charts/spamreports.html.erb +17 -0
- data/app/views/mail_engine/reports/index.html.erb +67 -0
- data/config/routes.rb +48 -0
- data/db/migrate/20110114030841_create_table_mail_template.rb +22 -0
- data/db/migrate/20110126030525_create_mail_schedules.rb +21 -0
- data/db/migrate/20110204114145_create_template_partials.rb +13 -0
- data/db/migrate/20110206025002_create_mail_logs.rb +17 -0
- data/db/migrate/20110217062316_create_mail_template_files.rb +14 -0
- data/doc/_index.html +322 -0
- data/doc/class_list.html +36 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +310 -0
- data/doc/file_list.html +38 -0
- data/doc/frames.html +13 -0
- data/doc/js/app.js +203 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +154 -0
- data/doc/method_list.html +283 -0
- data/lib/mail_engine/action_mailer_patch.rb +104 -0
- data/lib/mail_engine/acts_as_mail_receiver.rb +22 -0
- data/lib/mail_engine/base.rb +26 -0
- data/lib/mail_engine/configuration.rb +11 -0
- data/lib/mail_engine/engine.rb +42 -0
- data/lib/mail_engine/generators/create_config.rb +20 -0
- data/lib/mail_engine/generators/create_migration.rb +20 -0
- data/lib/mail_engine/generators/templates/mail_engine_config.yml +14 -0
- data/lib/mail_engine/html_document_assets_replacer.rb +86 -0
- data/lib/mail_engine/mail_log_subscriber.rb +30 -0
- data/lib/mail_engine/placeholders_in_layout.rb +5 -0
- data/lib/mail_engine/sendgrid/base.rb +45 -0
- data/lib/mail_engine/sendgrid/rest_api.rb +85 -0
- data/lib/mail_engine/sendgrid/smtp_api.rb +85 -0
- data/lib/mail_engine/sendgrid.rb +9 -0
- data/lib/mail_engine/tasks/sendmail.rake +8 -0
- data/lib/mail_engine/version.rb +3 -0
- data/lib/mail_engine/zip_processor.rb +51 -0
- data/lib/mail_engine.rb +17 -0
- data/mail_engine.gemspec +422 -0
- data/screenshots/bounce_report.png +0 -0
- data/screenshots/dashboard.png +0 -0
- data/screenshots/editing_mail_template.png +0 -0
- data/screenshots/logs.png +0 -0
- data/screenshots/new_by_upload.png +0 -0
- data/screenshots/reports.png +0 -0
- data/screenshots/schedule.png +0 -0
- data/screenshots/select_layout_partial.png +0 -0
- data/screenshots/templates.png +0 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +11 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/user_mailer.rb +36 -0
- data/test/dummy/app/models/user.rb +10 -0
- data/test/dummy/config/application.rb +52 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +52 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +47 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +43 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/locales/zh.yml +2 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/migrate/20110114030841_create_table_mail_template.rb +22 -0
- data/test/dummy/db/migrate/20110125094530_create_users.rb +16 -0
- data/test/dummy/db/migrate/20110126030525_create_mail_schedules.rb +21 -0
- data/test/dummy/db/migrate/20110204114145_create_template_partials.rb +13 -0
- data/test/dummy/db/migrate/20110206025002_create_mail_logs.rb +17 -0
- data/test/dummy/db/migrate/20110217062316_create_mail_template_files.rb +14 -0
- data/test/dummy/db/schema.rb +78 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/images/mail_engine/header_and_footer_layout.png +0 -0
- data/test/dummy/public/images/mail_engine/logo.gif +0 -0
- data/test/dummy/public/images/mail_engine/logo.png +0 -0
- data/test/dummy/public/images/mail_engine/none_layout.png +0 -0
- data/test/dummy/public/images/mail_engine/only_footer_layout.png +0 -0
- data/test/dummy/public/images/mail_engine/unselect_header_and_footer_layout.png +0 -0
- data/test/dummy/public/images/mail_engine/unselect_none_layout.png +0 -0
- data/test/dummy/public/images/mail_engine/unselect_only_footer_layout.png +0 -0
- data/test/dummy/public/javascripts/jquery.iframe-auto-height.plugin.js +50 -0
- data/test/dummy/public/javascripts/jquery.js +16 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/ajaxLoader.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/close.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/next.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/prev.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal-ie6.js +186 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal-ie6.min.js +9 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal.custom.js +1599 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal.custom.min.js +34 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/styles/nyroModal.css +102 -0
- data/test/dummy/public/javascripts/jquery.string.js +425 -0
- data/test/dummy/public/javascripts/mail_engine_application.js +2 -0
- data/test/dummy/public/javascripts/markitup/jquery.markitup.js +564 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/bold.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/css.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/italic.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/picture.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/tag.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_align_center.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_align_justify.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_align_left.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_align_right.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_indent.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_letterspacing.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_linespacing.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_lowercase.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_padding_bottom.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_padding_left.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_padding_right.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_padding_top.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/images/text_uppercase.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/css/readme.txt +28 -0
- data/test/dummy/public/javascripts/markitup/sets/css/set.js +52 -0
- data/test/dummy/public/javascripts/markitup/sets/css/style.css +72 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/bold.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/clean.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/image.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/italic.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/link.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/picture.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/preview.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/default/set.js +27 -0
- data/test/dummy/public/javascripts/markitup/sets/default/style.css +27 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/bold.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/clean.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/h1.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/h2.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/h3.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/h4.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/h5.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/h6.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/image.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/italic.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/link.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/list-bullet.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/list-item.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/list-numeric.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/paragraph.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/picture.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/preview.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/markitup/sets/html/readme.txt +11 -0
- data/test/dummy/public/javascripts/markitup/sets/html/set.js +40 -0
- data/test/dummy/public/javascripts/markitup/sets/html/style.css +59 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-container.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/handle.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/menu.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/images/submenu.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/markitup/style.css +147 -0
- data/test/dummy/public/javascripts/markitup/skins/simple/images/handle.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/simple/images/menu.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/simple/images/submenu.png +0 -0
- data/test/dummy/public/javascripts/markitup/skins/simple/style.css +118 -0
- data/test/dummy/public/javascripts/markitup/templates/preview.css +5 -0
- data/test/dummy/public/javascripts/markitup/templates/preview.html +11 -0
- data/test/dummy/public/javascripts/rails.js +132 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/public/stylesheets/application.css +0 -0
- data/test/dummy/public/stylesheets/style.css +681 -0
- data/test/dummy/script/rails +6 -0
- data/test/factories.rb +88 -0
- data/test/fixtures/files/compress_by_dir.zip +0 -0
- data/test/fixtures/files/compress_by_file.zip +0 -0
- data/test/fixtures/files/image.png +0 -0
- data/test/functional/mail_engine/mail_dispatcher_test.rb +8 -0
- data/test/functional/mail_engine/mail_schedules_controller_controller_test.rb +8 -0
- data/test/functional/mail_engine/mail_templates_controller_controller_test.rb +8 -0
- data/test/support/integration_case.rb +5 -0
- data/test/test_helper.rb +35 -0
- data/test/unit/mail_engine/mail_log_test.rb +8 -0
- data/test/unit/mail_engine/mail_schedule_test.rb +40 -0
- data/test/unit/mail_engine/mail_template_file_test.rb +21 -0
- data/test/unit/mail_engine/mail_template_test.rb +77 -0
- data/test/unit/mail_engine/template_partial_test.rb +8 -0
- metadata +597 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
/*
|
2
|
+
* nyroModal v2.0.0
|
3
|
+
* Core
|
4
|
+
*
|
5
|
+
*
|
6
|
+
* Included parts:
|
7
|
+
* - anims.fade
|
8
|
+
* - filters.title
|
9
|
+
* - filters.gallery
|
10
|
+
* - filters.link
|
11
|
+
* - filters.dom
|
12
|
+
* - filters.data
|
13
|
+
* - filters.image
|
14
|
+
* - filters.swf
|
15
|
+
* - filters.form
|
16
|
+
* - filters.formFile
|
17
|
+
* - filters.iframe
|
18
|
+
* - filters.iframeForm
|
19
|
+
* - filters.embedly
|
20
|
+
*/
|
21
|
+
jQuery(function($,undefined){var $w=$(window),$d=$(document),$b=$('body'),baseHref=$('base').attr('href'),_nmObj={filters:[],callbacks:{},loadFilter:undefined,modal:false,closeOnEscape:true,closeOnClick:true,useKeyHandler:false,showCloseButton:true,closeButton:'<a href="#" class="nyroModalClose nyroModalCloseButton nmReposition" title="close">Close</a>',stack:false,header:undefined,footer:undefined,galleryLoop:true,galleryCounts:true,ltr:true,imageRegex:'[^\.]\.(jpg|jpeg|png|tiff|gif|bmp)\s*$',selIndicator:'nyroModalSel',swf:{allowFullScreen:'true',allowscriptaccess:'always',wmode:'transparent'},store:{},errorMsg:'An error occured',elts:{all:undefined,bg:undefined,load:undefined,cont:undefined,hidden:undefined},sizes:{initW:undefined,initH:undefined,w:undefined,h:undefined,minW:undefined,minH:undefined,wMargin:undefined,hMargin:undefined},anim:{def:undefined,showBg:undefined,hideBg:undefined,showLoad:undefined,hideLoad:undefined,showCont:undefined,hideCont:undefined,showTrans:undefined,hideTrans:undefined,resize:undefined},_open:false,_bgReady:false,_opened:false,_loading:false,_animated:false,_transition:false,_nmOpener:undefined,_nbContentLoading:0,_scripts:'',_scriptsShown:'',saveObj:function(){this.opener.data('nmObj',this);},open:function(){this.getInternal()._pushStack(this.opener);this._opened=false;this._bgReady=false;this._open=true;this._initElts();this._load();this._nbContentLoading=0;this._callAnim('showBg',$.proxy(function(){this._bgReady=true;if(this._nmOpener){this._nmOpener._close();this._nmOpener._bgReady=false;this._nmOpener._loading=false;this._nmOpener._animated=false;this._nmOpener._opened=false;this._nmOpener._open=false;this._nmOpener.elts.cont=this._nmOpener.elts.hidden=this._nmOpener.elts.load=this._nmOpener.elts.bg=this._nmOpener.elts.all=undefined;this._nmOpener.saveObj();this._nmOpener=undefined;}this._contentLoading();},this));},resize:function(){this.sizes.w=this.sizes.initW;this.sizes.h=this.sizes.initH;this._unreposition();this.size();this._callAnim('resize',$.proxy(function(){this._reposition();},this));},size:function(){var maxHeight=this.getInternal().fullSize.viewH-this.sizes.hMargin,maxWidth=this.getInternal().fullSize.viewW-this.sizes.wMargin;if(this.sizes.minW&&this.sizes.minW>this.sizes.w)this.sizes.w=this.sizes.minW;if(this.sizes.minH&&this.sizes.minH>this.sizes.h)this.sizes.h=this.sizes.minH;if(this.sizes.h>maxHeight||this.sizes.w>maxWidth){this.sizes.h=Math.min(this.sizes.h,maxHeight);this.sizes.w=Math.min(this.sizes.w,maxWidth);}this._callFilters('size');},getForNewLinks:function(){var ret;if(this.stack){ret=$.extend(true,{},this);ret._nmOpener=undefined;ret.elts.all=undefined;}else{ret=$.extend({},this);ret._nmOpener=this;}ret.filters=[];ret.opener=undefined;ret._open=false;return ret;},keyHandle:function(e){this.keyEvent=e;this._callFilters('keyHandle');this.keyEvent=undefined;delete(this.keyEvent);},getInternal:function(){return _internal;},_close:function(){this.getInternal()._removeStack(this.opener);this._opened=false;this._open=false;this._callFilters('close');},close:function(){this._close();this._callFilters('beforeClose');var self=this;this._unreposition();self._callAnim('hideCont',function(){self._callAnim('hideLoad',function(){self._callAnim('hideBg',function(){self._callFilters('afterClose');self.elts.cont.remove();self.elts.hidden.remove();self.elts.load.remove();self.elts.bg.remove();self.elts.all.remove();self.elts.cont=self.elts.hidden=self.elts.load=self.elts.bg=self.elts.all=undefined;});});});},_initElts:function(){if(!this.stack&&this.getInternal().stack.length>1)this.elts=$(_internal.stack[_internal.stack.length-2]).data('nmObj').elts;if(!this.elts.all||this.elts.all.closest('body').length==0)this.elts.all=this.elts.bg=this.elts.cont=this.elts.hidden=this.elts.load=undefined;if(!this.elts.all)this.elts.all=$('<div />').appendTo(this.getInternal()._container);if(!this.elts.bg)this.elts.bg=$('<div />').hide().appendTo(this.elts.all);if(!this.elts.cont)this.elts.cont=$('<div />').hide().appendTo(this.elts.all);if(!this.elts.hidden)this.elts.hidden=$('<div />').hide().appendTo(this.elts.all);this.elts.hidden.empty();if(!this.elts.load)this.elts.load=$('<div />').hide().appendTo(this.elts.all);this._callFilters('initElts');},_error:function(){this._callFilters('error');},_setCont:function(html,selector){if(selector){var tmp=[],i=0;html=html .replace(/\r\n/gi,'nyroModalLN').replace(/<script(.|\s)*?\/script>/gi,function(x){tmp[i]=x;return '<pre class=nyroModalScript rel="'+(i++)+'"></pre>';});var cur=$('<div>'+html+'</div>').find(selector);if(cur.length){html=cur.html().replace(/<pre class="?nyroModalScript"? rel="?(.?)"?><\/pre>/gi,function(x,y,z){return tmp[y];}).replace(/nyroModalLN/gi,"\r\n");}else{this._error();return;}}this.elts.hidden .append(this._filterScripts(html)).prepend(this.header).append(this.footer).wrapInner('<div class="nyroModal'+ucfirst(this.loadFilter)+'" />');this.sizes.initW=this.sizes.w=this.elts.hidden.width();this.sizes.initH=this.sizes.h=this.elts.hidden.height();var outer=this.getInternal()._getOuter(this.elts.cont);this.sizes.hMargin=outer.h.total;this.sizes.wMargin=outer.w.total;this.size();this.loading=false;this._callFilters('filledContent');this._contentLoading();},_filterScripts:function(data){if(typeof data!='string')return data;this._scripts=[];this._scriptsShown=[];var start=0,stStart='<script',stEnd='</script>',endLn=stEnd.length,pos,pos2,tmp;while((pos=data.indexOf(stStart,start))>-1){pos2=data.indexOf(stEnd)+endLn;tmp=$(data.substring(pos,pos2));if(!tmp.attr('src')||tmp.attr('rel')=='forceLoad'){if(tmp.attr('rev')=='shown')this._scriptsShown.push(tmp.get(0));else this._scripts.push(tmp.get(0));}data=data.substring(0,pos)+data.substr(pos2);start=pos;}return data;},_hasFilter:function(filter){var ret=false;$.each(this.filters,function(i,f){ret=ret||f==filter;});return ret;},_delFilter:function(filter){this.filters=$.map(this.filters,function(v){if(v!=filter)return v;});},_callFilters:function(fct){this.getInternal()._debug(fct);var ret=[],self=this;$.each(this.filters,function(i,f){ret[f]=self._callFilter(f,fct);});if(this.callbacks[fct]&&$.isFunction(this.callbacks[fct]))this.callbacks[fct](this);return ret;},_callFilter:function(f,fct){if(_filters[f]&&_filters[f][fct]&&$.isFunction(_filters[f][fct]))return _filters[f][fct](this);return undefined;},_callAnim:function(fct,clb){this.getInternal()._debug(fct);this._callFilters('before'+ucfirst(fct));if(!this._animated){this._animated=true;if(!$.isFunction(clb))clb=$.noop;var set=this.anim[fct]||this.anim.def||'basic';if(!_animations[set]||!_animations[set][fct]||!$.isFunction(_animations[set][fct]))set='basic';_animations[set][fct](this,$.proxy(function(){this._animated=false;this._callFilters('after'+ucfirst(fct));clb();},this));}},_load:function(){this.getInternal()._debug('_load');if(!this.loading&&this.loadFilter){this.loading=true;this._callFilter(this.loadFilter,'load');}},_contentLoading:function(){if(!this._animated&&this._bgReady){if(!this._transition&&this.elts.cont.html().length>0)this._transition=true;this._nbContentLoading++;if(!this.loading){if(!this._opened){this._opened=true;if(this._transition){var fct=$.proxy(function(){this._writeContent();this._callFilters('beforeShowCont');this._callAnim('hideTrans',$.proxy(function(){this._transition=false;this.elts.cont.append(this._scriptsShown);this._reposition();this._callFilters('afterShowCont');},this));},this);if(this._nbContentLoading==1){this._unreposition();this._callAnim('showTrans',fct);}else{fct();}}else{this._callAnim('hideLoad',$.proxy(function(){this._writeContent();this._callAnim('showCont',$.proxy(function(){this.elts.cont.append(this._scriptsShown);this._reposition();},this));},this));}}}else if(this._nbContentLoading==1){var outer=this.getInternal()._getOuter(this.elts.load);this.elts.load .css({position:'fixed',top:(this.getInternal().fullSize.viewH-this.elts.load.height()-outer.h.margin)/2,left:(this.getInternal().fullSize.viewW-this.elts.load.width()-outer.w.margin)/2});if(this._transition){this._unreposition();this._callAnim('showTrans',$.proxy(function(){this._contentLoading();},this));}else{this._callAnim('showLoad',$.proxy(function(){this._contentLoading();},this));}}}},_writeContent:function(){this.elts.cont .empty().append(this.elts.hidden.contents()).append(this._scripts).append(this.showCloseButton?this.closeButton:'').css({position:'fixed',width:this.sizes.w,height:this.sizes.h,top:(this.getInternal().fullSize.viewH-this.sizes.h-this.sizes.hMargin)/2,left:(this.getInternal().fullSize.viewW-this.sizes.w-this.sizes.wMargin)/2});},_reposition:function(){var elts=this.elts.cont.find('.nmReposition');if(elts.length){var space=this.getInternal()._getSpaceReposition();elts.each(function(){var me=$(this),offset=me.offset();me.css({position:'fixed',top:offset.top-space.top,left:offset.left-space.left});});this.elts.cont.after(elts);}this.elts.cont.css('overflow','auto');},_unreposition:function(){this.elts.cont.css('overflow','');var elts=this.elts.all.find('.nmReposition');if(elts.length)this.elts.cont.append(elts.removeAttr('style'));}},_internal={firstInit:true,stack:[],fullSize:{w:0,h:0,wW:0,wH:0,viewW:0,viewH:0},nyroModal:function(opts,fullObj){if(_internal.firstInit){_internal._container=$('<div />').appendTo($b);$w.smartresize($.proxy(_internal._resize,_internal));$d.bind('keydown.nyroModal',$.proxy(_internal._keyHandler,_internal));_internal._calculateFullSize();_internal.firstInit=false;}return this.nmInit(opts,fullObj).each(function(){_internal._init($(this).data('nmObj'));});},nmInit:function(opts,fullObj){return this.each(function(){var me=$(this);if(fullObj)me.data('nmObj',$.extend(true,{opener:me},opts));else me.data('nmObj',me.data('nmObj')?$.extend(true,me.data('nmObj'),opts):$.extend(true,{opener:me},_nmObj,opts));});},nmCall:function(){return this.trigger('nyroModal');},nmManual:function(url,opts){$('<a />',{href:url}).nyroModal(opts).trigger('nyroModal');},nmData:function(data,opts){this.nmManual('#',$.extend({data:data},opts));},nmObj:function(opts){$.extend(true,_nmObj,opts);},nmInternal:function(opts){$.extend(true,_internal,opts);},nmAnims:function(opts){$.extend(true,_animations,opts);},nmFilters:function(opts){$.extend(true,_filters,opts);},nmTop:function(){if(_internal.stack.length)return $(_internal.stack[_internal.stack.length-1]).data('nmObj');return undefined;},_debug:function(msg){if(window.console&&window.console.log)window.console.log(msg);},_container:undefined,_init:function(nm){nm.filters=[];$.each(_filters,function(f,obj){if($.isFunction(obj.is)&&obj.is(nm)){nm.filters.push(f);}});nm._callFilters('init');nm.opener .unbind('nyroModal.nyroModal nmClose.nyroModal nmResize.nyroModal').bind({'nyroModal.nyroModal':function(e){nm.open();return false;},'nmClose.nyroModal':function(){nm.close();return false;},'nmResize.nyroModal':function(){nm.resize();return false;}});},_scrollWidth:(function(){var scrollbarWidth;if($.browser.msie){var $textarea1=$('<textarea cols="10" rows="2"></textarea>').css({position:'absolute',top:-1000,left:-1000}).appendTo($b),$textarea2=$('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:'absolute',top:-1000,left:-1000}).appendTo($b);scrollbarWidth=$textarea1.width()-$textarea2.width();$textarea1.add($textarea2).remove();}else{var $div=$('<div />').css({width:100,height:100,overflow:'auto',position:'absolute',top:-1000,left:-1000}).prependTo($b).append('<div />').find('div').css({width:'100%',height:200});scrollbarWidth=100-$div.width();$div.parent().remove();}return scrollbarWidth;})(),_selNyroModal:function(obj){return $(obj).data('nmObj')?true:false;},_selNyroModalOpen:function(obj){var me=$(obj);return me.data('nmObj')?me.data('nmObj')._open:false;},_keyHandler:function(e){var nmTop=$.nmTop();if(nmTop&&nmTop.useKeyHandler){return nmTop.keyHandle(e);}},_pushStack:function(obj){this.stack=$.map(this.stack,function(elA){if(elA!=obj.get(0))return elA;});this.stack.push(obj.get(0));},_removeStack:function(obj){this.stack=$.map(this.stack,function(elA){if(elA!=obj.get(0))return elA;});},_resize:function(){var opens=$(':nmOpen').each(function(){$(this).data('nmObj')._unreposition();});this._calculateFullSize();opens.trigger('nmResize');},_calculateFullSize:function(){this.fullSize={w:$d.width(),h:$d.height(),wW:$w.width(),wH:$w.height()};this.fullSize.viewW=Math.min(this.fullSize.w,this.fullSize.wW);this.fullSize.viewH=Math.min(this.fullSize.h,this.fullSize.wH);},_getCurCSS:function(elm,name){var ret=parseInt($.curCSS(elm,name,true));return isNaN(ret)?0:ret;},_getOuter:function(elm){elm=elm.get(0);var ret={h:{margin:this._getCurCSS(elm,'marginTop')+this._getCurCSS(elm,'marginBottom'),border:this._getCurCSS(elm,'borderTopWidth')+this._getCurCSS(elm,'borderBottomWidth'),padding:this._getCurCSS(elm,'paddingTop')+this._getCurCSS(elm,'paddingBottom')},w:{margin:this._getCurCSS(elm,'marginLeft')+this._getCurCSS(elm,'marginRight'),border:this._getCurCSS(elm,'borderLeftWidth')+this._getCurCSS(elm,'borderRightWidth'),padding:this._getCurCSS(elm,'paddingLeft')+this._getCurCSS(elm,'paddingRight')}};ret.h.outer=ret.h.margin+ret.h.border;ret.w.outer=ret.w.margin+ret.w.border;ret.h.inner=ret.h.padding+ret.h.border;ret.w.inner=ret.w.padding+ret.w.border;ret.h.total=ret.h.outer+ret.h.padding;ret.w.total=ret.w.outer+ret.w.padding;return ret;},_getSpaceReposition:function(){var outer=this._getOuter($b),ie7=$.browser.msie&&$.browser.version<8&&!(screen.height<=$w.height()+23);return{top:$w.scrollTop()-(!ie7?outer.h.border/2:0),left:$w.scrollLeft()-(!ie7?outer.w.border/2:0)};},_getHash:function(url){if(typeof url=='string'){var hashPos=url.indexOf('#');if(hashPos>-1)return url.substring(hashPos);}return '';},_extractUrl:function(url){var ret={url:undefined,sel:undefined};if(url){var hash=this._getHash(url),hashLoc=this._getHash(window.location.href),curLoc=window.location.href.substring(0,window.location.href.length-hashLoc.length),req=url.substring(0,url.length-hash.length);ret.sel=hash;if(req!=curLoc&&req!=baseHref)ret.url=req;}return ret;}},_animations={basic:{showBg:function(nm,clb){nm.elts.bg.css({opacity:0.7}).show();clb();},hideBg:function(nm,clb){nm.elts.bg.hide();clb();},showLoad:function(nm,clb){nm.elts.load.show();clb();},hideLoad:function(nm,clb){nm.elts.load.hide();clb();},showCont:function(nm,clb){nm.elts.cont.show();clb();},hideCont:function(nm,clb){nm.elts.cont.hide();clb();},showTrans:function(nm,clb){nm.elts.cont.hide();nm.elts.load.show();clb();},hideTrans:function(nm,clb){nm.elts.cont.show();nm.elts.load.hide();clb();},resize:function(nm,clb){nm.elts.cont.css({width:nm.sizes.w,height:nm.sizes.h,top:(nm.getInternal().fullSize.viewH-nm.sizes.h-nm.sizes.hMargin)/2,left:(nm.getInternal().fullSize.viewW-nm.sizes.w-nm.sizes.wMargin)/2});clb();}}},_filters={basic:{is:function(nm){return true;},init:function(nm){if(nm.opener.attr('rev')=='modal')nm.modal=true;if(nm.modal)nm.closeOnEscape=nm.closeOnClick=nm.showCloseButton=false;if(nm.closeOnEscape)nm.useKeyHandler=true;},initElts:function(nm){nm.elts.bg.addClass('nyroModalBg');if(nm.closeOnClick)nm.elts.bg.unbind('click.nyroModal').bind('click.nyroModal',function(e){e.preventDefault();nm.close();});nm.elts.cont.addClass('nyroModalCont');nm.elts.hidden.addClass('nyroModalCont nyroModalHidden');nm.elts.load.addClass('nyroModalCont nyroModalLoad');},error:function(nm){nm.elts.hidden.addClass('nyroModalError');nm.elts.cont.addClass('nyroModalError');nm._setCont(nm.errorMsg);},beforeShowCont:function(nm){nm.elts.cont .find('.nyroModal').nyroModal(nm.getForNewLinks(),true).end().find('.nyroModalClose').bind('click.nyroModal',function(e){e.preventDefault();nm.close();});},keyHandle:function(nm){if(nm.keyEvent.keyCode==27&&nm.closeOnEscape){nm.keyEvent.preventDefault();nm.close();}}},custom:{is:function(nm){return true;}}};$.fn.extend({nm:_internal.nyroModal,nyroModal:_internal.nyroModal,nmInit:_internal.nmInit,nmCall:_internal.nmCall});$.extend({nmManual:_internal.nmManual,nmData:_internal.nmData,nmObj:_internal.nmObj,nmInternal:_internal.nmInternal,nmAnims:_internal.nmAnims,nmFilters:_internal.nmFilters,nmTop:_internal.nmTop});$.expr[':'].nyroModal=$.expr[':'].nm=_internal._selNyroModal;$.expr[':'].nmOpen=_internal._selNyroModalOpen;});(function($,sr){var debounce=function(func,threshold,execAsap){var timeout;return function debounced(){var obj=this,args=arguments;function delayed(){if(!execAsap)func.apply(obj,args);timeout=null;};if(timeout)clearTimeout(timeout);else if(execAsap)func.apply(obj,args);timeout=setTimeout(delayed,threshold||100);};};jQuery.fn[sr]=function(fn){return fn?this.bind('resize',debounce(fn)):this.trigger(sr);};})(jQuery,'smartresize');function ucfirst(str){str+='';var f=str.charAt(0).toUpperCase();return f+str.substr(1);};
|
22
|
+
jQuery(function($,undefined){$.nmAnims({fade:{showBg:function(nm,clb){nm.elts.bg.fadeTo(250,0.7,clb);},hideBg:function(nm,clb){nm.elts.bg.fadeOut(clb);},showLoad:function(nm,clb){nm.elts.load.fadeIn(clb);},hideLoad:function(nm,clb){nm.elts.load.fadeOut(clb);},showCont:function(nm,clb){nm.elts.cont.fadeIn(clb);},hideCont:function(nm,clb){nm.elts.cont.css('overflow','hidden').fadeOut(clb);},showTrans:function(nm,clb){nm.elts.load .css({position:nm.elts.cont.css('position'),top:nm.elts.cont.css('top'),left:nm.elts.cont.css('left'),width:nm.elts.cont.css('width'),height:nm.elts.cont.css('height'),marginTop:nm.elts.cont.css('marginTop'),marginLeft:nm.elts.cont.css('marginLeft')}).fadeIn(function(){nm.elts.cont.hide();clb();});},hideTrans:function(nm,clb){nm.elts.cont.css('visibility','hidden').show();nm.elts.load .css('position',nm.elts.cont.css('position')).animate({top:nm.elts.cont.css('top'),left:nm.elts.cont.css('left'),width:nm.elts.cont.css('width'),height:nm.elts.cont.css('height'),marginTop:nm.elts.cont.css('marginTop'),marginLeft:nm.elts.cont.css('marginLeft')},function(){nm.elts.cont.css('visibility','');nm.elts.load.fadeOut(clb);});},resize:function(nm,clb){nm.elts.cont.animate({width:nm.sizes.w,height:nm.sizes.h,top:(nm.getInternal().fullSize.viewH-nm.sizes.h-nm.sizes.hMargin)/2,left:(nm.getInternal().fullSize.viewW-nm.sizes.w-nm.sizes.wMargin)/2},clb);}}});$.nmObj({anim:{def:'fade'}});});;
|
23
|
+
jQuery(function($,undefined){$.nmFilters({title:{is:function(nm){return nm.opener.is('[title]');},beforeShowCont:function(nm){var offset=nm.elts.cont.offset();nm.store.title=$('<h1 />',{text:nm.opener.attr('title')}).addClass('nyroModalTitle nmReposition');nm.elts.cont.prepend(nm.store.title);},close:function(nm){if(nm.store.title){nm.store.title.remove();nm.store.title=undefined;delete(nm.store.title);}}}});});;
|
24
|
+
jQuery(function($,undefined){$.nmFilters({gallery:{is:function(nm){var ret=nm.opener.is('[rel]:not([rel=external], [rel=nofollow])');if(ret&&nm.galleryCounts&&!nm._hasFilter('title'))nm.filters.push('title');return ret;},init:function(nm){nm.useKeyHandler=true;},keyHandle:function(nm){if(!nm._animated&&nm._opened){if(nm.keyEvent.keyCode==39||nm.keyEvent.keyCode==40){nm.keyEvent.preventDefault();nm._callFilters('galleryNext');}else if(nm.keyEvent.keyCode==37||nm.keyEvent.keyCode==38){nm.keyEvent.preventDefault();nm._callFilters('galleryPrev');}}},initElts:function(nm){var rel=nm.opener.attr('rel'),indexSpace=rel.indexOf(' ');nm.store.gallery=indexSpace>0?rel.substr(0,indexSpace):rel;nm.store.galleryLinks=$('[href][rel="'+nm.store.gallery+'"], [href][rel^="'+nm.store.gallery+' "]');nm.store.galleryIndex=nm.store.galleryLinks.index(nm.opener);},beforeShowCont:function(nm){if(nm.galleryCounts&&nm.store.title&&nm.store.galleryLinks.length>1){var curTitle=nm.store.title.html();nm.store.title.html((curTitle.length?curTitle+' - ':'')+(nm.store.galleryIndex+1)+'/'+nm.store.galleryLinks.length);}},filledContent:function(nm){var link=this._getGalleryLink(nm,-1),append=nm.elts.hidden.find(' > div');if(link){$('<a />',{text:'previous',href:'#'}).addClass('nyroModalPrev').bind('click',function(e){e.preventDefault();nm._callFilters('galleryPrev');}).appendTo(append);}link=this._getGalleryLink(nm,1);if(link){$('<a />',{text:'next',href:'#'}).addClass('nyroModalNext').bind('click',function(e){e.preventDefault();nm._callFilters('galleryNext');}).appendTo(append);}},close:function(nm){nm.store.gallery=undefined;nm.store.galleryLinks=undefined;nm.store.galleryIndex=undefined;delete(nm.store.gallery);delete(nm.store.galleryLinks);delete(nm.store.galleryIndex);if(nm.elts.cont)nm.elts.cont.find('.nyroModalNext, .nyroModalPrev').remove();},galleryNext:function(nm){this._getGalleryLink(nm,1).nyroModal(nm.getForNewLinks(),true).click();},galleryPrev:function(nm){this._getGalleryLink(nm,-1).nyroModal(nm.getForNewLinks(),true).click();},_getGalleryLink:function(nm,dir){if(nm.store.gallery){if(!nm.ltr)dir *=-1;var index=nm.store.galleryIndex+dir;if(index>=0&&index<nm.store.galleryLinks.length)return nm.store.galleryLinks.eq(index);else if(nm.galleryLoop)return nm.store.galleryLinks.eq(index<0?nm.store.galleryLinks.length-1:0);}return undefined;}}});});;
|
25
|
+
jQuery(function($,undefined){$.nmFilters({link:{is:function(nm){var ret=nm.opener.is('[href]');if(ret)nm.store.link=nm.getInternal()._extractUrl(nm.opener.attr('href'));return ret;},init:function(nm){nm.loadFilter='link';nm.opener.unbind('click.nyroModal').bind('click.nyroModal',function(e){e.preventDefault();nm.opener.trigger('nyroModal');});},load:function(nm){$.ajax({url:nm.store.link.url,data:nm.store.link.sel?[{name:nm.selIndicator,value:nm.store.link.sel.substring(1)}]:undefined,success:function(data){nm._setCont(data,nm.store.link.sel);},error:function(){nm._error();}});}}});});;
|
26
|
+
jQuery(function($,undefined){$.nmFilters({dom:{is:function(nm){return nm._hasFilter('link')&&!nm.store.link.url&&nm.store.link.sel;},init:function(nm){nm.loadFilter='dom';},load:function(nm){nm.store.domEl=$(nm.store.link.sel);if(nm.store.domEl.length)nm._setCont(nm.store.domEl.contents());else nm._error();},close:function(nm){if(nm.store.domEl&&nm.elts.cont)nm.store.domEl.append(nm.elts.cont.find('.nyroModalDom').contents());}}});});;
|
27
|
+
jQuery(function($,undefined){$.nmFilters({data:{is:function(nm){var ret=nm.data?true:false;if(ret){nm._delFilter('dom');}return ret;},init:function(nm){nm.loadFilter='data';},load:function(nm){nm._setCont(nm.data);}}});});;
|
28
|
+
jQuery(function($,undefined){$.nmFilters({image:{is:function(nm){return(new RegExp(nm.imageRegex,'i')).test(nm.opener.attr('href'));},init:function(nm){nm.loadFilter='image';},load:function(nm){var url=nm.opener.attr('href');$('<img />').load(function(){nm.elts.cont.addClass('nyroModalImg');nm.elts.hidden.addClass('nyroModalImg');nm._setCont(this);}).error(function(){nm._error();}).attr('src',url);},size:function(nm){if(nm.sizes.w!=nm.sizes.initW||nm.sizes.h!=nm.sizes.initH){var ratio=Math.min(nm.sizes.w/nm.sizes.initW,nm.sizes.h/nm.sizes.initH);nm.sizes.w=nm.sizes.initW * ratio;nm.sizes.h=nm.sizes.initH * ratio;}var img=nm.loading?nm.elts.hidden.find('img'):nm.elts.cont.find('img');img.attr({width:nm.sizes.w,height:nm.sizes.h});},close:function(nm){if(nm.elts.cont){nm.elts.cont.removeClass('nyroModalImg');nm.elts.hidden.removeClass('nyroModalImg');}}}});});;
|
29
|
+
jQuery(function($,undefined){$.nmFilters({swf:{is:function(nm){return nm._hasFilter('link')&&nm.opener.is('[href$=.swf]');},init:function(nm){nm.loadFilter='swf';},load:function(nm){var url=nm.store.link.url,cont='<div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+nm.sizes.w+'" height="'+nm.sizes.h+'"><param name="movie" value="'+url+'"></param>',tmp='';$.each(nm.swf,function(name,val){cont+='<param name="'+name+'" value="'+val+'"></param>';tmp+=' '+name+'="'+val+'"';});cont+='<embed src="'+url+'" type="application/x-shockwave-flash" width="'+nm.sizes.w+'" height="'+nm.sizes.h+'"'+tmp+'></embed></object></div>';nm._setCont(cont);}}});});;
|
30
|
+
jQuery(function($,undefined){$.nmFilters({form:{is:function(nm){var ret=nm.opener.is('form');if(ret)nm.store.form=nm.getInternal()._extractUrl(nm.opener.attr('action'));return ret;},init:function(nm){nm.loadFilter='form';nm.opener.unbind('submit.nyroModal').bind('submit.nyroModal',function(e){e.preventDefault();nm.opener.trigger('nyroModal');});},load:function(nm){var data=nm.opener.serializeArray();if(nm.store.form.sel)data.push({name:nm.selIndicator,value:nm.store.form.sel.substring(1)});$.ajax({url:nm.store.form.url,data:data,type:nm.opener.attr('method')?nm.opener.attr('method'):'get',success:function(data){nm._setCont(data,nm.store.form.sel);},error:function(){nm._error();}});}}});});;
|
31
|
+
jQuery(function($,undefined){$.nmFilters({formFile:{is:function(nm){var ret=nm.opener.is('form[enctype="multipart/form-data"]');if(ret){nm._delFilter('form');if(!nm.store.form)nm.store.form=nm.getInternal()._extractUrl(nm.opener.attr('action'));}return ret;},init:function(nm){nm.loadFilter='formFile';nm.store.formFileLoading=false;nm.opener.unbind('submit.nyroModal').bind('submit.nyroModal',function(e){if(!nm.store.formFileIframe){e.preventDefault();nm.opener.trigger('nyroModal');}else{nm.store.formFileLoading=true;}});},initElts:function(nm){var inputSel;if(nm.store.form.sel)inputSel=$('<input />',{'type':'hidden',name:nm.selIndicator,value:nm.store.form.sel.substring(1)}).appendTo(nm.opener);function rmFormFileElts(){if(inputSel){inputSel.remove();inputSel=undefined;delete(inputSel);}nm.store.formFileIframe.attr('src','about:blank').remove();nm.store.formFileIframe=undefined;delete(nm.store.formFileIframe);}nm.store.formFileIframe=$('<iframe name="nyroModalFormFile" src="javascript:\'\';" id="nyromodal-iframe-'+(new Date().getTime())+'"></iframe>').hide().load(function(){if(nm.store.formFileLoading){nm.store.formFileLoading=false;var content=nm.store.formFileIframe .unbind('load error').contents().find('body').not('script[src]');if(content&&content.html()&&content.html().length){rmFormFileElts();nm._setCont(content.html(),nm.store.form.sel);}else{var nbTry=0;fct=function(){nbTry++;var content=nm.store.formFileIframe .unbind('load error').contents().find('body').not('script[src]');if(content&&content.html()&&content.html().length){nm._setCont(content.html(),nm.store.form.sel);rmFormFileElts();}else if(nbTry<5){setTimeout(fct,25);}else{rmFormFileElts();nm._error();}};setTimeout(fct,25);}}}).error(function(){rmFormFileElts();nm._error();});nm.elts.all.append(nm.store.formFileIframe);nm.opener .attr('target','nyroModalFormFile').submit();},close:function(nm){nm.store.formFileLoading=false;if(nm.store.formFileIframe){nm.store.formFileIframe.remove();nm.store.formFileIframe=undefined;delete(nm.store.formFileIframe);}}}});});;
|
32
|
+
jQuery(function($,undefined){$.nmFilters({iframe:{is:function(nm){var target=nm.opener.attr('target')||'',rel=nm.opener.attr('rel')||'',opener=nm.opener.get(0);return!nm._hasFilter('image')&&(target.toLowerCase()=='_blank'||rel.toLowerCase().indexOf('external')>-1||(opener.hostname&&opener.hostname.replace(/:\d*$/,'')!=window.location.hostname.replace(/:\d*$/,'')));},init:function(nm){nm.loadFilter='iframe';},load:function(nm){nm.store.iframe=$('<iframe src="javascript:\'\';" id="nyromodal-iframe-'+(new Date().getTime())+'"></iframe>');nm._setCont(nm.store.iframe);},afterShowCont:function(nm){nm.store.iframe.attr('src',nm.opener.attr('href'));},close:function(nm){if(nm.store.iframe){nm.store.iframe.remove();nm.store.iframe=undefined;delete(nm.store.iframe);}}}});});;
|
33
|
+
jQuery(function($,undefined){$.nmFilters({iframeForm:{is:function(nm){var ret=nm._hasFilter('iframe')&&nm.opener.is('form');if(ret){nm._delFilter('iframe');nm._delFilter('form');}return ret;},init:function(nm){nm.loadFilter='iframeForm';nm.store.iframeFormLoading=false;nm.store.iframeFormOrgTarget=nm.opener.attr('target');nm.opener.unbind('submit.nyroModal').bind('submit.nyroModal',function(e){if(!nm.store.iframeFormIframe){e.preventDefault();nm.opener.trigger('nyroModal');}else{nm.store.iframeFormLoading=true;}});},load:function(nm){nm.store.iframeFormIframe=$('<iframe name="nyroModalIframeForm" src="javascript:\'\';" id="nyromodal-iframe-'+(new Date().getTime())+'"></iframe>');nm._setCont(nm.store.iframeFormIframe);},afterShowCont:function(nm){nm.opener .attr('target','nyroModalIframeForm').submit();},close:function(nm){nm.store.iframeFormOrgTarget?nm.opener.attr('target',nm.store.iframeFormOrgTarget):nm.opener.removeAttr('target');delete(nm.store.formFileLoading);delete(nm.store.iframeFormOrgTarget);if(nm.store.iframeFormIframe){nm.store.iframeFormIframe.remove();nm.store.iframeFormIframe=undefined;delete(nm.store.iframeFormIframe);}}}});});;
|
34
|
+
jQuery(function($,undefined){$.nmFilters({embedly:{is:function(nm){var embedlyReg= /http:\/\/(.*youtube\.com\/watch.*|.*\.youtube\.com\/v\/.*|youtu\.be\/.*|.*\.youtube\.com\/user\/.*|.*\.youtube\.com\/.*#.*\/.*|m\.youtube\.com\/watch.*|m\.youtube\.com\/index.*|.*\.youtube\.com\/profile.*|.*justin\.tv\/.*|.*justin\.tv\/.*\/b\/.*|.*justin\.tv\/.*\/w\/.*|www\.ustream\.tv\/recorded\/.*|www\.ustream\.tv\/channel\/.*|www\.ustream\.tv\/.*|qik\.com\/video\/.*|qik\.com\/.*|qik\.ly\/.*|.*revision3\.com\/.*|.*\.dailymotion\.com\/video\/.*|.*\.dailymotion\.com\/.*\/video\/.*|www\.collegehumor\.com\/video:.*|.*twitvid\.com\/.*|www\.break\.com\/.*\/.*|vids\.myspace\.com\/index\.cfm\?fuseaction=vids\.individual&videoid.*|www\.myspace\.com\/index\.cfm\?fuseaction=.*&videoid.*|www\.metacafe\.com\/watch\/.*|www\.metacafe\.com\/w\/.*|blip\.tv\/file\/.*|.*\.blip\.tv\/file\/.*|video\.google\.com\/videoplay\?.*|.*revver\.com\/video\/.*|video\.yahoo\.com\/watch\/.*\/.*|video\.yahoo\.com\/network\/.*|.*viddler\.com\/explore\/.*\/videos\/.*|liveleak\.com\/view\?.*|www\.liveleak\.com\/view\?.*|animoto\.com\/play\/.*|dotsub\.com\/view\/.*|www\.overstream\.net\/view\.php\?oid=.*|www\.livestream\.com\/.*|www\.worldstarhiphop\.com\/videos\/video.*\.php\?v=.*|worldstarhiphop\.com\/videos\/video.*\.php\?v=.*|teachertube\.com\/viewVideo\.php.*|www\.teachertube\.com\/viewVideo\.php.*|www1\.teachertube\.com\/viewVideo\.php.*|www2\.teachertube\.com\/viewVideo\.php.*|bambuser\.com\/v\/.*|bambuser\.com\/channel\/.*|bambuser\.com\/channel\/.*\/broadcast\/.*|www\.schooltube\.com\/video\/.*\/.*|bigthink\.com\/ideas\/.*|bigthink\.com\/series\/.*|sendables\.jibjab\.com\/view\/.*|sendables\.jibjab\.com\/originals\/.*|www\.xtranormal\.com\/watch\/.*|dipdive\.com\/media\/.*|dipdive\.com\/member\/.*\/media\/.*|dipdive\.com\/v\/.*|.*\.dipdive\.com\/media\/.*|.*\.dipdive\.com\/v\/.*|.*yfrog\..*\/.*|tweetphoto\.com\/.*|www\.flickr\.com\/photos\/.*|flic\.kr\/.*|twitpic\.com\/.*|www\.twitpic\.com\/.*|twitpic\.com\/photos\/.*|www\.twitpic\.com\/photos\/.*|.*imgur\.com\/.*|.*\.posterous\.com\/.*|post\.ly\/.*|twitgoo\.com\/.*|i.*\.photobucket\.com\/albums\/.*|s.*\.photobucket\.com\/albums\/.*|phodroid\.com\/.*\/.*\/.*|www\.mobypicture\.com\/user\/.*\/view\/.*|moby\.to\/.*|xkcd\.com\/.*|www\.xkcd\.com\/.*|imgs\.xkcd\.com\/.*|www\.asofterworld\.com\/index\.php\?id=.*|www\.asofterworld\.com\/.*\.jpg|asofterworld\.com\/.*\.jpg|www\.qwantz\.com\/index\.php\?comic=.*|23hq\.com\/.*\/photo\/.*|www\.23hq\.com\/.*\/photo\/.*|.*dribbble\.com\/shots\/.*|drbl\.in\/.*|.*\.smugmug\.com\/.*|.*\.smugmug\.com\/.*#.*|emberapp\.com\/.*\/images\/.*|emberapp\.com\/.*\/images\/.*\/sizes\/.*|emberapp\.com\/.*\/collections\/.*\/.*|emberapp\.com\/.*\/categories\/.*\/.*\/.*|embr\.it\/.*|picasaweb\.google\.com.*\/.*\/.*#.*|picasaweb\.google\.com.*\/lh\/photo\/.*|picasaweb\.google\.com.*\/.*\/.*|dailybooth\.com\/.*\/.*|brizzly\.com\/pic\/.*|pics\.brizzly\.com\/.*\.jpg|img\.ly\/.*|www\.tinypic\.com\/view\.php.*|tinypic\.com\/view\.php.*|www\.tinypic\.com\/player\.php.*|tinypic\.com\/player\.php.*|www\.tinypic\.com\/r\/.*\/.*|tinypic\.com\/r\/.*\/.*|.*\.tinypic\.com\/.*\.jpg|.*\.tinypic\.com\/.*\.png|meadd\.com\/.*\/.*|meadd\.com\/.*|.*\.deviantart\.com\/art\/.*|.*\.deviantart\.com\/gallery\/.*|.*\.deviantart\.com\/#\/.*|fav\.me\/.*|.*\.deviantart\.com|.*\.deviantart\.com\/gallery|.*\.deviantart\.com\/.*\/.*\.jpg|.*\.deviantart\.com\/.*\/.*\.gif|.*\.deviantart\.net\/.*\/.*\.jpg|.*\.deviantart\.net\/.*\/.*\.gif|plixi\.com\/p\/.*|plixi\.com\/profile\/home\/.*|plixi\.com\/.*|www\.fotopedia\.com\/.*\/.*|fotopedia\.com\/.*\/.*|photozou\.jp\/photo\/show\/.*\/.*|photozou\.jp\/photo\/photo_only\/.*\/.*|instagr\.am\/p\/.*|skitch\.com\/.*\/.*\/.*|img\.skitch\.com\/.*|https:\/\/skitch\.com\/.*\/.*\/.*|https:\/\/img\.skitch\.com\/.*|share\.ovi\.com\/media\/.*\/.*|www\.questionablecontent\.net\/|questionablecontent\.net\/|www\.questionablecontent\.net\/view\.php.*|questionablecontent\.net\/view\.php.*|questionablecontent\.net\/comics\/.*\.png|www\.questionablecontent\.net\/comics\/.*\.png|picplz\.com\/user\/.*\/pic\/.*\/|twitrpix\.com\/.*|.*\.twitrpix\.com\/.*|www\.someecards\.com\/.*\/.*|someecards\.com\/.*\/.*|some\.ly\/.*|www\.some\.ly\/.*|pikchur\.com\/.*|achewood\.com\/.*|www\.achewood\.com\/.*|achewood\.com\/index\.php.*|www\.achewood\.com\/index\.php.*|www\.whitehouse\.gov\/photos-and-video\/video\/.*|www\.whitehouse\.gov\/video\/.*|wh\.gov\/photos-and-video\/video\/.*|wh\.gov\/video\/.*|www\.hulu\.com\/watch.*|www\.hulu\.com\/w\/.*|hulu\.com\/watch.*|hulu\.com\/w\/.*|.*crackle\.com\/c\/.*|www\.fancast\.com\/.*\/videos|www\.funnyordie\.com\/videos\/.*|www\.funnyordie\.com\/m\/.*|funnyordie\.com\/videos\/.*|funnyordie\.com\/m\/.*|www\.vimeo\.com\/groups\/.*\/videos\/.*|www\.vimeo\.com\/.*|vimeo\.com\/m\/#\/featured\/.*|vimeo\.com\/groups\/.*\/videos\/.*|vimeo\.com\/.*|vimeo\.com\/m\/#\/featured\/.*|www\.ted\.com\/talks\/.*\.html.*|www\.ted\.com\/talks\/lang\/.*\/.*\.html.*|www\.ted\.com\/index\.php\/talks\/.*\.html.*|www\.ted\.com\/index\.php\/talks\/lang\/.*\/.*\.html.*|.*nfb\.ca\/film\/.*|www\.thedailyshow\.com\/watch\/.*|www\.thedailyshow\.com\/full-episodes\/.*|www\.thedailyshow\.com\/collection\/.*\/.*\/.*|movies\.yahoo\.com\/movie\/.*\/video\/.*|movies\.yahoo\.com\/movie\/.*\/trailer|movies\.yahoo\.com\/movie\/.*\/video|www\.colbertnation\.com\/the-colbert-report-collections\/.*|www\.colbertnation\.com\/full-episodes\/.*|www\.colbertnation\.com\/the-colbert-report-videos\/.*|www\.comedycentral\.com\/videos\/index\.jhtml\?.*|www\.theonion\.com\/video\/.*|theonion\.com\/video\/.*|wordpress\.tv\/.*\/.*\/.*\/.*\/|www\.traileraddict\.com\/trailer\/.*|www\.traileraddict\.com\/clip\/.*|www\.traileraddict\.com\/poster\/.*|www\.escapistmagazine\.com\/videos\/.*|www\.trailerspy\.com\/trailer\/.*\/.*|www\.trailerspy\.com\/trailer\/.*|www\.trailerspy\.com\/view_video\.php.*|www\.atom\.com\/.*\/.*\/|fora\.tv\/.*\/.*\/.*\/.*|www\.spike\.com\/video\/.*|www\.gametrailers\.com\/video\/.*|gametrailers\.com\/video\/.*|www\.koldcast\.tv\/video\/.*|www\.koldcast\.tv\/#video:.*|techcrunch\.tv\/watch.*|techcrunch\.tv\/.*\/watch.*|mixergy\.com\/.*|video\.pbs\.org\/video\/.*|www\.zapiks\.com\/.*|tv\.digg\.com\/diggnation\/.*|tv\.digg\.com\/diggreel\/.*|tv\.digg\.com\/diggdialogg\/.*|www\.trutv\.com\/video\/.*|www\.nzonscreen\.com\/title\/.*|nzonscreen\.com\/title\/.*|app\.wistia\.com\/embed\/medias\/.*|https:\/\/app\.wistia\.com\/embed\/medias\/.*|www\.godtube\.com\/featured\/video\/.*|godtube\.com\/featured\/video\/.*|www\.godtube\.com\/watch\/.*|godtube\.com\/watch\/.*|www\.tangle\.com\/view_video.*|mediamatters\.org\/mmtv\/.*|www\.clikthrough\.com\/theater\/video\/.*|soundcloud\.com\/.*|soundcloud\.com\/.*\/.*|soundcloud\.com\/.*\/sets\/.*|soundcloud\.com\/groups\/.*|snd\.sc\/.*|www\.last\.fm\/music\/.*|www\.last\.fm\/music\/+videos\/.*|www\.last\.fm\/music\/+images\/.*|www\.last\.fm\/music\/.*\/_\/.*|www\.last\.fm\/music\/.*\/.*|www\.mixcloud\.com\/.*\/.*\/|www\.radionomy\.com\/.*\/radio\/.*|radionomy\.com\/.*\/radio\/.*|www\.entertonement\.com\/clips\/.*|www\.rdio\.com\/#\/artist\/.*\/album\/.*|www\.rdio\.com\/artist\/.*\/album\/.*|www\.zero-inch\.com\/.*|.*\.bandcamp\.com\/|.*\.bandcamp\.com\/track\/.*|.*\.bandcamp\.com\/album\/.*|freemusicarchive\.org\/music\/.*|www\.freemusicarchive\.org\/music\/.*|freemusicarchive\.org\/curator\/.*|www\.freemusicarchive\.org\/curator\/.*|www\.npr\.org\/.*\/.*\/.*\/.*\/.*|www\.npr\.org\/.*\/.*\/.*\/.*\/.*\/.*|www\.npr\.org\/.*\/.*\/.*\/.*\/.*\/.*\/.*|www\.npr\.org\/templates\/story\/story\.php.*|huffduffer\.com\/.*\/.*|www\.audioboo\.fm\/boos\/.*|audioboo\.fm\/boos\/.*|boo\.fm\/b.*|www\.xiami\.com\/song\/.*|xiami\.com\/song\/.*|espn\.go\.com\/video\/clip.*|espn\.go\.com\/.*\/story.*|abcnews\.com\/.*\/video\/.*|abcnews\.com\/video\/playerIndex.*|washingtonpost\.com\/wp-dyn\/.*\/video\/.*\/.*\/.*\/.*|www\.washingtonpost\.com\/wp-dyn\/.*\/video\/.*\/.*\/.*\/.*|www\.boston\.com\/video.*|boston\.com\/video.*|www\.facebook\.com\/photo\.php.*|www\.facebook\.com\/video\/video\.php.*|www\.facebook\.com\/v\/.*|cnbc\.com\/id\/.*\?.*video.*|www\.cnbc\.com\/id\/.*\?.*video.*|cnbc\.com\/id\/.*\/play\/1\/video\/.*|www\.cnbc\.com\/id\/.*\/play\/1\/video\/.*|cbsnews\.com\/video\/watch\/.*|www\.google\.com\/buzz\/.*\/.*\/.*|www\.google\.com\/buzz\/.*|www\.google\.com\/profiles\/.*|google\.com\/buzz\/.*\/.*\/.*|google\.com\/buzz\/.*|google\.com\/profiles\/.*|www\.cnn\.com\/video\/.*|edition\.cnn\.com\/video\/.*|money\.cnn\.com\/video\/.*|today\.msnbc\.msn\.com\/id\/.*\/vp\/.*|www\.msnbc\.msn\.com\/id\/.*\/vp\/.*|www\.msnbc\.msn\.com\/id\/.*\/ns\/.*|today\.msnbc\.msn\.com\/id\/.*\/ns\/.*|multimedia\.foxsports\.com\/m\/video\/.*\/.*|msn\.foxsports\.com\/video.*|www\.globalpost\.com\/video\/.*|www\.globalpost\.com\/dispatch\/.*|.*amazon\..*\/gp\/product\/.*|.*amazon\..*\/.*\/dp\/.*|.*amazon\..*\/dp\/.*|.*amazon\..*\/o\/ASIN\/.*|.*amazon\..*\/gp\/offer-listing\/.*|.*amazon\..*\/.*\/ASIN\/.*|.*amazon\..*\/gp\/product\/images\/.*|www\.amzn\.com\/.*|amzn\.com\/.*|www\.shopstyle\.com\/browse.*|www\.shopstyle\.com\/action\/apiVisitRetailer.*|www\.shopstyle\.com\/action\/viewLook.*|gist\.github\.com\/.*|twitter\.com\/.*\/status\/.*|twitter\.com\/.*\/statuses\/.*|mobile\.twitter\.com\/.*\/status\/.*|mobile\.twitter\.com\/.*\/statuses\/.*|www\.crunchbase\.com\/.*\/.*|crunchbase\.com\/.*\/.*|www\.slideshare\.net\/.*\/.*|www\.slideshare\.net\/mobile\/.*\/.*|.*\.scribd\.com\/doc\/.*|screenr\.com\/.*|polldaddy\.com\/community\/poll\/.*|polldaddy\.com\/poll\/.*|answers\.polldaddy\.com\/poll\/.*|www\.5min\.com\/Video\/.*|www\.howcast\.com\/videos\/.*|www\.screencast\.com\/.*\/media\/.*|screencast\.com\/.*\/media\/.*|www\.screencast\.com\/t\/.*|screencast\.com\/t\/.*|issuu\.com\/.*\/docs\/.*|www\.kickstarter\.com\/projects\/.*\/.*|www\.scrapblog\.com\/viewer\/viewer\.aspx.*|ping\.fm\/p\/.*|chart\.ly\/.*|maps\.google\.com\/maps\?.*|maps\.google\.com\/\?.*|maps\.google\.com\/maps\/ms\?.*|.*\.craigslist\.org\/.*\/.*|my\.opera\.com\/.*\/albums\/show\.dml\?id=.*|my\.opera\.com\/.*\/albums\/showpic\.dml\?album=.*&picture=.*|tumblr\.com\/.*|.*\.tumblr\.com\/post\/.*|www\.polleverywhere\.com\/polls\/.*|www\.polleverywhere\.com\/multiple_choice_polls\/.*|www\.polleverywhere\.com\/free_text_polls\/.*|www\.quantcast\.com\/wd:.*|www\.quantcast\.com\/.*|siteanalytics\.compete\.com\/.*|statsheet\.com\/statplot\/charts\/.*\/.*\/.*\/.*|statsheet\.com\/statplot\/charts\/e\/.*|statsheet\.com\/.*\/teams\/.*\/.*|statsheet\.com\/tools\/chartlets\?chart=.*|.*\.status\.net\/notice\/.*|identi\.ca\/notice\/.*|brainbird\.net\/notice\/.*|shitmydadsays\.com\/notice\/.*|www\.studivz\.net\/Profile\/.*|www\.studivz\.net\/l\/.*|www\.studivz\.net\/Groups\/Overview\/.*|www\.studivz\.net\/Gadgets\/Info\/.*|www\.studivz\.net\/Gadgets\/Install\/.*|www\.studivz\.net\/.*|www\.meinvz\.net\/Profile\/.*|www\.meinvz\.net\/l\/.*|www\.meinvz\.net\/Groups\/Overview\/.*|www\.meinvz\.net\/Gadgets\/Info\/.*|www\.meinvz\.net\/Gadgets\/Install\/.*|www\.meinvz\.net\/.*|www\.schuelervz\.net\/Profile\/.*|www\.schuelervz\.net\/l\/.*|www\.schuelervz\.net\/Groups\/Overview\/.*|www\.schuelervz\.net\/Gadgets\/Info\/.*|www\.schuelervz\.net\/Gadgets\/Install\/.*|www\.schuelervz\.net\/.*|myloc\.me\/.*|pastebin\.com\/.*|pastie\.org\/.*|www\.pastie\.org\/.*|redux\.com\/stream\/item\/.*\/.*|redux\.com\/f\/.*\/.*|www\.redux\.com\/stream\/item\/.*\/.*|www\.redux\.com\/f\/.*\/.*|cl\.ly\/.*|cl\.ly\/.*\/content|speakerdeck\.com\/u\/.*\/p\/.*|www\.kiva\.org\/lend\/.*|www\.timetoast\.com\/timelines\/.*|storify\.com\/.*\/.*|.*meetup\.com\/.*|meetu\.ps\/.*|www\.dailymile\.com\/people\/.*\/entries\/.*|.*\.kinomap\.com\/.*|www\.metacdn\.com\/api\/users\/.*\/content\/.*|www\.metacdn\.com\/api\/users\/.*\/media\/.*|prezi\.com\/.*\/.*|.*\.uservoice\.com\/.*\/suggestions\/.*)/i;var ret=nm._hasFilter('link')&&nm.opener.attr('href')&&nm.opener.attr('href').match(embedlyReg)!==null;if(ret)nm._delFilter('iframe');return ret;},init:function(nm){nm.loadFilter='embedly';nm.store.embedly={};},load:function(nm){$.ajax({url:'http://api.embed.ly/1/oembed',dataType:'jsonp',data:'wmode=transparent&url='+nm.opener.attr('href'),success:function(data){if(data.type=='error')nm._error();else if(data.type=='photo'){nm.filters.push('image');$('<img />').load(function(){nm.elts.cont.addClass('nyroModalImg');nm.elts.hidden.addClass('nyroModalImg');nm._setCont(this);}).error(function(){nm._error();}).attr('src',data.url);}else{nm.store.embedly.w=data.width;nm.store.embedly.h=data.height;nm._setCont('<div>'+data.html+'</div>');}}});},size:function(nm){if(nm.store.embedly.w&&!nm.sizes.h){nm.sizes.w=nm.store.embedly.w;nm.sizes.h=nm.store.embedly.h;}}}});});;
|
@@ -0,0 +1,102 @@
|
|
1
|
+
.nyroModalBg {
|
2
|
+
position: fixed;
|
3
|
+
overflow: hidden;
|
4
|
+
top: 0;
|
5
|
+
left: 0;
|
6
|
+
height: 100%;
|
7
|
+
width: 100%;
|
8
|
+
background: #000;
|
9
|
+
opacity: 0.7;
|
10
|
+
}
|
11
|
+
.nmReposition {
|
12
|
+
position: absolute;
|
13
|
+
}
|
14
|
+
.nyroModalCloseButton {
|
15
|
+
top: -13px;
|
16
|
+
right: -13px;
|
17
|
+
width: 12px;
|
18
|
+
height: 12px;
|
19
|
+
text-indent: -9999em;
|
20
|
+
background: url(../img/close.gif);
|
21
|
+
}
|
22
|
+
.nyroModalTitle {
|
23
|
+
top: -26px;
|
24
|
+
left: 0;
|
25
|
+
margin: 0;
|
26
|
+
font-size: 1.1em;
|
27
|
+
color: #ddd;
|
28
|
+
}
|
29
|
+
.nyroModalCont {
|
30
|
+
position: absolute;
|
31
|
+
border: 4px solid #777;
|
32
|
+
margin: 25px;
|
33
|
+
background: #fff;
|
34
|
+
}
|
35
|
+
.nyroModalCont iframe {
|
36
|
+
width: 600px;
|
37
|
+
height: 400px;
|
38
|
+
}
|
39
|
+
.nyroModalError {
|
40
|
+
border: 4px solid red;
|
41
|
+
color: red;
|
42
|
+
width: 250px;
|
43
|
+
height: 250px;
|
44
|
+
}
|
45
|
+
.nyroModalError div {
|
46
|
+
min-width: 0;
|
47
|
+
min-height: 0;
|
48
|
+
padding: 10px;
|
49
|
+
}
|
50
|
+
.nyroModalLink, .nyroModalDom, .nyroModalForm, .nyroModalFormFile {
|
51
|
+
position: relative;
|
52
|
+
padding: 10px;
|
53
|
+
min-height: 250px;
|
54
|
+
min-width: 250px;
|
55
|
+
max-width: 1000px;
|
56
|
+
}
|
57
|
+
.nyroModalImage, .nyroModalSwf, .nyroModalIframe, .nyroModalIframeForm {
|
58
|
+
position: relative;
|
59
|
+
overflow: hidden;
|
60
|
+
}
|
61
|
+
.nyroModalHidden {
|
62
|
+
left: -9999em;
|
63
|
+
top: -9999em;
|
64
|
+
}
|
65
|
+
.nyroModalLoad {
|
66
|
+
position: absolute;
|
67
|
+
width: 100px;
|
68
|
+
height: 100px;
|
69
|
+
background: #fff url(../img/ajaxLoader.gif) no-repeat center;
|
70
|
+
padding: 0;
|
71
|
+
}
|
72
|
+
.nyroModalPrev, .nyroModalNext {
|
73
|
+
outline: none;
|
74
|
+
position: absolute;
|
75
|
+
top: 0;
|
76
|
+
height: 60%;
|
77
|
+
width: 150px;
|
78
|
+
min-height: 50px;
|
79
|
+
max-height: 300px;
|
80
|
+
cursor: pointer;
|
81
|
+
text-indent: -9999em;
|
82
|
+
background: transparent url('data:image/gif;base64,AAAA') left 20% no-repeat;
|
83
|
+
}
|
84
|
+
.nyroModalImage .nyroModalPrev, .nyroModalImage .nyroModalNext {
|
85
|
+
height: 100%;
|
86
|
+
width: 40%;
|
87
|
+
max-height: none;
|
88
|
+
}
|
89
|
+
.nyroModalPrev {
|
90
|
+
left: 0;
|
91
|
+
}
|
92
|
+
.nyroModalPrev:hover {
|
93
|
+
background-image: url(../img/prev.gif);
|
94
|
+
}
|
95
|
+
.nyroModalNext {
|
96
|
+
right: 0;
|
97
|
+
background-position: right 20%;
|
98
|
+
}
|
99
|
+
.nyroModalNext:hover {
|
100
|
+
background-position: right 20%;
|
101
|
+
background-image: url(../img/next.gif);
|
102
|
+
}
|
@@ -0,0 +1,425 @@
|
|
1
|
+
/**
|
2
|
+
* jquery.string - Prototype string functions for jQuery
|
3
|
+
* (c) 2008 David E. Still (http://stilldesigning.com)
|
4
|
+
* Original Prototype extensions (c) 2005-2008 Sam Stephenson (http://prototypejs.org)
|
5
|
+
*/
|
6
|
+
|
7
|
+
jQuery.extend({
|
8
|
+
__stringPrototype: {
|
9
|
+
/**
|
10
|
+
* ScriptFragmet, specialChar, and JSONFilter borrowed from Prototype 1.6.0.2
|
11
|
+
*/
|
12
|
+
JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
|
13
|
+
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
|
14
|
+
specialChar: {
|
15
|
+
'\b': '\\b',
|
16
|
+
'\t': '\\t',
|
17
|
+
'\n': '\\n',
|
18
|
+
'\f': '\\f',
|
19
|
+
'\r': '\\r',
|
20
|
+
'\\': '\\\\'
|
21
|
+
},
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Check if the string is blank (white-space only or empty).
|
25
|
+
* @param {String} s string to be evaluated
|
26
|
+
* @return {Boolean} boolean of result
|
27
|
+
*/
|
28
|
+
blank: function(s) {
|
29
|
+
return /^\s*$/.test(this.s(s) || ' ');
|
30
|
+
},
|
31
|
+
/**
|
32
|
+
* Converts a string separated by dashes into a camelCase equivalent.
|
33
|
+
* For instance, 'foo-bar' would be converted to 'fooBar'.
|
34
|
+
* @param {String} s string to be evaluated
|
35
|
+
* @return {Boolean} boolean of result
|
36
|
+
*/
|
37
|
+
camelize: function(s) {
|
38
|
+
var a = this.s(s).split('-'), i;
|
39
|
+
s = [a[0]];
|
40
|
+
for (i=1; i<a.length; i++){
|
41
|
+
s.push(a[i].charAt(0).toUpperCase() + a[i].substring(1));
|
42
|
+
}
|
43
|
+
s = s.join('');
|
44
|
+
return this.r(arguments,0,s);
|
45
|
+
},
|
46
|
+
/**
|
47
|
+
* Capitalizes the first letter of a string and downcases all the others.
|
48
|
+
* @param {String} s string to be evaluated
|
49
|
+
* @return {Boolean} boolean of result
|
50
|
+
*/
|
51
|
+
capitalize: function(s) {
|
52
|
+
s = this.s(s);
|
53
|
+
s = s.charAt(0).toUpperCase() + s.substring(1).toLowerCase();
|
54
|
+
return this.r(arguments,0,s);
|
55
|
+
},
|
56
|
+
/**
|
57
|
+
* Replaces every instance of the underscore character ("_") by a dash ("-").
|
58
|
+
* @param {String} s string to be evaluated
|
59
|
+
* @return {Boolean} boolean of result
|
60
|
+
*/
|
61
|
+
dasherize: function(s) {
|
62
|
+
s = this.s(s).split('_').join('-');
|
63
|
+
return this.r(arguments,0,s);
|
64
|
+
},
|
65
|
+
/**
|
66
|
+
* Check if the string is empty.
|
67
|
+
* @param {String} s string to be evaluated
|
68
|
+
* @return {Boolean} boolean of result
|
69
|
+
*/
|
70
|
+
empty: function(s) {
|
71
|
+
return this.s(s) === '';
|
72
|
+
},
|
73
|
+
/**
|
74
|
+
* Tests whether the end of a string matches pattern.
|
75
|
+
* @param {Object} pattern
|
76
|
+
* @param {String} s string to be evaluated
|
77
|
+
* @return {Boolean} boolean of result
|
78
|
+
*/
|
79
|
+
endsWith: function(pattern, s) {
|
80
|
+
s = this.s(s);
|
81
|
+
var d = s.length - pattern.length;
|
82
|
+
return d >= 0 && s.lastIndexOf(pattern) === d;
|
83
|
+
},
|
84
|
+
/**
|
85
|
+
* escapeHTML from Prototype-1.6.0.2 -- If it's good enough for Webkit and IE, it's good enough for Gecko!
|
86
|
+
* Converts HTML special characters to their entity equivalents.
|
87
|
+
* @param {String} s string to be evaluated
|
88
|
+
* @return {Object} .string object (or string if internal)
|
89
|
+
*/
|
90
|
+
escapeHTML: function(s) {
|
91
|
+
s = this.s(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
92
|
+
return this.r(arguments,0,s);
|
93
|
+
},
|
94
|
+
/**
|
95
|
+
* evalJSON from Prototype-1.6.0.2
|
96
|
+
* Evaluates the JSON in the string and returns the resulting object. If the optional sanitize parameter
|
97
|
+
* is set to true, the string is checked for possible malicious attempts and eval is not called if one
|
98
|
+
* is detected.
|
99
|
+
* @param {String} s string to be evaluated
|
100
|
+
* @return {Object} evaluated JSON result
|
101
|
+
*/
|
102
|
+
evalJSON: function(sanitize, s) {
|
103
|
+
s = this.s(s);
|
104
|
+
var json = this.unfilterJSON(false, s);
|
105
|
+
try {
|
106
|
+
if (!sanitize || this.isJSON(json)) { return eval('(' + json + ')'); }
|
107
|
+
} catch (e) { }
|
108
|
+
throw new SyntaxError('Badly formed JSON string: ' + s);
|
109
|
+
},
|
110
|
+
/**
|
111
|
+
* evalScripts from Prototype-1.6.0.2
|
112
|
+
* Evaluates the content of any script block present in the string. Returns an array containing
|
113
|
+
* the value returned by each script.
|
114
|
+
* @param {String} s string to be evaluated
|
115
|
+
* @return {Object} .string object (or string if internal)
|
116
|
+
*/
|
117
|
+
evalScripts: function(s) {
|
118
|
+
var scriptTags = this.extractScripts(this.s(s)), results = [];
|
119
|
+
if (scriptTags.length > 0) {
|
120
|
+
for (var i = 0; i < scriptTags.length; i++) {
|
121
|
+
results.push(eval(scriptTags[i]));
|
122
|
+
}
|
123
|
+
}
|
124
|
+
return results;
|
125
|
+
},
|
126
|
+
/**
|
127
|
+
* extractScripts from Prototype-1.6.0.2
|
128
|
+
* Extracts the content of any script block present in the string and returns them as an array of strings.
|
129
|
+
* @param {String} s string to be evaluated
|
130
|
+
* @return {Object} .string object (or string if internal)
|
131
|
+
*/
|
132
|
+
extractScripts: function(s) {
|
133
|
+
var matchAll = new RegExp(this.ScriptFragment, 'img'), matchOne = new RegExp(this.ScriptFragment, 'im'), scriptMatches = this.s(s).match(matchAll) || [], scriptTags = [];
|
134
|
+
if (scriptMatches.length > 0) {
|
135
|
+
for (var i = 0; i < scriptMatches.length; i++) {
|
136
|
+
scriptTags.push(scriptMatches[i].match(matchOne)[1] || '');
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return scriptTags;
|
140
|
+
},
|
141
|
+
/**
|
142
|
+
* Returns a string with all occurances of pattern replaced by either a regular string
|
143
|
+
* or the returned value of a function. Calls sub internally.
|
144
|
+
* @param {Object} pattern RegEx pattern or string to replace
|
145
|
+
* @param {Object} replacement string or function to replace matched patterns
|
146
|
+
* @param {String} s string to be evaluated
|
147
|
+
* @return {Object} .string object (or string if internal)
|
148
|
+
* @see sub
|
149
|
+
*/
|
150
|
+
gsub: function(pattern, replacement, s) {
|
151
|
+
s = this.s(s);
|
152
|
+
if (jQuery.isFunction(replacement)) { s = this.sub(pattern, replacement, -1, s); }
|
153
|
+
/* if replacement is not a function, do this the easy way; it's quicker */
|
154
|
+
else { s = s.split(pattern).join(replacement); }
|
155
|
+
return this.r(arguments,2,s);
|
156
|
+
},
|
157
|
+
/**
|
158
|
+
* Check if the string contains a substring.
|
159
|
+
* @param {Object} pattern RegEx pattern or string to find
|
160
|
+
* @param {String} s string to be evaluated
|
161
|
+
* @return {Boolean} boolean result
|
162
|
+
*/
|
163
|
+
include: function(pattern, s) {
|
164
|
+
return this.s(s).indexOf(pattern) > -1;
|
165
|
+
},
|
166
|
+
/**
|
167
|
+
* Returns a debug-oriented version of the string (i.e. wrapped in single or double quotes,
|
168
|
+
* with backslashes and quotes escaped).
|
169
|
+
* @param {Object} useDoubleQuotes escape double-quotes instead of single-quotes
|
170
|
+
* @param {String} s string to be evaluated
|
171
|
+
* @return {Object} .string object (or string if internal)
|
172
|
+
*/
|
173
|
+
inspect: function(useDoubleQuotes, s) {
|
174
|
+
s = this.s(s);
|
175
|
+
var escapedString;
|
176
|
+
try {
|
177
|
+
escapedString = this.sub(/[\x00-\x1f\\]/, function(match) {
|
178
|
+
var character = jQuery.__stringPrototype.specialChar[match[0]];
|
179
|
+
return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
|
180
|
+
}, -1, s);
|
181
|
+
} catch(e) { escapedString = s; }
|
182
|
+
s = (useDoubleQuotes) ? '"' + escapedString.replace(/"/g, '\\"') + '"' : "'" + escapedString.replace(/'/g, '\\\'') + "'";
|
183
|
+
return this.r(arguments,1,s);
|
184
|
+
},
|
185
|
+
/**
|
186
|
+
* Treats the string as a Prototype-style Template and fills it with objectÕs properties.
|
187
|
+
* @param {Object} obj object of values to replace in string
|
188
|
+
* @param {Object} pattern RegEx pattern for template replacement (default matches Ruby-style '#{attribute}')
|
189
|
+
* @param {String} s string to be evaluated
|
190
|
+
* @return {Object} .string object (or string if internal)
|
191
|
+
*/
|
192
|
+
interpolate: function(obj, pattern, s) {
|
193
|
+
s = this.s(s);
|
194
|
+
if (!pattern) { pattern = /(\#\{\s*(\w+)\s*\})/; }
|
195
|
+
var gpattern = new RegExp(pattern.source, "g");
|
196
|
+
var matches = s.match(gpattern), i;
|
197
|
+
for (i=0; i<matches.length; i++) {
|
198
|
+
s = s.replace(matches[i], obj[matches[i].match(pattern)[2]]);
|
199
|
+
}
|
200
|
+
return this.r(arguments,2,s);
|
201
|
+
},
|
202
|
+
/**
|
203
|
+
* isJSON from Prototype-1.6.0.2
|
204
|
+
* Check if the string is valid JSON by the use of regular expressions. This security method is called internally.
|
205
|
+
* @param {String} s string to be evaluated
|
206
|
+
* @return {Boolean} boolean result
|
207
|
+
*/
|
208
|
+
isJSON: function(s) {
|
209
|
+
s = this.s(s);
|
210
|
+
if (this.blank(s)) { return false; }
|
211
|
+
s = s.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
|
212
|
+
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(s);
|
213
|
+
},
|
214
|
+
/**
|
215
|
+
* Evaluates replacement for each match of pattern in string and returns the original string.
|
216
|
+
* Calls sub internally.
|
217
|
+
* @param {Object} pattern RegEx pattern or string to replace
|
218
|
+
* @param {Object} replacement string or function to replace matched patterns
|
219
|
+
* @param {String} s string to be evaluated
|
220
|
+
* @return {Object} .string object (or string if internal)
|
221
|
+
* @see sub
|
222
|
+
*/
|
223
|
+
scan: function(pattern, replacement, s) {
|
224
|
+
s = this.s(s);
|
225
|
+
this.sub(pattern, replacement, -1, s);
|
226
|
+
return this.r(arguments,2,s);
|
227
|
+
},
|
228
|
+
/**
|
229
|
+
* Tests whether the beginning of a string matches pattern.
|
230
|
+
* @param {Object} pattern
|
231
|
+
* @param {String} s string to be evaluated
|
232
|
+
* @return {Boolean} boolean of result
|
233
|
+
*/
|
234
|
+
startsWith: function(pattern, s) {
|
235
|
+
return this.s(s).indexOf(pattern) === 0;
|
236
|
+
},
|
237
|
+
/**
|
238
|
+
* Trims white space from the beginning and end of a string.
|
239
|
+
* @param {String} s string to be evaluated
|
240
|
+
* @return {Object} .string object (or string if internal)
|
241
|
+
*/
|
242
|
+
strip: function(s) {
|
243
|
+
s = jQuery.trim(this.s(s));
|
244
|
+
return this.r(arguments,0,s);
|
245
|
+
},
|
246
|
+
/**
|
247
|
+
* Strips a string of anything that looks like an HTML script block.
|
248
|
+
* @param {String} s string to be evaluated
|
249
|
+
* @return {Object} .string object (or string if internal)
|
250
|
+
*/
|
251
|
+
stripScripts: function(s) {
|
252
|
+
s = this.s(s).replace(new RegExp(this.ScriptFragment, 'img'), '');
|
253
|
+
return this.r(arguments,0,s);
|
254
|
+
},
|
255
|
+
/**
|
256
|
+
* Strips a string of any HTML tags.
|
257
|
+
* @param {String} s string to be evaluated
|
258
|
+
* @return {Object} .string object (or string if internal)
|
259
|
+
*/
|
260
|
+
stripTags: function(s) {
|
261
|
+
s = this.s(s).replace(/<\/?[^>]+>/gi, '');
|
262
|
+
return this.r(arguments,0,s);
|
263
|
+
},
|
264
|
+
/**
|
265
|
+
* Returns a string with the first count occurances of pattern replaced by either a regular string
|
266
|
+
* or the returned value of a function.
|
267
|
+
* @param {Object} pattern RegEx pattern or string to replace
|
268
|
+
* @param {Object} replacement string or function to replace matched patterns
|
269
|
+
* @param {Integer} count number of (default = 1, -1 replaces all)
|
270
|
+
* @param {String} s string to be evaluated
|
271
|
+
* @return {Object} .string object (or string if internal)
|
272
|
+
*/
|
273
|
+
sub: function(pattern, replacement, count, s) {
|
274
|
+
s = this.s(s);
|
275
|
+
if (pattern.source && !pattern.global) {
|
276
|
+
var patternMods = (pattern.ignoreCase)?"ig":"g";
|
277
|
+
patternMods += (pattern.multiline)?"m":"";
|
278
|
+
pattern = new RegExp(pattern.source, patternMods);
|
279
|
+
}
|
280
|
+
var sarray = s.split(pattern), matches = s.match(pattern);
|
281
|
+
if (jQuery.browser.msie) {
|
282
|
+
if (s.indexOf(matches[0]) == 0) sarray.unshift("");
|
283
|
+
if (s.lastIndexOf(matches[matches.length-1]) == s.length - matches[matches.length-1].length) sarray.push("");
|
284
|
+
}
|
285
|
+
count = (count < 0)?(sarray.length-1):count || 1;
|
286
|
+
s = sarray[0];
|
287
|
+
for (var i=1; i<sarray.length; i++) {
|
288
|
+
if (i <= count) {
|
289
|
+
if (jQuery.isFunction(replacement)) {
|
290
|
+
s += replacement(matches[i-1] || matches) + sarray[i];
|
291
|
+
} else { s += replacement + sarray[i]; }
|
292
|
+
} else { s += (matches[i-1] || matches) + sarray[i]; }
|
293
|
+
}
|
294
|
+
return this.r(arguments,3,s);
|
295
|
+
},
|
296
|
+
/**
|
297
|
+
*
|
298
|
+
* @param {String} s string to be evaluated
|
299
|
+
* @return {Object} .string object (or string if internal)
|
300
|
+
*/
|
301
|
+
succ: function(s) {
|
302
|
+
s = this.s(s);
|
303
|
+
s = s.slice(0, s.length - 1) + String.fromCharCode(s.charCodeAt(s.length - 1) + 1);
|
304
|
+
return this.r(arguments,0,s);
|
305
|
+
},
|
306
|
+
/**
|
307
|
+
* Concatenate count number of copies of s together and return result.
|
308
|
+
* @param {Integer} count Number of times to repeat s
|
309
|
+
* @param {String} s string to be evaluated
|
310
|
+
* @return {Object} .string object (or string if internal)
|
311
|
+
*/
|
312
|
+
times: function(count, s) {
|
313
|
+
s = this.s(s);
|
314
|
+
var newS = "";
|
315
|
+
for (var i=0; i<count; i++) {
|
316
|
+
newS += s;
|
317
|
+
}
|
318
|
+
return this.r(arguments,1,newS);
|
319
|
+
},
|
320
|
+
/**
|
321
|
+
* Returns a JSON string
|
322
|
+
* @param {String} s string to be evaluated
|
323
|
+
* @return {Object} .string object (or string if internal)
|
324
|
+
*/
|
325
|
+
toJSON: function(s) {
|
326
|
+
return this.r(arguments,0,this.inspect(true, this.s(s)));
|
327
|
+
},
|
328
|
+
/**
|
329
|
+
* Parses a URI-like query string and returns an object composed of parameter/value pairs.
|
330
|
+
* This method is mainly targeted at parsing query strings (hence the default value of '&'
|
331
|
+
* for the seperator argument). For this reason, it does not consider anything that is either
|
332
|
+
* before a question mark (which signals the beginning of a query string) or beyond the hash
|
333
|
+
* symbol ("#"), and runs decodeURIComponent() on each parameter/value pair.
|
334
|
+
* @param {Object} separator string to separate parameters (default = '&')
|
335
|
+
* @param {Object} s
|
336
|
+
* @return {Object} object
|
337
|
+
*/
|
338
|
+
toQueryParams: function(separator, s) {
|
339
|
+
s = this.s(s);
|
340
|
+
var paramsList = s.substring(s.indexOf('?')+1).split('#')[0].split(separator || '&'), params = {}, i, key, value, pair;
|
341
|
+
for (i=0; i<paramsList.length; i++) {
|
342
|
+
pair = paramsList[i].split('=');
|
343
|
+
key = decodeURIComponent(pair[0]);
|
344
|
+
value = (pair[1])?decodeURIComponent(pair[1]):undefined;
|
345
|
+
if (params[key]) {
|
346
|
+
if (typeof params[key] == "string") { params[key] = [params[key]]; }
|
347
|
+
params[key].push(value);
|
348
|
+
} else { params[key] = value; }
|
349
|
+
}
|
350
|
+
return params;
|
351
|
+
},
|
352
|
+
/**
|
353
|
+
* truncate from Prototype-1.6.0.2
|
354
|
+
* Truncates a string to the given length and appends a suffix to it (indicating that it is only an excerpt).
|
355
|
+
* @param {Object} length length of string to truncate to
|
356
|
+
* @param {Object} truncation string to concatenate onto truncated string (default = '...')
|
357
|
+
* @param {String} s string to be evaluated
|
358
|
+
* @return {Object} .string object (or string if internal)
|
359
|
+
*/
|
360
|
+
truncate: function(length, truncation, s) {
|
361
|
+
s = this.s(s);
|
362
|
+
length = length || 30;
|
363
|
+
truncation = (!truncation) ? '...' : truncation;
|
364
|
+
s = (s.length > length) ? s.slice(0, length - truncation.length) + truncation : String(s);
|
365
|
+
return this.r(arguments,2,s);
|
366
|
+
},
|
367
|
+
/**
|
368
|
+
* Converts a camelized string into a series of words separated by an underscore ("_").
|
369
|
+
* e.g. $.string('borderBottomWidth').underscore().str = 'border_bottom_width'
|
370
|
+
* @param {String} s string to be evaluated
|
371
|
+
* @return {Object} .string object (or string if internal)
|
372
|
+
*/
|
373
|
+
underscore: function(s) {
|
374
|
+
s = this.sub(/[A-Z]/, function(c) { return "_"+c.toLowerCase(); }, -1, this.s(s));
|
375
|
+
if (s.charAt(0) == "_") s = s.substring(1);
|
376
|
+
return this.r(arguments,0,s);
|
377
|
+
},
|
378
|
+
/**
|
379
|
+
* unescapeHTML from Prototype-1.6.0.2 -- If it's good enough for Webkit and IE, it's good enough for Gecko!
|
380
|
+
* Strips tags and converts the entity forms of special HTML characters to their normal form.
|
381
|
+
* @param {String} s string to be evaluated
|
382
|
+
* @return {Object} .string object (or string if internal)
|
383
|
+
*/
|
384
|
+
unescapeHTML: function(s) {
|
385
|
+
s = this.stripTags(this.s(s)).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
386
|
+
return this.r(arguments,0,s);
|
387
|
+
},
|
388
|
+
/**
|
389
|
+
* unfilterJSON from Prototype-1.6.0.2.
|
390
|
+
* @param {Function} filter
|
391
|
+
* @param {String} s string to be evaluated
|
392
|
+
* @return {Object} .string object (or string if internal)
|
393
|
+
*/
|
394
|
+
unfilterJSON: function(filter, s) {
|
395
|
+
s = this.s(s);
|
396
|
+
filter = filter || this.JSONFilter;
|
397
|
+
var filtered = s.match(filter);
|
398
|
+
s = (filtered !== null)?filtered[1]:s;
|
399
|
+
return this.r(arguments,1,jQuery.trim(s));
|
400
|
+
},
|
401
|
+
|
402
|
+
/**
|
403
|
+
* Sets .str property and returns $.string object.
|
404
|
+
* @param {String} s string to be evaluated
|
405
|
+
*/
|
406
|
+
r: function(args, size, s) {
|
407
|
+
if (args.length > size || this.str === undefined) {
|
408
|
+
return s;
|
409
|
+
} else {
|
410
|
+
this.str = ''+s;
|
411
|
+
return this;
|
412
|
+
};
|
413
|
+
},
|
414
|
+
s: function(s) {
|
415
|
+
if (s === '' || s) { return s; }
|
416
|
+
if (this.str === '' || this.str) { return this.str; }
|
417
|
+
return this;
|
418
|
+
}
|
419
|
+
},
|
420
|
+
string: function(str) {
|
421
|
+
if (str === String.prototype) { jQuery.extend(String.prototype, jQuery.__stringPrototype); }
|
422
|
+
else { return jQuery.extend({ str: str }, jQuery.__stringPrototype); }
|
423
|
+
}
|
424
|
+
});
|
425
|
+
jQuery.__stringPrototype.parseQuery = jQuery.__stringPrototype.toQueryParams;
|