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,564 @@
|
|
1
|
+
// ----------------------------------------------------------------------------
|
2
|
+
// markItUp! Universal MarkUp Engine, JQuery plugin
|
3
|
+
// v 1.1.x
|
4
|
+
// Dual licensed under the MIT and GPL licenses.
|
5
|
+
// ----------------------------------------------------------------------------
|
6
|
+
// Copyright (C) 2007-2010 Jay Salvat
|
7
|
+
// http://markitup.jaysalvat.com/
|
8
|
+
// ----------------------------------------------------------------------------
|
9
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
// of this software and associated documentation files (the "Software"), to deal
|
11
|
+
// in the Software without restriction, including without limitation the rights
|
12
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the Software is
|
14
|
+
// furnished to do so, subject to the following conditions:
|
15
|
+
//
|
16
|
+
// The above copyright notice and this permission notice shall be included in
|
17
|
+
// all copies or substantial portions of the Software.
|
18
|
+
//
|
19
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
// THE SOFTWARE.
|
26
|
+
// ----------------------------------------------------------------------------
|
27
|
+
(function($) {
|
28
|
+
$.fn.markItUp = function(settings, extraSettings) {
|
29
|
+
var options, ctrlKey, shiftKey, altKey;
|
30
|
+
ctrlKey = shiftKey = altKey = false;
|
31
|
+
|
32
|
+
options = { id: '',
|
33
|
+
nameSpace: '',
|
34
|
+
root: '',
|
35
|
+
previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
|
36
|
+
previewAutoRefresh: true,
|
37
|
+
previewPosition: 'after',
|
38
|
+
previewTemplatePath: '~/templates/preview.html',
|
39
|
+
previewParserPath: '',
|
40
|
+
previewParserVar: 'data',
|
41
|
+
resizeHandle: true,
|
42
|
+
beforeInsert: '',
|
43
|
+
afterInsert: '',
|
44
|
+
onEnter: {},
|
45
|
+
onShiftEnter: {},
|
46
|
+
onCtrlEnter: {},
|
47
|
+
onTab: {},
|
48
|
+
markupSet: [ { /* set */ } ]
|
49
|
+
};
|
50
|
+
$.extend(options, settings, extraSettings);
|
51
|
+
|
52
|
+
// compute markItUp! path
|
53
|
+
if (!options.root) {
|
54
|
+
$('script').each(function(a, tag) {
|
55
|
+
miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
|
56
|
+
if (miuScript !== null) {
|
57
|
+
options.root = miuScript[1];
|
58
|
+
}
|
59
|
+
});
|
60
|
+
}
|
61
|
+
|
62
|
+
return this.each(function() {
|
63
|
+
var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
|
64
|
+
clicked, hash, header, footer, previewWindow, template, iFrame, abort;
|
65
|
+
$$ = $(this);
|
66
|
+
textarea = this;
|
67
|
+
levels = [];
|
68
|
+
abort = false;
|
69
|
+
scrollPosition = caretPosition = 0;
|
70
|
+
caretOffset = -1;
|
71
|
+
|
72
|
+
options.previewParserPath = localize(options.previewParserPath);
|
73
|
+
options.previewTemplatePath = localize(options.previewTemplatePath);
|
74
|
+
|
75
|
+
// apply the computed path to ~/
|
76
|
+
function localize(data, inText) {
|
77
|
+
if (inText) {
|
78
|
+
return data.replace(/("|')~\//g, "$1"+options.root);
|
79
|
+
}
|
80
|
+
return data.replace(/^~\//, options.root);
|
81
|
+
}
|
82
|
+
|
83
|
+
// init and build editor
|
84
|
+
function init() {
|
85
|
+
id = ''; nameSpace = '';
|
86
|
+
if (options.id) {
|
87
|
+
id = 'id="'+options.id+'"';
|
88
|
+
} else if ($$.attr("id")) {
|
89
|
+
id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
|
90
|
+
|
91
|
+
}
|
92
|
+
if (options.nameSpace) {
|
93
|
+
nameSpace = 'class="'+options.nameSpace+'"';
|
94
|
+
}
|
95
|
+
$$.wrap('<div '+nameSpace+'></div>');
|
96
|
+
$$.wrap('<div '+id+' class="markItUp"></div>');
|
97
|
+
$$.wrap('<div class="markItUpContainer"></div>');
|
98
|
+
$$.addClass("markItUpEditor");
|
99
|
+
|
100
|
+
// add the header before the textarea
|
101
|
+
header = $('<div class="markItUpHeader"></div>').insertBefore($$);
|
102
|
+
$(dropMenus(options.markupSet)).appendTo(header);
|
103
|
+
|
104
|
+
// add the footer after the textarea
|
105
|
+
footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
|
106
|
+
|
107
|
+
// add the resize handle after textarea
|
108
|
+
if (options.resizeHandle === true && $.browser.safari !== true) {
|
109
|
+
resizeHandle = $('<div class="markItUpResizeHandle"></div>')
|
110
|
+
.insertAfter($$)
|
111
|
+
.bind("mousedown", function(e) {
|
112
|
+
var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
|
113
|
+
mouseMove = function(e) {
|
114
|
+
$$.css("height", Math.max(20, e.clientY+h-y)+"px");
|
115
|
+
return false;
|
116
|
+
};
|
117
|
+
mouseUp = function(e) {
|
118
|
+
$("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
|
119
|
+
return false;
|
120
|
+
};
|
121
|
+
$("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
|
122
|
+
});
|
123
|
+
footer.append(resizeHandle);
|
124
|
+
}
|
125
|
+
|
126
|
+
// listen key events
|
127
|
+
$$.keydown(keyPressed).keyup(keyPressed);
|
128
|
+
|
129
|
+
// bind an event to catch external calls
|
130
|
+
$$.bind("insertion", function(e, settings) {
|
131
|
+
if (settings.target !== false) {
|
132
|
+
get();
|
133
|
+
}
|
134
|
+
if (textarea === $.markItUp.focused) {
|
135
|
+
markup(settings);
|
136
|
+
}
|
137
|
+
});
|
138
|
+
|
139
|
+
// remember the last focus
|
140
|
+
$$.focus(function() {
|
141
|
+
$.markItUp.focused = this;
|
142
|
+
});
|
143
|
+
}
|
144
|
+
|
145
|
+
// recursively build header with dropMenus from markupset
|
146
|
+
function dropMenus(markupSet) {
|
147
|
+
var ul = $('<ul></ul>'), i = 0;
|
148
|
+
$('li:hover > ul', ul).css('display', 'block');
|
149
|
+
$.each(markupSet, function() {
|
150
|
+
var button = this, t = '', title, li, j;
|
151
|
+
title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
|
152
|
+
key = (button.key) ? 'accesskey="'+button.key+'"' : '';
|
153
|
+
if (button.separator) {
|
154
|
+
li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
|
155
|
+
} else {
|
156
|
+
i++;
|
157
|
+
for (j = levels.length -1; j >= 0; j--) {
|
158
|
+
t += levels[j]+"-";
|
159
|
+
}
|
160
|
+
li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
|
161
|
+
.bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
|
162
|
+
return false;
|
163
|
+
}).click(function() {
|
164
|
+
return false;
|
165
|
+
}).bind("focusin", function(){
|
166
|
+
$$.focus();
|
167
|
+
}).mousedown(function() {
|
168
|
+
if (button.call) {
|
169
|
+
eval(button.call)();
|
170
|
+
}
|
171
|
+
setTimeout(function() { markup(button) },1);
|
172
|
+
return false;
|
173
|
+
}).hover(function() {
|
174
|
+
$('> ul', this).show();
|
175
|
+
$(document).one('click', function() { // close dropmenu if click outside
|
176
|
+
$('ul ul', header).hide();
|
177
|
+
}
|
178
|
+
);
|
179
|
+
}, function() {
|
180
|
+
$('> ul', this).hide();
|
181
|
+
}
|
182
|
+
).appendTo(ul);
|
183
|
+
if (button.dropMenu) {
|
184
|
+
levels.push(i);
|
185
|
+
$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
|
186
|
+
}
|
187
|
+
}
|
188
|
+
});
|
189
|
+
levels.pop();
|
190
|
+
return ul;
|
191
|
+
}
|
192
|
+
|
193
|
+
// markItUp! markups
|
194
|
+
function magicMarkups(string) {
|
195
|
+
if (string) {
|
196
|
+
string = string.toString();
|
197
|
+
string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
|
198
|
+
function(x, a) {
|
199
|
+
var b = a.split('|!|');
|
200
|
+
if (altKey === true) {
|
201
|
+
return (b[1] !== undefined) ? b[1] : b[0];
|
202
|
+
} else {
|
203
|
+
return (b[1] === undefined) ? "" : b[0];
|
204
|
+
}
|
205
|
+
}
|
206
|
+
);
|
207
|
+
// [![prompt]!], [![prompt:!:value]!]
|
208
|
+
string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
|
209
|
+
function(x, a) {
|
210
|
+
var b = a.split(':!:');
|
211
|
+
if (abort === true) {
|
212
|
+
return false;
|
213
|
+
}
|
214
|
+
value = prompt(b[0], (b[1]) ? b[1] : '');
|
215
|
+
if (value === null) {
|
216
|
+
abort = true;
|
217
|
+
}
|
218
|
+
return value;
|
219
|
+
}
|
220
|
+
);
|
221
|
+
return string;
|
222
|
+
}
|
223
|
+
return "";
|
224
|
+
}
|
225
|
+
|
226
|
+
// prepare action
|
227
|
+
function prepare(action) {
|
228
|
+
if ($.isFunction(action)) {
|
229
|
+
action = action(hash);
|
230
|
+
}
|
231
|
+
return magicMarkups(action);
|
232
|
+
}
|
233
|
+
|
234
|
+
// build block to insert
|
235
|
+
function build(string) {
|
236
|
+
openWith = prepare(clicked.openWith);
|
237
|
+
placeHolder = prepare(clicked.placeHolder);
|
238
|
+
replaceWith = prepare(clicked.replaceWith);
|
239
|
+
closeWith = prepare(clicked.closeWith);
|
240
|
+
if (replaceWith !== "") {
|
241
|
+
block = openWith + replaceWith + closeWith;
|
242
|
+
} else if (selection === '' && placeHolder !== '') {
|
243
|
+
block = openWith + placeHolder + closeWith;
|
244
|
+
} else {
|
245
|
+
block = openWith + (string||selection) + closeWith;
|
246
|
+
}
|
247
|
+
return { block:block,
|
248
|
+
openWith:openWith,
|
249
|
+
replaceWith:replaceWith,
|
250
|
+
placeHolder:placeHolder,
|
251
|
+
closeWith:closeWith
|
252
|
+
};
|
253
|
+
}
|
254
|
+
|
255
|
+
// define markup to insert
|
256
|
+
function markup(button) {
|
257
|
+
var len, j, n, i;
|
258
|
+
hash = clicked = button;
|
259
|
+
get();
|
260
|
+
|
261
|
+
$.extend(hash, { line:"",
|
262
|
+
root:options.root,
|
263
|
+
textarea:textarea,
|
264
|
+
selection:(selection||''),
|
265
|
+
caretPosition:caretPosition,
|
266
|
+
ctrlKey:ctrlKey,
|
267
|
+
shiftKey:shiftKey,
|
268
|
+
altKey:altKey
|
269
|
+
}
|
270
|
+
);
|
271
|
+
// callbacks before insertion
|
272
|
+
prepare(options.beforeInsert);
|
273
|
+
prepare(clicked.beforeInsert);
|
274
|
+
if (ctrlKey === true && shiftKey === true) {
|
275
|
+
prepare(clicked.beforeMultiInsert);
|
276
|
+
}
|
277
|
+
$.extend(hash, { line:1 });
|
278
|
+
|
279
|
+
if (ctrlKey === true && shiftKey === true) {
|
280
|
+
lines = selection.split(/\r?\n/);
|
281
|
+
for (j = 0, n = lines.length, i = 0; i < n; i++) {
|
282
|
+
if ($.trim(lines[i]) !== '') {
|
283
|
+
$.extend(hash, { line:++j, selection:lines[i] } );
|
284
|
+
lines[i] = build(lines[i]).block;
|
285
|
+
} else {
|
286
|
+
lines[i] = "";
|
287
|
+
}
|
288
|
+
}
|
289
|
+
string = { block:lines.join('\n')};
|
290
|
+
start = caretPosition;
|
291
|
+
len = string.block.length + (($.browser.opera) ? n-1 : 0);
|
292
|
+
} else if (ctrlKey === true) {
|
293
|
+
string = build(selection);
|
294
|
+
start = caretPosition + string.openWith.length;
|
295
|
+
len = string.block.length - string.openWith.length - string.closeWith.length;
|
296
|
+
len -= fixIeBug(string.block);
|
297
|
+
} else if (shiftKey === true) {
|
298
|
+
string = build(selection);
|
299
|
+
start = caretPosition;
|
300
|
+
len = string.block.length;
|
301
|
+
len -= fixIeBug(string.block);
|
302
|
+
} else {
|
303
|
+
string = build(selection);
|
304
|
+
start = caretPosition + string.block.length ;
|
305
|
+
len = 0;
|
306
|
+
start -= fixIeBug(string.block);
|
307
|
+
}
|
308
|
+
if ((selection === '' && string.replaceWith === '')) {
|
309
|
+
caretOffset += fixOperaBug(string.block);
|
310
|
+
|
311
|
+
start = caretPosition + string.openWith.length;
|
312
|
+
len = string.block.length - string.openWith.length - string.closeWith.length;
|
313
|
+
|
314
|
+
caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
|
315
|
+
caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
|
316
|
+
}
|
317
|
+
$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
|
318
|
+
|
319
|
+
if (string.block !== selection && abort === false) {
|
320
|
+
insert(string.block);
|
321
|
+
set(start, len);
|
322
|
+
} else {
|
323
|
+
caretOffset = -1;
|
324
|
+
}
|
325
|
+
get();
|
326
|
+
|
327
|
+
$.extend(hash, { line:'', selection:selection });
|
328
|
+
|
329
|
+
// callbacks after insertion
|
330
|
+
if (ctrlKey === true && shiftKey === true) {
|
331
|
+
prepare(clicked.afterMultiInsert);
|
332
|
+
}
|
333
|
+
prepare(clicked.afterInsert);
|
334
|
+
prepare(options.afterInsert);
|
335
|
+
|
336
|
+
// refresh preview if opened
|
337
|
+
if (previewWindow && options.previewAutoRefresh) {
|
338
|
+
refreshPreview();
|
339
|
+
}
|
340
|
+
|
341
|
+
// reinit keyevent
|
342
|
+
shiftKey = altKey = ctrlKey = abort = false;
|
343
|
+
}
|
344
|
+
|
345
|
+
// Substract linefeed in Opera
|
346
|
+
function fixOperaBug(string) {
|
347
|
+
if ($.browser.opera) {
|
348
|
+
return string.length - string.replace(/\n*/g, '').length;
|
349
|
+
}
|
350
|
+
return 0;
|
351
|
+
}
|
352
|
+
// Substract linefeed in IE
|
353
|
+
function fixIeBug(string) {
|
354
|
+
if ($.browser.msie) {
|
355
|
+
return string.length - string.replace(/\r/g, '').length;
|
356
|
+
}
|
357
|
+
return 0;
|
358
|
+
}
|
359
|
+
|
360
|
+
// add markup
|
361
|
+
function insert(block) {
|
362
|
+
if (document.selection) {
|
363
|
+
var newSelection = document.selection.createRange();
|
364
|
+
newSelection.text = block;
|
365
|
+
} else {
|
366
|
+
textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length);
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
370
|
+
// set a selection
|
371
|
+
function set(start, len) {
|
372
|
+
if (textarea.createTextRange){
|
373
|
+
// quick fix to make it work on Opera 9.5
|
374
|
+
if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
|
375
|
+
return false;
|
376
|
+
}
|
377
|
+
range = textarea.createTextRange();
|
378
|
+
range.collapse(true);
|
379
|
+
range.moveStart('character', start);
|
380
|
+
range.moveEnd('character', len);
|
381
|
+
range.select();
|
382
|
+
} else if (textarea.setSelectionRange ){
|
383
|
+
textarea.setSelectionRange(start, start + len);
|
384
|
+
}
|
385
|
+
textarea.scrollTop = scrollPosition;
|
386
|
+
textarea.focus();
|
387
|
+
}
|
388
|
+
|
389
|
+
// get the selection
|
390
|
+
function get() {
|
391
|
+
textarea.focus();
|
392
|
+
|
393
|
+
scrollPosition = textarea.scrollTop;
|
394
|
+
if (document.selection) {
|
395
|
+
selection = document.selection;
|
396
|
+
if ($.browser.msie) { // ie
|
397
|
+
var range = selection.createRange();
|
398
|
+
var stored_range = range.duplicate();
|
399
|
+
stored_range.moveToElementText(textarea);
|
400
|
+
stored_range.setEndPoint('EndToEnd', range);
|
401
|
+
var s = stored_range.text.length - range.text.length;
|
402
|
+
|
403
|
+
caretPosition = s - (textarea.value.substr(0, s).length - textarea.value.substr(0, s).replace(/\r/g, '').length);
|
404
|
+
selection = range.text;
|
405
|
+
} else { // opera
|
406
|
+
caretPosition = textarea.selectionStart;
|
407
|
+
}
|
408
|
+
} else { // gecko & webkit
|
409
|
+
caretPosition = textarea.selectionStart;
|
410
|
+
selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
|
411
|
+
}
|
412
|
+
return selection;
|
413
|
+
}
|
414
|
+
|
415
|
+
// open preview window
|
416
|
+
function preview() {
|
417
|
+
if (!previewWindow || previewWindow.closed) {
|
418
|
+
if (options.previewInWindow) {
|
419
|
+
previewWindow = window.open('', 'preview', options.previewInWindow);
|
420
|
+
$(window).unload(function() {
|
421
|
+
previewWindow.close();
|
422
|
+
});
|
423
|
+
} else {
|
424
|
+
iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
|
425
|
+
if (options.previewPosition == 'after') {
|
426
|
+
iFrame.insertAfter(footer);
|
427
|
+
} else {
|
428
|
+
iFrame.insertBefore(header);
|
429
|
+
}
|
430
|
+
previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
|
431
|
+
}
|
432
|
+
} else if (altKey === true) {
|
433
|
+
if (iFrame) {
|
434
|
+
iFrame.remove();
|
435
|
+
} else {
|
436
|
+
previewWindow.close();
|
437
|
+
}
|
438
|
+
previewWindow = iFrame = false;
|
439
|
+
}
|
440
|
+
if (!options.previewAutoRefresh) {
|
441
|
+
refreshPreview();
|
442
|
+
}
|
443
|
+
if (options.previewInWindow) {
|
444
|
+
previewWindow.focus();
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
// refresh Preview window
|
449
|
+
function refreshPreview() {
|
450
|
+
renderPreview();
|
451
|
+
}
|
452
|
+
|
453
|
+
function renderPreview() {
|
454
|
+
var phtml;
|
455
|
+
if (options.previewParserPath !== '') {
|
456
|
+
$.ajax( {
|
457
|
+
type: 'POST',
|
458
|
+
url: options.previewParserPath,
|
459
|
+
data: options.previewParserVar+'='+encodeURIComponent($$.val()),
|
460
|
+
success: function(data) {
|
461
|
+
writeInPreview( localize(data, 1) );
|
462
|
+
}
|
463
|
+
} );
|
464
|
+
} else {
|
465
|
+
if (!template) {
|
466
|
+
$.ajax( {
|
467
|
+
url: options.previewTemplatePath,
|
468
|
+
success: function(data) {
|
469
|
+
writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
|
470
|
+
}
|
471
|
+
} );
|
472
|
+
}
|
473
|
+
}
|
474
|
+
return false;
|
475
|
+
}
|
476
|
+
|
477
|
+
function writeInPreview(data) {
|
478
|
+
if (previewWindow.document) {
|
479
|
+
try {
|
480
|
+
sp = previewWindow.document.documentElement.scrollTop
|
481
|
+
} catch(e) {
|
482
|
+
sp = 0;
|
483
|
+
}
|
484
|
+
previewWindow.document.open();
|
485
|
+
previewWindow.document.write(data);
|
486
|
+
previewWindow.document.close();
|
487
|
+
previewWindow.document.documentElement.scrollTop = sp;
|
488
|
+
}
|
489
|
+
}
|
490
|
+
|
491
|
+
// set keys pressed
|
492
|
+
function keyPressed(e) {
|
493
|
+
shiftKey = e.shiftKey;
|
494
|
+
altKey = e.altKey;
|
495
|
+
ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false;
|
496
|
+
|
497
|
+
if (e.type === 'keydown') {
|
498
|
+
if (ctrlKey === true) {
|
499
|
+
li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li');
|
500
|
+
if (li.length !== 0) {
|
501
|
+
ctrlKey = false;
|
502
|
+
setTimeout(function() {
|
503
|
+
li.triggerHandler('mousedown');
|
504
|
+
},1);
|
505
|
+
return false;
|
506
|
+
}
|
507
|
+
}
|
508
|
+
if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
|
509
|
+
if (ctrlKey === true) { // Enter + Ctrl
|
510
|
+
ctrlKey = false;
|
511
|
+
markup(options.onCtrlEnter);
|
512
|
+
return options.onCtrlEnter.keepDefault;
|
513
|
+
} else if (shiftKey === true) { // Enter + Shift
|
514
|
+
shiftKey = false;
|
515
|
+
markup(options.onShiftEnter);
|
516
|
+
return options.onShiftEnter.keepDefault;
|
517
|
+
} else { // only Enter
|
518
|
+
markup(options.onEnter);
|
519
|
+
return options.onEnter.keepDefault;
|
520
|
+
}
|
521
|
+
}
|
522
|
+
if (e.keyCode === 9) { // Tab key
|
523
|
+
if (shiftKey == true || ctrlKey == true || altKey == true) {
|
524
|
+
return false;
|
525
|
+
}
|
526
|
+
if (caretOffset !== -1) {
|
527
|
+
get();
|
528
|
+
caretOffset = $$.val().length - caretOffset;
|
529
|
+
set(caretOffset, 0);
|
530
|
+
caretOffset = -1;
|
531
|
+
return false;
|
532
|
+
} else {
|
533
|
+
markup(options.onTab);
|
534
|
+
return options.onTab.keepDefault;
|
535
|
+
}
|
536
|
+
}
|
537
|
+
}
|
538
|
+
}
|
539
|
+
|
540
|
+
init();
|
541
|
+
});
|
542
|
+
};
|
543
|
+
|
544
|
+
$.fn.markItUpRemove = function() {
|
545
|
+
return this.each(function() {
|
546
|
+
var $$ = $(this).unbind().removeClass('markItUpEditor');
|
547
|
+
$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
|
548
|
+
}
|
549
|
+
);
|
550
|
+
};
|
551
|
+
|
552
|
+
$.markItUp = function(settings) {
|
553
|
+
var options = { target:false };
|
554
|
+
$.extend(options, settings);
|
555
|
+
if (options.target) {
|
556
|
+
return $(options.target).each(function() {
|
557
|
+
$(this).focus();
|
558
|
+
$(this).trigger('insertion', [options]);
|
559
|
+
});
|
560
|
+
} else {
|
561
|
+
$('textarea').trigger('insertion', [options]);
|
562
|
+
}
|
563
|
+
};
|
564
|
+
})(jQuery);
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Markup language:
|
2
|
+
CSS
|
3
|
+
|
4
|
+
Description:
|
5
|
+
A CSS editor set with Bold, Italic, Stroke through, Lowercase, Uppercase,
|
6
|
+
Left/Center/Right/Justify Alignment, Text indent, Letter spacing, Line height,
|
7
|
+
Left/Top/Right/Bottom Padding and Margin, Background image and CSS file import.
|
8
|
+
|
9
|
+
Tips:
|
10
|
+
Alt+Padding button: Switch to margin
|
11
|
+
Ctrl+Enter: Quick insert comments
|
12
|
+
Shift+Enter: Quick insert Class name
|
13
|
+
|
14
|
+
Author:
|
15
|
+
Kevin Papst
|
16
|
+
http://www.kevinpapst.de/
|
17
|
+
|
18
|
+
Initially written for the BIGACE CMS:
|
19
|
+
http://www.bigace.de/
|
20
|
+
|
21
|
+
Feel free to drop a Comment :)
|
22
|
+
|
23
|
+
Install:
|
24
|
+
- Download the zip file
|
25
|
+
- Unzip it in your markItUp! sets folder
|
26
|
+
- Modify your JS link to point at this set.js
|
27
|
+
- Modify your CSS link to point at this style.css
|
28
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
// ----------------------------------------------------------------------------
|
2
|
+
// markItUp!
|
3
|
+
// ----------------------------------------------------------------------------
|
4
|
+
// Copyright (C) 2008 Jay Salvat
|
5
|
+
// http://markitup.jaysalvat.com/
|
6
|
+
// ----------------------------------------------------------------------------
|
7
|
+
// CSS set by Kevin Papst
|
8
|
+
// http://www.kevinpapst.de/
|
9
|
+
// Initially written for the BIGACE CMS:
|
10
|
+
// http://www.bigace.de/
|
11
|
+
// ----------------------------------------------------------------------------
|
12
|
+
// Basic CSS set. Feel free to add more tags
|
13
|
+
// ----------------------------------------------------------------------------
|
14
|
+
mySettings = {
|
15
|
+
onEnter: {},
|
16
|
+
onShiftEnter: {keepDefault:false, placeHolder:'Your comment here', openWith:'\n\/* ', closeWith:' *\/'},
|
17
|
+
onCtrlEnter: {keepDefault:false, placeHolder:"classname", openWith:'\n.', closeWith:' { \n'},
|
18
|
+
onTab: {keepDefault:false, openWith:' '},
|
19
|
+
markupSet: [
|
20
|
+
{name:'Class', className:'class', key:'N', placeHolder:'Properties here...', openWith:'.[![Class name]!] {\n', closeWith:'\n}'},
|
21
|
+
{separator:'---------------' },
|
22
|
+
{name:'Bold', className:'bold', key:'B', replaceWith:'font-weight:bold;'},
|
23
|
+
{name:'Italic', className:'italic', key:'I', replaceWith:'font-style:italic;'},
|
24
|
+
{name:'Stroke through', className:'stroke', key:'S', replaceWith:'text-decoration:line-through;'},
|
25
|
+
{separator:'---------------' },
|
26
|
+
{name:'Lowercase', className:'lowercase', key:'L', replaceWith:'text-transform:lowercase;'},
|
27
|
+
{name:'Uppercase', className:'uppercase', key:'U', replaceWith:'text-transform:uppercase;'},
|
28
|
+
{separator:'---------------' },
|
29
|
+
{name:'Text indent', className:'indent', openWith:'text-indent:', placeHolder:'5px', closeWith:';' },
|
30
|
+
{name:'Letter spacing', className:'letterspacing', openWith:'letter-spacing:', placeHolder:'5px', closeWith:';' },
|
31
|
+
{name:'Line height', className:'lineheight', openWith:'line-height:', placeHolder:'1.5', closeWith:';' },
|
32
|
+
{separator:'---------------' },
|
33
|
+
{name:'Alignments', className:'alignments', dropMenu:[
|
34
|
+
{name:'Left', className:'left', replaceWith:'text-align:left;'},
|
35
|
+
{name:'Center', className:'center', replaceWith:'text-align:center;'},
|
36
|
+
{name:'Right', className:'right', replaceWith:'text-align:right;'},
|
37
|
+
{name:'Justify', className:'justify', replaceWith:'text-align:justify;'}
|
38
|
+
]
|
39
|
+
},
|
40
|
+
{name:'Padding/Margin', className:'padding', dropMenu:[
|
41
|
+
{name:'Top', className:'top', openWith:'(!(padding|!|margin)!)-top:', placeHolder:'5px', closeWith:';' },
|
42
|
+
{name:'Left', className:'left', openWith:'(!(padding|!|margin)!)-left:', placeHolder:'5px', closeWith:';' },
|
43
|
+
{name:'Right', className:'right', openWith:'(!(padding|!|margin)!)-right:', placeHolder:'5px', closeWith:';' },
|
44
|
+
{name:'Bottom', className:'bottom', openWith:'(!(padding|!|margin)!)-bottom:', placeHolder:'5px', closeWith:';' }
|
45
|
+
]
|
46
|
+
},
|
47
|
+
{separator:'---------------' },
|
48
|
+
{name:'Background Image', className:'background', replaceWith:'background:url([![Source:!:http://]!]) no-repeat 0 0;' },
|
49
|
+
{separator:'---------------' },
|
50
|
+
{name:'Import CSS file', className:'css', replaceWith:'@import "[![Source file:!:.css]!]";' }
|
51
|
+
]
|
52
|
+
}
|