mail_engine 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +12 -11
- data/.yardoc/objects/ActionMailer.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base.dat +0 -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/Collector.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector/custom_i.dat +0 -0
- data/.yardoc/objects/MailEngine.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/acts_as_mail_receiver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/check_method_existance_21_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Base.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_marketing_mail_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration/load_c.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyMigrations.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyMigrations/copy_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyResources.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyResources/copy_resources_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig/create_config_file_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Engine.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/check_21_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/get_resource_url_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/process_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_in_html_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Install.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/copy_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/copy_resources_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/create_config_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber/deliver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/PLACEHOLDERS_IN_LAYOUT.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods/sendgrid_header_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/InstanceMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting.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/RestApi.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/RestApiError.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi.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/VERSION.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor/extract_all_files_c.dat +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile +16 -13
- data/Gemfile.lock +69 -46
- data/README.mkd +14 -2
- data/VERSION +1 -1
- data/app/controllers/mail_engine/application_controller.rb +4 -0
- data/app/controllers/mail_engine/mail_logs_controller.rb +1 -1
- data/app/controllers/mail_engine/mail_schedules_controller.rb +4 -4
- data/app/controllers/mail_engine/mail_template_files_controller.rb +4 -4
- data/app/controllers/mail_engine/mail_templates_controller.rb +16 -11
- data/app/controllers/mail_engine/reports_controller.rb +5 -1
- data/app/helpers/mail_engine/mail_engine_helper.rb +1 -1
- data/app/mailers/mail_engine/mail_dispatcher.rb +16 -9
- data/app/models/mail_engine/mail_log.rb +1 -1
- data/app/models/mail_engine/mail_schedule.rb +14 -12
- data/app/models/mail_engine/mail_template.rb +81 -55
- data/app/models/mail_engine/mail_template_file.rb +4 -3
- data/app/views/layouts/mail_engine/mail_engine.html.erb +31 -18
- data/app/views/layouts/mail_engine/simple.html.erb +14 -0
- data/app/views/mail_engine/dashboard/index.html.erb +18 -1
- data/app/views/mail_engine/mail_logs/_related_logs.html.erb +29 -0
- data/app/views/mail_engine/mail_logs/index.html.erb +5 -5
- data/app/views/mail_engine/mail_schedules/_form.html.erb +6 -5
- data/app/views/mail_engine/mail_schedules/index.html.erb +13 -8
- data/app/views/mail_engine/mail_schedules/show.html.erb +2 -0
- data/app/views/mail_engine/mail_template_files/_form.html.erb +20 -10
- data/app/views/mail_engine/mail_template_files/edit.html.erb +2 -0
- data/app/views/mail_engine/mail_template_files/new.html.erb +2 -0
- data/app/views/mail_engine/mail_templates/_form.html.erb +65 -12
- data/app/views/mail_engine/mail_templates/_layout_selector.html.erb +3 -3
- data/app/views/mail_engine/mail_templates/duplicate.html.erb +11 -7
- data/app/views/mail_engine/mail_templates/index.html.erb +25 -21
- data/app/views/mail_engine/mail_templates/new_by_upload.html.erb +11 -5
- data/app/views/mail_engine/mail_templates/partial_options.html.erb +2 -2
- data/app/views/mail_engine/mail_templates/show.html.erb +19 -29
- data/app/views/mail_engine/reports/charts/blocks.html.erb +2 -2
- data/app/views/mail_engine/reports/charts/bounces.html.erb +2 -2
- data/app/views/mail_engine/reports/charts/invalidemails.html.erb +2 -2
- data/app/views/mail_engine/reports/charts/spamreports.html.erb +2 -2
- data/app/views/mail_engine/reports/index.html.erb +40 -5
- data/config/routes.rb +5 -6
- data/db/migrate/20110114030841_create_table_mail_template.rb +1 -0
- data/doc/ActionMailer.html +108 -0
- data/doc/ActionMailer/Base.html +193 -0
- data/doc/ActionMailer/Collector.html +175 -0
- data/doc/MailEngine.html +146 -0
- data/doc/MailEngine/ActsAsMailReceiver.html +97 -0
- data/doc/MailEngine/ActsAsMailReceiver/ClassMethods.html +187 -0
- data/doc/MailEngine/Base.html +297 -0
- data/doc/MailEngine/Configuration.html +181 -0
- data/doc/MailEngine/CopyMigrations.html +187 -0
- data/doc/MailEngine/CopyResources.html +171 -0
- data/doc/MailEngine/CreateConfig.html +193 -0
- data/doc/MailEngine/CreateMigration.html +187 -0
- data/doc/MailEngine/Engine.html +100 -0
- data/doc/MailEngine/HtmlDocumentAssetsReplacer.html +397 -0
- data/doc/MailEngine/Install.html +273 -0
- data/doc/MailEngine/MailLogSubscriber.html +204 -0
- data/doc/MailEngine/Sendgrid.html +101 -0
- data/doc/MailEngine/Sendgrid/Base.html +97 -0
- data/doc/MailEngine/Sendgrid/Base/ClassMethods.html +150 -0
- data/doc/MailEngine/Sendgrid/Base/InstanceMethods.html +81 -0
- data/doc/MailEngine/Sendgrid/FilterSetting.html +257 -0
- data/doc/MailEngine/Sendgrid/RestApi.html +476 -0
- data/doc/MailEngine/Sendgrid/RestApiError.html +100 -0
- data/doc/MailEngine/Sendgrid/SmtpApi.html +604 -0
- data/doc/MailEngine/ZipProcessor.html +267 -0
- data/doc/_index.html +21 -7
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +231 -0
- data/doc/index.html +231 -0
- data/doc/method_list.html +45 -21
- data/doc/top-level-namespace.html +88 -0
- data/lib/mail_engine.rb +7 -1
- data/lib/mail_engine/action_mailer_patch.rb +7 -0
- data/lib/mail_engine/acts_as_mail_receiver.rb +40 -6
- data/lib/mail_engine/base.rb +28 -7
- data/lib/mail_engine/configuration.rb +3 -0
- data/lib/mail_engine/engine.rb +5 -5
- data/lib/mail_engine/generators/{create_migration.rb → copy_migrations.rb} +4 -3
- data/lib/mail_engine/generators/copy_resources.rb +13 -0
- data/lib/mail_engine/generators/install.rb +21 -0
- data/lib/mail_engine/generators/templates/mail_engine_config.yml +10 -1
- data/lib/mail_engine/html_document_assets_replacer.rb +12 -23
- data/lib/mail_engine/mail_log_subscriber.rb +13 -5
- data/lib/mail_engine/zip_processor.rb +10 -1
- data/mail_engine.gemspec +336 -110
- data/public/images/mail_engine/header_and_footer_layout.png +0 -0
- data/public/images/mail_engine/icons/add.png +0 -0
- data/public/images/mail_engine/icons/copy.png +0 -0
- data/public/images/mail_engine/icons/delete.png +0 -0
- data/public/images/mail_engine/icons/edit.gif +0 -0
- data/public/images/mail_engine/icons/missing.png +0 -0
- data/public/images/mail_engine/icons/save.png +0 -0
- data/public/images/mail_engine/icons/show.png +0 -0
- data/public/images/mail_engine/logo.gif +0 -0
- data/public/images/mail_engine/logo.png +0 -0
- data/public/images/mail_engine/none_layout.png +0 -0
- data/public/images/mail_engine/only_footer_layout.png +0 -0
- data/public/images/mail_engine/unselect_header_and_footer_layout.png +0 -0
- data/public/images/mail_engine/unselect_none_layout.png +0 -0
- data/public/images/mail_engine/unselect_only_footer_layout.png +0 -0
- data/public/javascripts/mail_engine/fancybox/blank.gif +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_close.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_loading.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_nav_left.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_nav_right.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_e.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_n.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_ne.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_nw.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_s.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_se.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_sw.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_w.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_left.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_main.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_over.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_right.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancybox-x.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancybox-y.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancybox.png +0 -0
- data/public/javascripts/mail_engine/fancybox/jquery.easing-1.3.pack.js +72 -0
- data/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.css +359 -0
- data/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.js +1156 -0
- data/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
- data/public/javascripts/mail_engine/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
- data/public/javascripts/mail_engine/jquery-ui.min.js +577 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/jquery.iframe-auto-height.plugin.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/jquery.string.js +0 -0
- data/{test/dummy/public/javascripts/mail_engine_application.js → public/javascripts/mail_engine/mail_engine.js} +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/jquery.markitup.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/bold.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/css.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/italic.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/picture.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/stroke.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/tag.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_center.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_justify.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_left.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_right.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_indent.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_letterspacing.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_linespacing.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_lowercase.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_bottom.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_left.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_right.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_top.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_uppercase.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/readme.txt +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/set.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/bold.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/clean.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/image.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/italic.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/link.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/picture.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/preview.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/stroke.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/set.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/bold.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/clean.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h1.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h2.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h3.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h4.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h5.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h6.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/image.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/italic.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/link.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/list-bullet.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/list-item.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/list-numeric.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/paragraph.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/picture.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/preview.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/stroke.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/readme.txt +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/set.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-container.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/handle.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/menu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/submenu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/images/handle.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/images/menu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/images/submenu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/templates/preview.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/templates/preview.html +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/jquery-ui.css +544 -0
- data/{test/dummy/public/stylesheets → public/stylesheets/mail_engine}/style.css +6 -2
- data/test/dummy/app/controllers/application_controller.rb +0 -8
- data/test/dummy/app/models/user.rb +6 -4
- data/test/dummy/config/application.rb +2 -2
- data/test/dummy/config/database.yml +2 -2
- data/test/dummy/db/migrate/20110114030841_create_table_mail_template.rb +1 -0
- data/test/dummy/db/migrate/20110206025002_create_mail_logs.rb +1 -1
- data/test/dummy/db/schema.rb +1 -0
- data/test/dummy/public/images/mail_engine/icons/add.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/copy.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/delete.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/edit.gif +0 -0
- data/test/dummy/public/images/mail_engine/icons/missing.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/save.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/show.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/blank.gif +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_close.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_loading.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_nav_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_nav_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_e.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_n.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_ne.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_nw.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_s.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_se.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_sw.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_w.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_main.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_over.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancybox-x.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancybox-y.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancybox.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.easing-1.3.pack.js +72 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.css +359 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.js +1156 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
- data/test/dummy/public/javascripts/mail_engine/jquery-ui.min.js +577 -0
- data/test/dummy/public/javascripts/mail_engine/jquery.iframe-auto-height.plugin.js +50 -0
- data/test/dummy/public/javascripts/mail_engine/jquery.string.js +425 -0
- data/test/dummy/public/javascripts/mail_engine/mail_engine.js +2 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/jquery.markitup.js +564 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/bold.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/css.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/italic.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/picture.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/tag.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_center.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_justify.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_indent.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_letterspacing.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_linespacing.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_lowercase.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_bottom.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_top.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_uppercase.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/readme.txt +28 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/set.js +52 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/style.css +72 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/bold.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/clean.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/image.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/italic.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/link.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/picture.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/preview.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/set.js +27 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/style.css +27 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/bold.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/clean.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h1.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h2.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h3.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h4.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h5.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h6.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/image.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/italic.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/link.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/list-bullet.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/list-item.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/list-numeric.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/paragraph.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/picture.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/preview.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/readme.txt +11 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/set.js +40 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/style.css +59 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-container.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/handle.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/menu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/submenu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/style.css +147 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/images/handle.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/images/menu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/images/submenu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/style.css +118 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/templates/preview.css +5 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/templates/preview.html +11 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/jquery-ui.css +544 -0
- data/test/dummy/public/stylesheets/mail_engine/style.css +685 -0
- data/test/factories.rb +31 -4
- data/test/functional/mail_engine/{mail_schedules_controller_controller_test.rb → dashboard_controller_test.rb} +2 -2
- data/test/functional/mail_engine/{mail_templates_controller_controller_test.rb → mail_logs_controller_test.rb} +2 -2
- data/test/functional/mail_engine/mail_schedules_controller_test.rb +8 -0
- data/test/functional/mail_engine/mail_template_files_controller_test.rb +8 -0
- data/test/functional/mail_engine/mail_templates_controller_test.rb +8 -0
- data/test/functional/mail_engine/reports_controller_test.rb +8 -0
- data/test/functional/user_mailer_test.rb +14 -0
- data/test/test_helper.rb +4 -1
- data/test/unit/mail_engine/mail_log_test.rb +1 -1
- data/test/unit/mail_engine/mail_schedule_test.rb +34 -1
- data/test/unit/mail_engine/mail_template_test.rb +51 -12
- data/test/unit/user_test.rb +20 -0
- metadata +370 -125
- data/.yardoc/objects/MailEngine/Base/send_mail_c.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateMigration.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateMigration/create_migrations_i.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/PLACEHOLDERS_IN_LAYOUT.dat +0 -0
- data/lib/mail_engine/placeholders_in_layout.rb +0 -5
- 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 +0 -186
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal-ie6.min.js +0 -9
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal.custom.js +0 -1599
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal.custom.min.js +0 -34
- data/test/dummy/public/javascripts/jquery.nyroModal/styles/nyroModal.css +0 -102
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
/*
|
2
|
+
Plugin: iframe autoheight jQuery Plugin
|
3
|
+
Author: original code by NATHAN SMITH; converted to plugin by Jesse House
|
4
|
+
File: jquery.iframe-auto-height.plugin.js
|
5
|
+
Description: when the page loads set the height of an iframe based on the height of its contents
|
6
|
+
Remarks: original code from http://sonspring.com/journal/jquery-iframe-sizing
|
7
|
+
Version: 1.0.0 - see README: http://github.com/house9/jquery-iframe-auto-height
|
8
|
+
*/
|
9
|
+
(function ($) {
|
10
|
+
$.fn.iframeAutoHeight = function (options) {
|
11
|
+
// set default option values
|
12
|
+
var options = $.extend({
|
13
|
+
heightOffset: 0
|
14
|
+
}, options);
|
15
|
+
|
16
|
+
// iterate over the matched elements passed to the plugin
|
17
|
+
$(this).each(function () {
|
18
|
+
// Check if browser is Opera or Safari(Webkit so Chrome as well)
|
19
|
+
if ($.browser.safari || $.browser.opera) {
|
20
|
+
// Start timer when loaded.
|
21
|
+
$(this).load(function () {
|
22
|
+
var iframe = this;
|
23
|
+
var delayedResize = function () {
|
24
|
+
resizeHeight(iframe);
|
25
|
+
};
|
26
|
+
setTimeout(delayedResize, 0);
|
27
|
+
});
|
28
|
+
|
29
|
+
// Safari and Opera need a kick-start.
|
30
|
+
var source = $(this).attr('src');
|
31
|
+
$(this).attr('src', '');
|
32
|
+
$(this).attr('src', source);
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
// For other browsers.
|
36
|
+
$(this).load(function () {
|
37
|
+
resizeHeight(this);
|
38
|
+
});
|
39
|
+
}
|
40
|
+
|
41
|
+
// resizeHeight
|
42
|
+
function resizeHeight(iframe) {
|
43
|
+
// Set inline style to equal the body height of the iframed content plus a little
|
44
|
+
var newHeight = iframe.contentWindow.document.body.offsetHeight + options.heightOffset;
|
45
|
+
iframe.style.height = newHeight + 'px';
|
46
|
+
}
|
47
|
+
|
48
|
+
}); // end
|
49
|
+
}
|
50
|
+
})(jQuery);
|
@@ -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;
|