wagn 1.12.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +24 -0
- data/.rspec +4 -0
- data/CONTRIBUTING.rdoc +13 -0
- data/GPL +331 -0
- data/Gemfile +87 -0
- data/LICENSE +16 -0
- data/README.rdoc +103 -0
- data/Rakefile +7 -0
- data/VERSION +1 -0
- data/app/assets/images/body-bg.bmp +0 -0
- data/app/assets/images/body-bg.png +0 -0
- data/app/assets/images/external_link.png +0 -0
- data/app/assets/images/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/javascripts/application.js +25 -0
- data/app/assets/javascripts/html5shiv-printshiv.js +499 -0
- data/app/assets/javascripts/jquery.autosize.js +254 -0
- data/app/assets/javascripts/jquery.fileupload.js +1111 -0
- data/app/assets/javascripts/jquery.iframe-transport.js +156 -0
- data/app/assets/javascripts/jquery.ui.autocomplete.html.js +40 -0
- data/app/assets/javascripts/wagn.js.coffee +288 -0
- data/app/assets/javascripts/wagn_menu.js +76 -0
- data/app/assets/javascripts/wagn_mod.js.coffee +401 -0
- data/app/controllers/account_controller.rb +67 -0
- data/app/controllers/admin_controller.rb +130 -0
- data/app/controllers/card_controller.rb +163 -0
- data/app/controllers/stub_card_controller.rb +9 -0
- data/app/controllers/wagn_controller.rb +123 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/mailers/mailer.rb +108 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/account.rb +196 -0
- data/app/models/card.rb +42 -0
- data/app/models/card/reference.rb +71 -0
- data/app/models/card/revision.rb +45 -0
- data/app/models/user.rb +123 -0
- data/app/views/mailer/account_info.text.erb +17 -0
- data/app/views/mailer/change_notice.html.erb +32 -0
- data/app/views/mailer/flexmail.html.erb +6 -0
- data/app/views/mailer/signup_alert.html.erb +14 -0
- data/bin/wagn +9 -0
- data/config.ru +4 -0
- data/config/application.rb +15 -0
- data/config/boot.rb +8 -0
- data/config/environment.rb +8 -0
- data/config/environments/cucumber.rb +30 -0
- data/config/environments/development.rb +59 -0
- data/config/environments/production.rb +65 -0
- data/config/environments/profile.rb +28 -0
- data/config/environments/test.rb +45 -0
- data/config/initializers/01_init_ruby_extensions.rb +76 -0
- data/config/initializers/airbrake.rb +10 -0
- data/config/initializers/backtrace_silencers.rb +8 -0
- data/config/initializers/inflections.rb +13 -0
- data/config/initializers/mime_types.rb +13 -0
- data/config/initializers/notification.rb +4 -0
- data/config/initializers/recaptcha.rb +6 -0
- data/config/initializers/schema_views.rb +59 -0
- data/config/initializers/secret_token.rb +9 -0
- data/config/initializers/session_store.rb +9 -0
- data/config/initializers/uuid_state_file.rb +2 -0
- data/config/initializers/wrap_parameters.rb +15 -0
- data/config/routes.rb +45 -0
- data/config/samples/asset_htaccess +9 -0
- data/config/samples/cucumber.yml +8 -0
- data/config/samples/database.yml.erb +34 -0
- data/config/samples/robots.txt +12 -0
- data/config/version.txt +1 -0
- data/config/version_cards.txt +1 -0
- data/db/bootstrap/card_references.yml +1478 -0
- data/db/bootstrap/card_revisions.yml +3561 -0
- data/db/bootstrap/cards.yml +7192 -0
- data/db/bootstrap/users.yml +29 -0
- data/db/migrate/20110511221913_require_earlier_migrations.rb +17 -0
- data/db/migrate/20120105203350_require_1_8_migrations.rb +15 -0
- data/db/migrate/20121111025347_require_1_10_migrations.rb +15 -0
- data/db/migrate/20121118114000_split_link_type.rb +16 -0
- data/db/migrate/20121118115000_update_link_type.rb +19 -0
- data/db/migrate/20130106052640_table_cleanup.rb +25 -0
- data/db/migrate/20130109015336_trunk_left.rb +14 -0
- data/db/migrate/20130411210957_update_codenames.rb +14 -0
- data/db/migrate_cards/20130411191151_renaming_for_menu.rb +56 -0
- data/db/migrate_cards/20130411211600_delete_old_related_tab_cards.rb +27 -0
- data/db/migrate_cards/20130419215612_import_help_text.rb +23 -0
- data/db/migrate_cards/20130823192433_add_style_cards.rb +95 -0
- data/db/migrate_cards/20130910183318_move_styles_to_content.rb +19 -0
- data/db/migrate_cards/20130920214038_jsonize_tinymce.rb +24 -0
- data/db/migrate_cards/20130920291703_update_stylesheets.rb +26 -0
- data/db/migrate_cards/20130927191728_account_events.rb +29 -0
- data/db/migrate_cards/20131016172445_common_css_patch.rb +21 -0
- data/db/migrate_cards/20140110193325_reset_account_request_type.rb +19 -0
- data/db/migrate_cards/data/1.11_help_text.json +410 -0
- data/db/migrate_cards/data/1.12_stylesheets/classic_cards.scss +101 -0
- data/db/migrate_cards/data/1.12_stylesheets/common.scss +226 -0
- data/db/migrate_cards/data/1.12_stylesheets/right_sidebar.scss +27 -0
- data/db/migrate_cards/data/1.12_stylesheets/traditional.scss +152 -0
- data/db/schema.rb +92 -0
- data/db/seeds.rb +8 -0
- data/features/account_requests.feature +22 -0
- data/features/autonaming.feature +21 -0
- data/features/content_settings.feature +44 -0
- data/features/flexmail.feature +54 -0
- data/features/google_maps.feature +31 -0
- data/features/hello_wagn.feature +29 -0
- data/features/layouts.feature +23 -0
- data/features/notifications.feature +31 -0
- data/features/pattern_settings.feature +43 -0
- data/features/pointer_inputs.feature +81 -0
- data/features/presetting_content.feature +12 -0
- data/features/step_definitions/email_steps.rb +183 -0
- data/features/step_definitions/notification_steps.rb +23 -0
- data/features/step_definitions/wagn_steps.rb +207 -0
- data/features/step_definitions/web_steps.rb +138 -0
- data/features/support/env.rb +58 -0
- data/features/support/paths.rb +58 -0
- data/features/support/scopes.rb +22 -0
- data/features/support/wag_env.rb +11 -0
- data/features/table_of_contents.feature +35 -0
- data/features/templates.feature +30 -0
- data/features/update_includers.feature +68 -0
- data/features/virtual_cards.feature +11 -0
- data/features/watch.feature +54 -0
- data/lib/active_record/foreign_keys.rb +80 -0
- data/lib/active_record/quoting_and_matching.rb +72 -0
- data/lib/card/chunk.rb +103 -0
- data/lib/card/codename.rb +47 -0
- data/lib/card/constant.rb +20 -0
- data/lib/card/content.rb +206 -0
- data/lib/card/diff.rb +317 -0
- data/lib/card/exceptions.rb +22 -0
- data/lib/card/flexmail.rb +47 -0
- data/lib/card/format.rb +541 -0
- data/lib/card/name.rb +39 -0
- data/lib/card/query.rb +81 -0
- data/lib/card/query/card_spec.rb +516 -0
- data/lib/card/query/ref_spec.rb +23 -0
- data/lib/card/query/spec.rb +21 -0
- data/lib/card/query/value_spec.rb +66 -0
- data/lib/card/set.rb +239 -0
- data/lib/card/set_pattern.rb +140 -0
- data/lib/generators/card_migration/USAGE +12 -0
- data/lib/generators/card_migration/card_migration_generator.rb +10 -0
- data/lib/generators/card_migration/templates/card_migration.erb +16 -0
- data/lib/generators/format/USAGE +9 -0
- data/lib/generators/format/format_generator.rb +8 -0
- data/lib/generators/format/templates/format_spec_template.erb +6 -0
- data/lib/generators/format/templates/format_template.erb +3 -0
- data/lib/generators/set/USAGE +9 -0
- data/lib/generators/set/set_generator.rb +14 -0
- data/lib/generators/set/templates/set_spec_template.erb +6 -0
- data/lib/generators/set/templates/set_template.erb +1 -0
- data/lib/generators/wagn/USAGE +8 -0
- data/lib/generators/wagn/templates/Gemfile +5 -0
- data/lib/generators/wagn/templates/Rakefile +7 -0
- data/lib/generators/wagn/templates/config.ru +5 -0
- data/lib/generators/wagn/templates/config/application.rb +47 -0
- data/lib/generators/wagn/templates/config/boot.rb +11 -0
- data/lib/generators/wagn/templates/config/database.yml +35 -0
- data/lib/generators/wagn/templates/config/databases/frontbase.yml +31 -0
- data/lib/generators/wagn/templates/config/databases/ibm_db.yml +86 -0
- data/lib/generators/wagn/templates/config/databases/jdbc.yml +62 -0
- data/lib/generators/wagn/templates/config/databases/jdbcmysql.yml +33 -0
- data/lib/generators/wagn/templates/config/databases/jdbcpostgresql.yml +43 -0
- data/lib/generators/wagn/templates/config/databases/jdbcsqlite3.yml +20 -0
- data/lib/generators/wagn/templates/config/databases/mysql.yml +54 -0
- data/lib/generators/wagn/templates/config/databases/oracle.yml +39 -0
- data/lib/generators/wagn/templates/config/databases/postgresql.yml +55 -0
- data/lib/generators/wagn/templates/config/databases/sqlite3.yml +25 -0
- data/lib/generators/wagn/templates/config/environment.rb +5 -0
- data/lib/generators/wagn/templates/gitignore +18 -0
- data/lib/generators/wagn/templates/script/wagn +5 -0
- data/lib/generators/wagn/wagn_generator.rb +127 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/cucumber.rake +68 -0
- data/lib/tasks/db.rake +54 -0
- data/lib/tasks/test.rake +94 -0
- data/lib/tasks/wagn.rake +215 -0
- data/lib/wagn.rb +33 -0
- data/lib/wagn/all.rb +16 -0
- data/lib/wagn/application.rb +96 -0
- data/lib/wagn/authenticated_system.rb +38 -0
- data/lib/wagn/cache.rb +176 -0
- data/lib/wagn/cli.rb +17 -0
- data/lib/wagn/commands.rb +2 -0
- data/lib/wagn/commands/application.rb +10 -0
- data/lib/wagn/env.rb +42 -0
- data/lib/wagn/exceptions.rb +10 -0
- data/lib/wagn/loader.rb +135 -0
- data/lib/wagn/location.rb +88 -0
- data/lib/wagn/migration_helper.rb +32 -0
- data/lib/wagn/script_wagn_loader.rb +29 -0
- data/lib/wagn/spec_helper.rb +99 -0
- data/lib/wagn/version.rb +27 -0
- data/mods/core/chunks/literal.rb +24 -0
- data/mods/core/chunks/reference.rb +41 -0
- data/mods/core/chunks/uri.rb +135 -0
- data/mods/core/formats/data_format.rb +2 -0
- data/mods/core/formats/html_format.rb +319 -0
- data/mods/core/formats/text_format.rb +5 -0
- data/mods/core/layouts/blank.html +5 -0
- data/mods/core/layouts/default.html +20 -0
- data/mods/core/layouts/noside.html +16 -0
- data/mods/core/layouts/pre.html +2 -0
- data/mods/core/layouts/simple.html +5 -0
- data/mods/core/set_patterns/01_all.rb +12 -0
- data/mods/core/set_patterns/02_all_plus.rb +11 -0
- data/mods/core/set_patterns/03_type.rb +19 -0
- data/mods/core/set_patterns/04_star.rb +11 -0
- data/mods/core/set_patterns/05_rstar.rb +13 -0
- data/mods/core/set_patterns/06_right.rb +16 -0
- data/mods/core/set_patterns/07_type_plus_right.rb +19 -0
- data/mods/core/set_patterns/08_self.rb +15 -0
- data/mods/core/sets/all/active_card.rb +21 -0
- data/mods/core/sets/all/attribute_tracking.rb +85 -0
- data/mods/core/sets/all/collection.rb +46 -0
- data/mods/core/sets/all/content.rb +90 -0
- data/mods/core/sets/all/fetch.rb +198 -0
- data/mods/core/sets/all/initialize.rb +45 -0
- data/mods/core/sets/all/name.rb +266 -0
- data/mods/core/sets/all/pattern.rb +79 -0
- data/mods/core/sets/all/permissions.rb +218 -0
- data/mods/core/sets/all/phases.rb +159 -0
- data/mods/core/sets/all/references.rb +102 -0
- data/mods/core/sets/all/rules.rb +125 -0
- data/mods/core/sets/all/states.rb +16 -0
- data/mods/core/sets/all/templating.rb +118 -0
- data/mods/core/sets/all/tracked_attributes.rb +145 -0
- data/mods/core/sets/all/trash.rb +45 -0
- data/mods/core/sets/all/type.rb +70 -0
- data/mods/core/sets/all/utils.rb +91 -0
- data/mods/standard/chunks/include.rb +85 -0
- data/mods/standard/chunks/link.rb +84 -0
- data/mods/standard/formats/css_format.rb +3 -0
- data/mods/standard/formats/csv_format.rb +3 -0
- data/mods/standard/formats/email_html_format.rb +9 -0
- data/mods/standard/formats/file_format.rb +3 -0
- data/mods/standard/formats/json_format.rb +3 -0
- data/mods/standard/formats/kml_format.rb +3 -0
- data/mods/standard/formats/rss_format.rb +8 -0
- data/mods/standard/formats/xml_format.rb +3 -0
- data/mods/standard/lib/google_maps_addon.rb +30 -0
- data/mods/standard/lib/stylesheets/functional.scss +181 -0
- data/mods/standard/lib/stylesheets/jquery-ui-smoothness.css +474 -0
- data/mods/standard/lib/stylesheets/standard.scss +614 -0
- data/mods/standard/sets/all/account.rb +241 -0
- data/mods/standard/sets/all/admin.rb +53 -0
- data/mods/standard/sets/all/all_css.rb +39 -0
- data/mods/standard/sets/all/all_csv.rb +53 -0
- data/mods/standard/sets/all/attach.rb +143 -0
- data/mods/standard/sets/all/base.rb +136 -0
- data/mods/standard/sets/all/comment.rb +39 -0
- data/mods/standard/sets/all/email_html.rb +7 -0
- data/mods/standard/sets/all/file.rb +14 -0
- data/mods/standard/sets/all/flexmail.rb +3 -0
- data/mods/standard/sets/all/follow.rb +117 -0
- data/mods/standard/sets/all/geocode.rb +16 -0
- data/mods/standard/sets/all/history.rb +112 -0
- data/mods/standard/sets/all/json.rb +73 -0
- data/mods/standard/sets/all/kml.rb +48 -0
- data/mods/standard/sets/all/rich_html.rb +472 -0
- data/mods/standard/sets/all/rss.rb +66 -0
- data/mods/standard/sets/all/text.rb +9 -0
- data/mods/standard/sets/right/account.rb +1 -0
- data/mods/standard/sets/right/add_help.rb +1 -0
- data/mods/standard/sets/right/comment.rb +3 -0
- data/mods/standard/sets/right/create.rb +82 -0
- data/mods/standard/sets/right/crypted_password.rb +4 -0
- data/mods/standard/sets/right/default.rb +2 -0
- data/mods/standard/sets/right/delete.rb +3 -0
- data/mods/standard/sets/right/email.rb +5 -0
- data/mods/standard/sets/right/help.rb +1 -0
- data/mods/standard/sets/right/read.rb +3 -0
- data/mods/standard/sets/right/salt.rb +4 -0
- data/mods/standard/sets/right/structure.rb +11 -0
- data/mods/standard/sets/right/style.rb +67 -0
- data/mods/standard/sets/right/update.rb +3 -0
- data/mods/standard/sets/right/when_created.rb +5 -0
- data/mods/standard/sets/right/when_last_edited.rb +5 -0
- data/mods/standard/sets/rstar/rules.rb +235 -0
- data/mods/standard/sets/self/account_links.rb +30 -0
- data/mods/standard/sets/self/alerts.rb +6 -0
- data/mods/standard/sets/self/foot.rb +9 -0
- data/mods/standard/sets/self/head.rb +105 -0
- data/mods/standard/sets/self/navbox.rb +28 -0
- data/mods/standard/sets/self/now.rb +7 -0
- data/mods/standard/sets/self/recent.rb +45 -0
- data/mods/standard/sets/self/search.rb +37 -0
- data/mods/standard/sets/self/style_functional.rb +8 -0
- data/mods/standard/sets/self/style_jquery_ui_smoothness.rb +8 -0
- data/mods/standard/sets/self/style_standard.rb +8 -0
- data/mods/standard/sets/self/version.rb +8 -0
- data/mods/standard/sets/type/account_request.rb +81 -0
- data/mods/standard/sets/type/basic.rb +43 -0
- data/mods/standard/sets/type/cardtype.rb +32 -0
- data/mods/standard/sets/type/css.rb +17 -0
- data/mods/standard/sets/type/date.rb +9 -0
- data/mods/standard/sets/type/file.rb +87 -0
- data/mods/standard/sets/type/html.rb +17 -0
- data/mods/standard/sets/type/image.rb +67 -0
- data/mods/standard/sets/type/layout_type.rb +11 -0
- data/mods/standard/sets/type/number.rb +20 -0
- data/mods/standard/sets/type/phrase.rb +3 -0
- data/mods/standard/sets/type/plain_text.rb +10 -0
- data/mods/standard/sets/type/pointer.rb +219 -0
- data/mods/standard/sets/type/ruby_and_script.rb +31 -0
- data/mods/standard/sets/type/scss.rb +34 -0
- data/mods/standard/sets/type/search_type.rb +268 -0
- data/mods/standard/sets/type/set.rb +109 -0
- data/mods/standard/sets/type/setting.rb +88 -0
- data/mods/standard/sets/type/skin.rb +27 -0
- data/mods/standard/sets/type/toggle.rb +12 -0
- data/mods/standard/sets/type/user.rb +24 -0
- data/public/404.html +27 -0
- data/public/500.html +28 -0
- data/public/assets/application-7f1664ac8e65db8af0bfa6539e23c7df.js +103 -0
- data/public/assets/application-7f1664ac8e65db8af0bfa6539e23c7df.js.gz +0 -0
- data/public/assets/application.js +103 -0
- data/public/assets/application.js.gz +0 -0
- data/public/assets/body-bg-660b752b44b87594071f3d0851ac5360.png +0 -0
- data/public/assets/body-bg-d031f29b6ba7399a6862382c3552f44c.bmp +0 -0
- data/public/assets/body-bg.bmp +0 -0
- data/public/assets/body-bg.png +0 -0
- data/public/assets/external_link-b15ab5051b4ec6f32892ed80019405b5.png +0 -0
- data/public/assets/external_link.png +0 -0
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js +1 -0
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
- data/public/assets/html5shiv-printshiv.js +1 -0
- data/public/assets/html5shiv-printshiv.js.gz +0 -0
- data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100-7d1197a52442bc56fcad60d0390f4b32.png +0 -0
- data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/images/ui-bg_flat_75_ffffff_40x100-3c4b974defa5e8bdaf8a603034c4435e.png +0 -0
- data/public/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400-38c2dea4d046fd3f56cc3996e2e6018b.png +0 -0
- data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_65_ffffff_1x400-ddb7ee7527bff283054406c50e597e1e.png +0 -0
- data/public/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_75_dadada_1x400-d618461418b1ebc6b7996979f4c3dc92.png +0 -0
- data/public/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400-48d8d545f708e5870a965ce9df8b0e38.png +0 -0
- data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_95_fef1ec_1x400-f3526b8f82249928f0a6baf044204b15.png +0 -0
- data/public/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100-cec5c56503b8480f834c3fce35dae8df.png +0 -0
- data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/assets/images/ui-icons_222222_256x240-66e635a2f90b9f90675d402617630b24.png +0 -0
- data/public/assets/images/ui-icons_222222_256x240.png +0 -0
- data/public/assets/images/ui-icons_2e83ff_256x240-2ea4c160a75c1992daa2eeac86255b99.png +0 -0
- data/public/assets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/assets/images/ui-icons_454545_256x240-5c7f12676bcead9cb2d4cb8f23f16e95.png +0 -0
- data/public/assets/images/ui-icons_454545_256x240.png +0 -0
- data/public/assets/images/ui-icons_888888_256x240-95fd3047e1f7325d995a21c729b04125.png +0 -0
- data/public/assets/images/ui-icons_888888_256x240.png +0 -0
- data/public/assets/images/ui-icons_cd0a0a_256x240-c0c1ec6a8bcf48fec40303e975a4dfa6.png +0 -0
- data/public/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquerymobile/ajax-loader-a8a4bc1c4b502e156ed451507987eed7.png +0 -0
- data/public/assets/jquerymobile/ajax-loader-cad1a448fe000d9643c57860e5493861.gif +0 -0
- data/public/assets/jquerymobile/ajax-loader.gif +0 -0
- data/public/assets/jquerymobile/ajax-loader.png +0 -0
- data/public/assets/jquerymobile/icons-18-black-b6e62647e8518462e73fd052bfe25d6c.png +0 -0
- data/public/assets/jquerymobile/icons-18-black.png +0 -0
- data/public/assets/jquerymobile/icons-18-white-f4ae730f6acc1e5b1781652e5d6973c7.png +0 -0
- data/public/assets/jquerymobile/icons-18-white.png +0 -0
- data/public/assets/jquerymobile/icons-36-black-13a52024f9a92e59a69dca49014d9292.png +0 -0
- data/public/assets/jquerymobile/icons-36-black.png +0 -0
- data/public/assets/jquerymobile/icons-36-white-3b109c0900c418fd2e5468dfb35b3f59.png +0 -0
- data/public/assets/jquerymobile/icons-36-white.png +0 -0
- data/public/assets/manifest.yml +395 -0
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js +13 -0
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
- data/public/assets/tinymce.js +13 -0
- data/public/assets/tinymce.js.gz +0 -0
- data/public/assets/tinymce/jquery.tinymce.js +1 -0
- data/public/assets/tinymce/langs/en.js +1 -0
- data/public/assets/tinymce/license.txt +504 -0
- data/public/assets/tinymce/plugins/advhr/css/advhr.css +5 -0
- data/public/assets/tinymce/plugins/advhr/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/advhr/editor_plugin_src.js +57 -0
- data/public/assets/tinymce/plugins/advhr/js/rule.js +43 -0
- data/public/assets/tinymce/plugins/advhr/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/advhr/rule.htm +58 -0
- data/public/assets/tinymce/plugins/advimage/css/advimage.css +13 -0
- data/public/assets/tinymce/plugins/advimage/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/advimage/editor_plugin_src.js +50 -0
- data/public/assets/tinymce/plugins/advimage/image.htm +235 -0
- data/public/assets/tinymce/plugins/advimage/img/sample.gif +0 -0
- data/public/assets/tinymce/plugins/advimage/js/image.js +464 -0
- data/public/assets/tinymce/plugins/advimage/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/advlink/css/advlink.css +8 -0
- data/public/assets/tinymce/plugins/advlink/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/advlink/editor_plugin_src.js +61 -0
- data/public/assets/tinymce/plugins/advlink/js/advlink.js +543 -0
- data/public/assets/tinymce/plugins/advlink/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/advlink/link.htm +338 -0
- data/public/assets/tinymce/plugins/advlist/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/advlist/editor_plugin_src.js +176 -0
- data/public/assets/tinymce/plugins/autolink/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/autolink/editor_plugin_src.js +184 -0
- data/public/assets/tinymce/plugins/autoresize/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/autoresize/editor_plugin_src.js +119 -0
- data/public/assets/tinymce/plugins/autosave/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/autosave/editor_plugin_src.js +433 -0
- data/public/assets/tinymce/plugins/bbcode/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/bbcode/editor_plugin_src.js +120 -0
- data/public/assets/tinymce/plugins/contextmenu/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/contextmenu/editor_plugin_src.js +163 -0
- data/public/assets/tinymce/plugins/directionality/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/directionality/editor_plugin_src.js +85 -0
- data/public/assets/tinymce/plugins/emotions/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/emotions/editor_plugin_src.js +43 -0
- data/public/assets/tinymce/plugins/emotions/emotions.htm +42 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-cool.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-cry.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-embarassed.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-frown.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-innocent.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-kiss.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-laughing.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-sealed.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-smile.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-surprised.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-undecided.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-wink.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/img/smiley-yell.gif +0 -0
- data/public/assets/tinymce/plugins/emotions/js/emotions.js +43 -0
- data/public/assets/tinymce/plugins/emotions/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/example/dialog.htm +22 -0
- data/public/assets/tinymce/plugins/example/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/example/editor_plugin_src.js +84 -0
- data/public/assets/tinymce/plugins/example/img/example.gif +0 -0
- data/public/assets/tinymce/plugins/example/js/dialog.js +19 -0
- data/public/assets/tinymce/plugins/example/langs/en.js +3 -0
- data/public/assets/tinymce/plugins/example/langs/en_dlg.js +3 -0
- data/public/assets/tinymce/plugins/example_dependency/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/example_dependency/editor_plugin_src.js +50 -0
- data/public/assets/tinymce/plugins/fullpage/css/fullpage.css +143 -0
- data/public/assets/tinymce/plugins/fullpage/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/fullpage/editor_plugin_src.js +405 -0
- data/public/assets/tinymce/plugins/fullpage/fullpage.htm +259 -0
- data/public/assets/tinymce/plugins/fullpage/js/fullpage.js +232 -0
- data/public/assets/tinymce/plugins/fullpage/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/fullscreen/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/fullscreen/editor_plugin_src.js +234 -0
- data/public/assets/tinymce/plugins/fullscreen/fullscreen.htm +117 -0
- data/public/assets/tinymce/plugins/iespell/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/iespell/editor_plugin_src.js +54 -0
- data/public/assets/tinymce/plugins/inlinepopups/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/inlinepopups/editor_plugin_src.js +699 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/public/assets/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
- data/public/assets/tinymce/plugins/inlinepopups/template.htm +387 -0
- data/public/assets/tinymce/plugins/insertdatetime/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/insertdatetime/editor_plugin_src.js +83 -0
- data/public/assets/tinymce/plugins/layer/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/layer/editor_plugin_src.js +262 -0
- data/public/assets/tinymce/plugins/legacyoutput/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/legacyoutput/editor_plugin_src.js +139 -0
- data/public/assets/tinymce/plugins/lists/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/lists/editor_plugin_src.js +955 -0
- data/public/assets/tinymce/plugins/media/css/media.css +17 -0
- data/public/assets/tinymce/plugins/media/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/media/editor_plugin_src.js +898 -0
- data/public/assets/tinymce/plugins/media/js/embed.js +73 -0
- data/public/assets/tinymce/plugins/media/js/media.js +513 -0
- data/public/assets/tinymce/plugins/media/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/media/media.htm +922 -0
- data/public/assets/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/public/assets/tinymce/plugins/nonbreaking/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/nonbreaking/editor_plugin_src.js +54 -0
- data/public/assets/tinymce/plugins/noneditable/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/noneditable/editor_plugin_src.js +537 -0
- data/public/assets/tinymce/plugins/pagebreak/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/pagebreak/editor_plugin_src.js +74 -0
- data/public/assets/tinymce/plugins/paste/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/paste/editor_plugin_src.js +885 -0
- data/public/assets/tinymce/plugins/paste/js/pastetext.js +36 -0
- data/public/assets/tinymce/plugins/paste/js/pasteword.js +51 -0
- data/public/assets/tinymce/plugins/paste/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/paste/pastetext.htm +27 -0
- data/public/assets/tinymce/plugins/paste/pasteword.htm +21 -0
- data/public/assets/tinymce/plugins/preview/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/preview/editor_plugin_src.js +53 -0
- data/public/assets/tinymce/plugins/preview/example.html +28 -0
- data/public/assets/tinymce/plugins/preview/jscripts/embed.js +73 -0
- data/public/assets/tinymce/plugins/preview/preview.html +17 -0
- data/public/assets/tinymce/plugins/print/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/print/editor_plugin_src.js +34 -0
- data/public/assets/tinymce/plugins/save/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/save/editor_plugin_src.js +101 -0
- data/public/assets/tinymce/plugins/searchreplace/css/searchreplace.css +6 -0
- data/public/assets/tinymce/plugins/searchreplace/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/searchreplace/editor_plugin_src.js +61 -0
- data/public/assets/tinymce/plugins/searchreplace/js/searchreplace.js +148 -0
- data/public/assets/tinymce/plugins/searchreplace/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/searchreplace/searchreplace.htm +100 -0
- data/public/assets/tinymce/plugins/spellchecker/css/content.css +1 -0
- data/public/assets/tinymce/plugins/spellchecker/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/spellchecker/editor_plugin_src.js +471 -0
- data/public/assets/tinymce/plugins/spellchecker/img/wline.gif +0 -0
- data/public/assets/tinymce/plugins/style/css/props.css +14 -0
- data/public/assets/tinymce/plugins/style/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/style/editor_plugin_src.js +71 -0
- data/public/assets/tinymce/plugins/style/js/props.js +709 -0
- data/public/assets/tinymce/plugins/style/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/style/props.htm +845 -0
- data/public/assets/tinymce/plugins/style/readme.txt +19 -0
- data/public/assets/tinymce/plugins/tabfocus/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/tabfocus/editor_plugin_src.js +122 -0
- data/public/assets/tinymce/plugins/table/cell.htm +180 -0
- data/public/assets/tinymce/plugins/table/css/cell.css +17 -0
- data/public/assets/tinymce/plugins/table/css/row.css +25 -0
- data/public/assets/tinymce/plugins/table/css/table.css +13 -0
- data/public/assets/tinymce/plugins/table/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/table/editor_plugin_src.js +1456 -0
- data/public/assets/tinymce/plugins/table/js/cell.js +319 -0
- data/public/assets/tinymce/plugins/table/js/merge_cells.js +27 -0
- data/public/assets/tinymce/plugins/table/js/row.js +254 -0
- data/public/assets/tinymce/plugins/table/js/table.js +501 -0
- data/public/assets/tinymce/plugins/table/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/table/merge_cells.htm +32 -0
- data/public/assets/tinymce/plugins/table/row.htm +158 -0
- data/public/assets/tinymce/plugins/table/table.htm +188 -0
- data/public/assets/tinymce/plugins/template/blank.htm +12 -0
- data/public/assets/tinymce/plugins/template/css/template.css +23 -0
- data/public/assets/tinymce/plugins/template/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/template/editor_plugin_src.js +159 -0
- data/public/assets/tinymce/plugins/template/js/template.js +106 -0
- data/public/assets/tinymce/plugins/template/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/plugins/template/template.htm +31 -0
- data/public/assets/tinymce/plugins/visualblocks/css/visualblocks.css +21 -0
- data/public/assets/tinymce/plugins/visualblocks/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/visualblocks/editor_plugin_src.js +63 -0
- data/public/assets/tinymce/plugins/visualchars/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/visualchars/editor_plugin_src.js +83 -0
- data/public/assets/tinymce/plugins/wordcount/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/wordcount/editor_plugin_src.js +122 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/abbr.htm +142 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/acronym.htm +142 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/attributes.htm +149 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/cite.htm +142 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/css/attributes.css +11 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/css/popup.css +9 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/del.htm +162 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/editor_plugin.js +1 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/ins.htm +162 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/abbr.js +28 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/acronym.js +28 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/attributes.js +111 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/cite.js +28 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/del.js +53 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/element_common.js +229 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/js/ins.js +53 -0
- data/public/assets/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/themes/advanced/about.htm +52 -0
- data/public/assets/tinymce/themes/advanced/anchor.htm +26 -0
- data/public/assets/tinymce/themes/advanced/charmap.htm +55 -0
- data/public/assets/tinymce/themes/advanced/color_picker.htm +70 -0
- data/public/assets/tinymce/themes/advanced/editor_template.js +1 -0
- data/public/assets/tinymce/themes/advanced/editor_template_src.js +1490 -0
- data/public/assets/tinymce/themes/advanced/image.htm +80 -0
- data/public/assets/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
- data/public/assets/tinymce/themes/advanced/img/flash.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/icons.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/iframe.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/pagebreak.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/quicktime.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/realmedia.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/shockwave.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/trans.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/video.gif +0 -0
- data/public/assets/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
- data/public/assets/tinymce/themes/advanced/js/about.js +73 -0
- data/public/assets/tinymce/themes/advanced/js/anchor.js +56 -0
- data/public/assets/tinymce/themes/advanced/js/charmap.js +363 -0
- data/public/assets/tinymce/themes/advanced/js/color_picker.js +345 -0
- data/public/assets/tinymce/themes/advanced/js/image.js +253 -0
- data/public/assets/tinymce/themes/advanced/js/link.js +159 -0
- data/public/assets/tinymce/themes/advanced/js/source_editor.js +78 -0
- data/public/assets/tinymce/themes/advanced/langs/en.js +1 -0
- data/public/assets/tinymce/themes/advanced/langs/en_dlg.js +1 -0
- data/public/assets/tinymce/themes/advanced/link.htm +57 -0
- data/public/assets/tinymce/themes/advanced/shortcuts.htm +47 -0
- data/public/assets/tinymce/themes/advanced/skins/default/content.css +50 -0
- data/public/assets/tinymce/themes/advanced/skins/default/dialog.css +118 -0
- data/public/assets/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/public/assets/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
- data/public/assets/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/public/assets/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/public/assets/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/public/assets/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/public/assets/tinymce/themes/advanced/skins/default/ui.css +219 -0
- data/public/assets/tinymce/themes/advanced/skins/highcontrast/content.css +24 -0
- data/public/assets/tinymce/themes/advanced/skins/highcontrast/dialog.css +106 -0
- data/public/assets/tinymce/themes/advanced/skins/highcontrast/ui.css +106 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/content.css +48 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/dialog.css +118 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/ui.css +222 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/ui_black.css +8 -0
- data/public/assets/tinymce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
- data/public/assets/tinymce/themes/advanced/source_editor.htm +25 -0
- data/public/assets/tinymce/themes/simple/editor_template.js +1 -0
- data/public/assets/tinymce/themes/simple/editor_template_src.js +84 -0
- data/public/assets/tinymce/themes/simple/img/icons.gif +0 -0
- data/public/assets/tinymce/themes/simple/langs/en.js +1 -0
- data/public/assets/tinymce/themes/simple/skins/default/content.css +25 -0
- data/public/assets/tinymce/themes/simple/skins/default/ui.css +32 -0
- data/public/assets/tinymce/themes/simple/skins/o2k7/content.css +17 -0
- data/public/assets/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/public/assets/tinymce/themes/simple/skins/o2k7/ui.css +35 -0
- data/public/assets/tinymce/tiny_mce.js +1 -0
- data/public/assets/tinymce/tiny_mce_jquery.js +1 -0
- data/public/assets/tinymce/tiny_mce_jquery_src.js +17913 -0
- data/public/assets/tinymce/tiny_mce_popup.js +5 -0
- data/public/assets/tinymce/tiny_mce_src.js +19127 -0
- data/public/assets/tinymce/utils/editable_selects.js +70 -0
- data/public/assets/tinymce/utils/form_utils.js +210 -0
- data/public/assets/tinymce/utils/mctabs.js +162 -0
- data/public/assets/tinymce/utils/validate.js +252 -0
- data/public/assets2bpacked/jstree/README.txt +10 -0
- data/public/assets2bpacked/jstree/_demo/_dump.sql +20 -0
- data/public/assets2bpacked/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/assets2bpacked/jstree/_demo/_inc/class._database.php +146 -0
- data/public/assets2bpacked/jstree/_demo/_inc/class._database_i.php +152 -0
- data/public/assets2bpacked/jstree/_demo/_inc/class.tree.php +602 -0
- data/public/assets2bpacked/jstree/_demo/_install.txt +6 -0
- data/public/assets2bpacked/jstree/_demo/config.php +14 -0
- data/public/assets2bpacked/jstree/_demo/file.png +0 -0
- data/public/assets2bpacked/jstree/_demo/folder.png +0 -0
- data/public/assets2bpacked/jstree/_demo/index.html +461 -0
- data/public/assets2bpacked/jstree/_demo/root.png +0 -0
- data/public/assets2bpacked/jstree/_demo/server.php +69 -0
- data/public/assets2bpacked/jstree/_docs/!style.css +48 -0
- data/public/assets2bpacked/jstree/_docs/_drive.png +0 -0
- data/public/assets2bpacked/jstree/_docs/_html_data.html +2 -0
- data/public/assets2bpacked/jstree/_docs/_json_data.json +4 -0
- data/public/assets2bpacked/jstree/_docs/_search_data.json +6 -0
- data/public/assets2bpacked/jstree/_docs/_search_result.json +1 -0
- data/public/assets2bpacked/jstree/_docs/_xml_flat.xml +12 -0
- data/public/assets2bpacked/jstree/_docs/_xml_nest.xml +18 -0
- data/public/assets2bpacked/jstree/_docs/checkbox.html +171 -0
- data/public/assets2bpacked/jstree/_docs/contextmenu.html +121 -0
- data/public/assets2bpacked/jstree/_docs/cookies.html +97 -0
- data/public/assets2bpacked/jstree/_docs/core.html +689 -0
- data/public/assets2bpacked/jstree/_docs/crrm.html +316 -0
- data/public/assets2bpacked/jstree/_docs/dnd.html +199 -0
- data/public/assets2bpacked/jstree/_docs/hotkeys.html +82 -0
- data/public/assets2bpacked/jstree/_docs/html_data.html +175 -0
- data/public/assets2bpacked/jstree/_docs/index.html +86 -0
- data/public/assets2bpacked/jstree/_docs/json_data.html +249 -0
- data/public/assets2bpacked/jstree/_docs/languages.html +152 -0
- data/public/assets2bpacked/jstree/_docs/logo.png +0 -0
- data/public/assets2bpacked/jstree/_docs/search.html +153 -0
- data/public/assets2bpacked/jstree/_docs/sort.html +85 -0
- data/public/assets2bpacked/jstree/_docs/syntax/!script.js +2232 -0
- data/public/assets2bpacked/jstree/_docs/syntax/!style.css +511 -0
- data/public/assets2bpacked/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/help.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/printer.png +0 -0
- data/public/assets2bpacked/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/assets2bpacked/jstree/_docs/themeroller.html +107 -0
- data/public/assets2bpacked/jstree/_docs/themes.html +127 -0
- data/public/assets2bpacked/jstree/_docs/types.html +178 -0
- data/public/assets2bpacked/jstree/_docs/ui.html +197 -0
- data/public/assets2bpacked/jstree/_docs/unique.html +85 -0
- data/public/assets2bpacked/jstree/_docs/xml_data.html +218 -0
- data/public/assets2bpacked/jstree/_lib/jquery.cookie.js +96 -0
- data/public/assets2bpacked/jstree/_lib/jquery.hotkeys.js +99 -0
- data/public/assets2bpacked/jstree/_lib/jquery.js +5 -0
- data/public/assets2bpacked/jstree/jquery.jstree.js +4564 -0
- data/public/assets2bpacked/jstree/themes/apple/bg.jpg +0 -0
- data/public/assets2bpacked/jstree/themes/apple/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/assets2bpacked/jstree/themes/apple/style.css +61 -0
- data/public/assets2bpacked/jstree/themes/apple/throbber.gif +0 -0
- data/public/assets2bpacked/jstree/themes/classic/d.gif +0 -0
- data/public/assets2bpacked/jstree/themes/classic/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/assets2bpacked/jstree/themes/classic/style.css +77 -0
- data/public/assets2bpacked/jstree/themes/classic/throbber.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/d.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/style.css +84 -0
- data/public/assets2bpacked/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default/d.gif +0 -0
- data/public/assets2bpacked/jstree/themes/default/d.png +0 -0
- data/public/assets2bpacked/jstree/themes/default/style.css +74 -0
- data/public/assets2bpacked/jstree/themes/default/throbber.gif +0 -0
- data/public/favicon.ico +0 -0
- data/public/jasmine/card_form.html +13 -0
- data/public/robots.txt +12 -0
- data/script/autospec +4 -0
- data/script/rails +6 -0
- data/script/test_filter +25 -0
- data/script/wagn.rb +6 -0
- data/spec/controllers/account_controller_spec.rb +43 -0
- data/spec/controllers/admin_controller_spec.rb +23 -0
- data/spec/controllers/captcha_spec.rb +103 -0
- data/spec/controllers/card_controller_spec.rb +353 -0
- data/spec/controllers/location_spec.rb +49 -0
- data/spec/controllers/sets_spec.rb +97 -0
- data/spec/controllers/wagn_controller_spec.rb +5 -0
- data/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/javascripts/helpers/jasmine-config.js +2 -0
- data/spec/javascripts/helpers/jasmine-jquery-1.3.1.js +295 -0
- data/spec/javascripts/support/jasmine.yml +77 -0
- data/spec/javascripts/support/jasmine_config.rb +24 -0
- data/spec/javascripts/support/jasmine_runner.rb +21 -0
- data/spec/javascripts/wagn_spec.coffee +40 -0
- data/spec/lib/card/chunk_spec.rb +18 -0
- data/spec/lib/card/codename_spec.rb +30 -0
- data/spec/lib/card/content_spec.rb +293 -0
- data/spec/lib/card/diff_spec.rb +111 -0
- data/spec/lib/card/flexmail_spec.rb +209 -0
- data/spec/lib/card/format_spec.rb +173 -0
- data/spec/lib/card/name_spec.rb +275 -0
- data/spec/lib/card/query_spec.rb +456 -0
- data/spec/lib/card/set_pattern_spec.rb +40 -0
- data/spec/lib/card/set_spec.rb +84 -0
- data/spec/lib/wagn/cache_spec.rb +120 -0
- data/spec/lib/wagn/loader_spec.rb +33 -0
- data/spec/mailers/account_spec.rb +66 -0
- data/spec/mailers/mailer_spec.rb +57 -0
- data/spec/models/account_spec.rb +19 -0
- data/spec/models/card/cardtype_spec.rb +218 -0
- data/spec/models/card/comment_spec.rb +38 -0
- data/spec/models/card/create_spec.rb +83 -0
- data/spec/models/card/reference_spec.rb +214 -0
- data/spec/models/card/revision_spec.rb +58 -0
- data/spec/models/card/trash_spec.rb +258 -0
- data/spec/models/card/type_transition_spec.rb +162 -0
- data/spec/models/card/validation_spec.rb +37 -0
- data/spec/models/card_spec.rb +177 -0
- data/spec/models/user_spec.rb +95 -0
- data/spec/mods/core/chunks/literal_spec.rb +15 -0
- data/spec/mods/core/chunks/uri_spec.rb +293 -0
- data/spec/mods/core/formats/data_format_spec.rb +6 -0
- data/spec/mods/core/formats/html_format_spec.rb +165 -0
- data/spec/mods/core/formats/text_format_spec.rb +6 -0
- data/spec/mods/core/sets/all/active_card_spec.rb +6 -0
- data/spec/mods/core/sets/all/attribute_tracking_spec.rb +22 -0
- data/spec/mods/core/sets/all/collection_spec.rb +49 -0
- data/spec/mods/core/sets/all/content_spec.rb +15 -0
- data/spec/mods/core/sets/all/fetch_spec.rb +206 -0
- data/spec/mods/core/sets/all/initialize_spec.rb +59 -0
- data/spec/mods/core/sets/all/name_spec.rb +30 -0
- data/spec/mods/core/sets/all/pattern_spec.rb +93 -0
- data/spec/mods/core/sets/all/permissions_spec.rb +481 -0
- data/spec/mods/core/sets/all/phases_spec.rb +6 -0
- data/spec/mods/core/sets/all/references_spec.rb +9 -0
- data/spec/mods/core/sets/all/rules2_spec.rb +250 -0
- data/spec/mods/core/sets/all/rules_spec.rb +99 -0
- data/spec/mods/core/sets/all/states_spec.rb +6 -0
- data/spec/mods/core/sets/all/templating_spec.rb +105 -0
- data/spec/mods/core/sets/all/tracked_attributes_spec.rb +316 -0
- data/spec/mods/core/sets/all/type_spec.rb +49 -0
- data/spec/mods/core/sets/all/utils_spec.rb +6 -0
- data/spec/mods/standard/chunks/include_spec.rb +182 -0
- data/spec/mods/standard/chunks/link_spec.rb +60 -0
- data/spec/mods/standard/formats/css_format_spec.rb +6 -0
- data/spec/mods/standard/formats/csv_format_spec.rb +6 -0
- data/spec/mods/standard/formats/email_html_format_spec.rb +6 -0
- data/spec/mods/standard/formats/file_format_spec.rb +6 -0
- data/spec/mods/standard/formats/json_format_spec.rb +6 -0
- data/spec/mods/standard/formats/kml_format_spec.rb +6 -0
- data/spec/mods/standard/formats/rss_format_spec.rb +6 -0
- data/spec/mods/standard/formats/xml_format_spec.rb +6 -0
- data/spec/mods/standard/sets/all/account_spec.rb +117 -0
- data/spec/mods/standard/sets/all/admin_spec.rb +6 -0
- data/spec/mods/standard/sets/all/all_css_spec.rb +11 -0
- data/spec/mods/standard/sets/all/all_csv_spec.rb +10 -0
- data/spec/mods/standard/sets/all/attach_spec.rb +10 -0
- data/spec/mods/standard/sets/all/base_spec.rb +52 -0
- data/spec/mods/standard/sets/all/email_html_spec.rb +14 -0
- data/spec/mods/standard/sets/all/file_spec.rb +6 -0
- data/spec/mods/standard/sets/all/flexmail_spec.rb +6 -0
- data/spec/mods/standard/sets/all/follow_spec.rb +96 -0
- data/spec/mods/standard/sets/all/geocode_spec.rb +37 -0
- data/spec/mods/standard/sets/all/json_spec.rb +27 -0
- data/spec/mods/standard/sets/all/kml_spec.rb +6 -0
- data/spec/mods/standard/sets/all/rich_html_spec.rb +10 -0
- data/spec/mods/standard/sets/all/rss_spec.rb +6 -0
- data/spec/mods/standard/sets/all/text_spec.rb +6 -0
- data/spec/mods/standard/sets/right/account_spec.rb +6 -0
- data/spec/mods/standard/sets/right/add_help_spec.rb +6 -0
- data/spec/mods/standard/sets/right/comment_spec.rb +6 -0
- data/spec/mods/standard/sets/right/create_spec.rb +6 -0
- data/spec/mods/standard/sets/right/crypted_password_spec.rb +6 -0
- data/spec/mods/standard/sets/right/default_spec.rb +6 -0
- data/spec/mods/standard/sets/right/delete_spec.rb +6 -0
- data/spec/mods/standard/sets/right/email_spec.rb +27 -0
- data/spec/mods/standard/sets/right/help_spec.rb +6 -0
- data/spec/mods/standard/sets/right/read_spec.rb +6 -0
- data/spec/mods/standard/sets/right/salt_spec.rb +6 -0
- data/spec/mods/standard/sets/right/structure_spec.rb +10 -0
- data/spec/mods/standard/sets/right/style_spec.rb +6 -0
- data/spec/mods/standard/sets/right/update_spec.rb +6 -0
- data/spec/mods/standard/sets/right/when_created_spec.rb +8 -0
- data/spec/mods/standard/sets/right/when_last_edited_spec.rb +8 -0
- data/spec/mods/standard/sets/rstar/rules_spec.rb +26 -0
- data/spec/mods/standard/sets/self/account_links_spec.rb +10 -0
- data/spec/mods/standard/sets/self/alerts_spec.rb +6 -0
- data/spec/mods/standard/sets/self/foot_spec.rb +6 -0
- data/spec/mods/standard/sets/self/head_spec.rb +18 -0
- data/spec/mods/standard/sets/self/navbox_spec.rb +8 -0
- data/spec/mods/standard/sets/self/now_spec.rb +8 -0
- data/spec/mods/standard/sets/self/recent_spec.rb +6 -0
- data/spec/mods/standard/sets/self/search_spec.rb +6 -0
- data/spec/mods/standard/sets/self/style_functional_spec.rb +6 -0
- data/spec/mods/standard/sets/self/style_jquery_ui_smoothness_spec.rb +6 -0
- data/spec/mods/standard/sets/self/style_standard_spec.rb +6 -0
- data/spec/mods/standard/sets/self/version_spec.rb +8 -0
- data/spec/mods/standard/sets/type/account_request_spec.rb +160 -0
- data/spec/mods/standard/sets/type/basic_spec.rb +6 -0
- data/spec/mods/standard/sets/type/cardtype_spec.rb +6 -0
- data/spec/mods/standard/sets/type/css_spec.rb +6 -0
- data/spec/mods/standard/sets/type/date_spec.rb +8 -0
- data/spec/mods/standard/sets/type/file_spec.rb +6 -0
- data/spec/mods/standard/sets/type/html_spec.rb +24 -0
- data/spec/mods/standard/sets/type/image_spec.rb +17 -0
- data/spec/mods/standard/sets/type/layout_type_spec.rb +8 -0
- data/spec/mods/standard/sets/type/number_spec.rb +8 -0
- data/spec/mods/standard/sets/type/phrase_spec.rb +8 -0
- data/spec/mods/standard/sets/type/plain_text_spec.rb +12 -0
- data/spec/mods/standard/sets/type/pointer_spec.rb +74 -0
- data/spec/mods/standard/sets/type/ruby_and_script_spec.rb +6 -0
- data/spec/mods/standard/sets/type/scss_spec.rb +6 -0
- data/spec/mods/standard/sets/type/search_type_spec.rb +16 -0
- data/spec/mods/standard/sets/type/set_spec.rb +27 -0
- data/spec/mods/standard/sets/type/setting_spec.rb +6 -0
- data/spec/mods/standard/sets/type/skin_spec.rb +6 -0
- data/spec/mods/standard/sets/type/toggle_spec.rb +13 -0
- data/spec/mods/standard/sets/type/user_spec.rb +6 -0
- data/spec/spec.opts +6 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/fixtures/card_references.yml +1954 -0
- data/test/fixtures/card_revisions.yml +4499 -0
- data/test/fixtures/cards.yml +9419 -0
- data/test/fixtures/mao2.jpg +0 -0
- data/test/fixtures/rails.gif +0 -0
- data/test/fixtures/users.yml +169 -0
- data/test/performance/card_create_test.rb +22 -0
- data/test/performance/fetch_test.rb +9 -0
- data/test/performance/homepage_test.rb +9 -0
- data/test/performance/render_test.rb +10 -0
- data/test/seed.rb +192 -0
- data/test/test_helper.rb +123 -0
- data/wagn.gemspec +46 -0
- metadata +1307 -0
@@ -0,0 +1 @@
|
|
1
|
+
(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+b.theme.url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})();
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/**
|
2
|
+
* editor_plugin_src.js
|
3
|
+
*
|
4
|
+
* Copyright 2009, Moxiecode Systems AB
|
5
|
+
* Released under LGPL License.
|
6
|
+
*
|
7
|
+
* License: http://tinymce.moxiecode.com/license
|
8
|
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function() {
|
12
|
+
tinymce.create('tinymce.plugins.PageBreakPlugin', {
|
13
|
+
init : function(ed, url) {
|
14
|
+
var pb = '<img src="' + ed.theme.url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
|
15
|
+
|
16
|
+
pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
|
17
|
+
|
18
|
+
// Register commands
|
19
|
+
ed.addCommand('mcePageBreak', function() {
|
20
|
+
ed.execCommand('mceInsertContent', 0, pb);
|
21
|
+
});
|
22
|
+
|
23
|
+
// Register buttons
|
24
|
+
ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
|
25
|
+
|
26
|
+
ed.onInit.add(function() {
|
27
|
+
if (ed.theme.onResolveName) {
|
28
|
+
ed.theme.onResolveName.add(function(th, o) {
|
29
|
+
if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
|
30
|
+
o.name = 'pagebreak';
|
31
|
+
});
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
ed.onClick.add(function(ed, e) {
|
36
|
+
e = e.target;
|
37
|
+
|
38
|
+
if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
|
39
|
+
ed.selection.select(e);
|
40
|
+
});
|
41
|
+
|
42
|
+
ed.onNodeChange.add(function(ed, cm, n) {
|
43
|
+
cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
|
44
|
+
});
|
45
|
+
|
46
|
+
ed.onBeforeSetContent.add(function(ed, o) {
|
47
|
+
o.content = o.content.replace(pbRE, pb);
|
48
|
+
});
|
49
|
+
|
50
|
+
ed.onPostProcess.add(function(ed, o) {
|
51
|
+
if (o.get)
|
52
|
+
o.content = o.content.replace(/<img[^>]+>/g, function(im) {
|
53
|
+
if (im.indexOf('class="mcePageBreak') !== -1)
|
54
|
+
im = sep;
|
55
|
+
|
56
|
+
return im;
|
57
|
+
});
|
58
|
+
});
|
59
|
+
},
|
60
|
+
|
61
|
+
getInfo : function() {
|
62
|
+
return {
|
63
|
+
longname : 'PageBreak',
|
64
|
+
author : 'Moxiecode Systems AB',
|
65
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
66
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',
|
67
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
68
|
+
};
|
69
|
+
}
|
70
|
+
});
|
71
|
+
|
72
|
+
// Register plugin
|
73
|
+
tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);
|
74
|
+
})();
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_max_consecutive_linebreaks:2,paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j){var h=this.editor,f=b(h,"paste_text_linebreaktype"),k=b(h,"paste_text_replacements"),g=tinymce.is;function e(m){c(m,function(n){if(n.constructor==RegExp){j=j.replace(n,"")}else{j=j.replace(n[0],n[1])}})}if((typeof(j)==="string")&&(j.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(j)){e([/[\n\r]+/g])}else{e([/\r+/g])}e([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"]]);var d=Number(b(h,"paste_max_consecutive_linebreaks"));if(d>-1){var l=new RegExp("\n{"+(d+1)+",}","g");var i="";while(i.length<d){i+="\n"}e([[l,i]])}j=h.dom.decode(tinymce.html.Entities.encodeRaw(j));if(g(k,"array")){e(k)}else{if(g(k,"string")){e(new RegExp(k,"gi"))}}if(f=="none"){e([[/\n+/g," "]])}else{if(f=="br"){e([[/\n/g,"<br />"]])}else{if(f=="p"){e([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{e([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}h.execCommand("mceInsertContent",false,j)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
|
@@ -0,0 +1,885 @@
|
|
1
|
+
/**
|
2
|
+
* editor_plugin_src.js
|
3
|
+
*
|
4
|
+
* Copyright 2009, Moxiecode Systems AB
|
5
|
+
* Released under LGPL License.
|
6
|
+
*
|
7
|
+
* License: http://tinymce.moxiecode.com/license
|
8
|
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function() {
|
12
|
+
var each = tinymce.each,
|
13
|
+
defs = {
|
14
|
+
paste_auto_cleanup_on_paste : true,
|
15
|
+
paste_enable_default_filters : true,
|
16
|
+
paste_block_drop : false,
|
17
|
+
paste_retain_style_properties : "none",
|
18
|
+
paste_strip_class_attributes : "mso",
|
19
|
+
paste_remove_spans : false,
|
20
|
+
paste_remove_styles : false,
|
21
|
+
paste_remove_styles_if_webkit : true,
|
22
|
+
paste_convert_middot_lists : true,
|
23
|
+
paste_convert_headers_to_strong : false,
|
24
|
+
paste_dialog_width : "450",
|
25
|
+
paste_dialog_height : "400",
|
26
|
+
paste_max_consecutive_linebreaks: 2,
|
27
|
+
paste_text_use_dialog : false,
|
28
|
+
paste_text_sticky : false,
|
29
|
+
paste_text_sticky_default : false,
|
30
|
+
paste_text_notifyalways : false,
|
31
|
+
paste_text_linebreaktype : "combined",
|
32
|
+
paste_text_replacements : [
|
33
|
+
[/\u2026/g, "..."],
|
34
|
+
[/[\x93\x94\u201c\u201d]/g, '"'],
|
35
|
+
[/[\x60\x91\x92\u2018\u2019]/g, "'"]
|
36
|
+
]
|
37
|
+
};
|
38
|
+
|
39
|
+
function getParam(ed, name) {
|
40
|
+
return ed.getParam(name, defs[name]);
|
41
|
+
}
|
42
|
+
|
43
|
+
tinymce.create('tinymce.plugins.PastePlugin', {
|
44
|
+
init : function(ed, url) {
|
45
|
+
var t = this;
|
46
|
+
|
47
|
+
t.editor = ed;
|
48
|
+
t.url = url;
|
49
|
+
|
50
|
+
// Setup plugin events
|
51
|
+
t.onPreProcess = new tinymce.util.Dispatcher(t);
|
52
|
+
t.onPostProcess = new tinymce.util.Dispatcher(t);
|
53
|
+
|
54
|
+
// Register default handlers
|
55
|
+
t.onPreProcess.add(t._preProcess);
|
56
|
+
t.onPostProcess.add(t._postProcess);
|
57
|
+
|
58
|
+
// Register optional preprocess handler
|
59
|
+
t.onPreProcess.add(function(pl, o) {
|
60
|
+
ed.execCallback('paste_preprocess', pl, o);
|
61
|
+
});
|
62
|
+
|
63
|
+
// Register optional postprocess
|
64
|
+
t.onPostProcess.add(function(pl, o) {
|
65
|
+
ed.execCallback('paste_postprocess', pl, o);
|
66
|
+
});
|
67
|
+
|
68
|
+
ed.onKeyDown.addToTop(function(ed, e) {
|
69
|
+
// Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that
|
70
|
+
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
|
71
|
+
return false; // Stop other listeners
|
72
|
+
});
|
73
|
+
|
74
|
+
// Initialize plain text flag
|
75
|
+
ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');
|
76
|
+
|
77
|
+
// This function executes the process handlers and inserts the contents
|
78
|
+
// force_rich overrides plain text mode set by user, important for pasting with execCommand
|
79
|
+
function process(o, force_rich) {
|
80
|
+
var dom = ed.dom, rng;
|
81
|
+
|
82
|
+
// Execute pre process handlers
|
83
|
+
t.onPreProcess.dispatch(t, o);
|
84
|
+
|
85
|
+
// Create DOM structure
|
86
|
+
o.node = dom.create('div', 0, o.content);
|
87
|
+
|
88
|
+
// If pasting inside the same element and the contents is only one block
|
89
|
+
// remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
|
90
|
+
if (tinymce.isGecko) {
|
91
|
+
rng = ed.selection.getRng(true);
|
92
|
+
if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
|
93
|
+
// Is only one block node and it doesn't contain word stuff
|
94
|
+
if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)
|
95
|
+
dom.remove(o.node.firstChild, true);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
// Execute post process handlers
|
100
|
+
t.onPostProcess.dispatch(t, o);
|
101
|
+
|
102
|
+
// Serialize content
|
103
|
+
o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});
|
104
|
+
|
105
|
+
// Plain text option active?
|
106
|
+
if ((!force_rich) && (ed.pasteAsPlainText)) {
|
107
|
+
t._insertPlainText(o.content);
|
108
|
+
|
109
|
+
if (!getParam(ed, "paste_text_sticky")) {
|
110
|
+
ed.pasteAsPlainText = false;
|
111
|
+
ed.controlManager.setActive("pastetext", false);
|
112
|
+
}
|
113
|
+
} else {
|
114
|
+
t._insert(o.content);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
// Add command for external usage
|
119
|
+
ed.addCommand('mceInsertClipboardContent', function(u, o) {
|
120
|
+
process(o, true);
|
121
|
+
});
|
122
|
+
|
123
|
+
if (!getParam(ed, "paste_text_use_dialog")) {
|
124
|
+
ed.addCommand('mcePasteText', function(u, v) {
|
125
|
+
var cookie = tinymce.util.Cookie;
|
126
|
+
|
127
|
+
ed.pasteAsPlainText = !ed.pasteAsPlainText;
|
128
|
+
ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
|
129
|
+
|
130
|
+
if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
|
131
|
+
if (getParam(ed, "paste_text_sticky")) {
|
132
|
+
ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
|
133
|
+
} else {
|
134
|
+
ed.windowManager.alert(ed.translate('paste.plaintext_mode'));
|
135
|
+
}
|
136
|
+
|
137
|
+
if (!getParam(ed, "paste_text_notifyalways")) {
|
138
|
+
cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
|
139
|
+
}
|
140
|
+
}
|
141
|
+
});
|
142
|
+
}
|
143
|
+
|
144
|
+
ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
|
145
|
+
ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
|
146
|
+
|
147
|
+
// This function grabs the contents from the clipboard by adding a
|
148
|
+
// hidden div and placing the caret inside it and after the browser paste
|
149
|
+
// is done it grabs that contents and processes that
|
150
|
+
function grabContent(e) {
|
151
|
+
var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
|
152
|
+
|
153
|
+
// Check if browser supports direct plaintext access
|
154
|
+
if (e.clipboardData || dom.doc.dataTransfer) {
|
155
|
+
textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
|
156
|
+
|
157
|
+
if (ed.pasteAsPlainText) {
|
158
|
+
e.preventDefault();
|
159
|
+
process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
if (dom.get('_mcePaste'))
|
165
|
+
return;
|
166
|
+
|
167
|
+
// Create container to paste into
|
168
|
+
n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');
|
169
|
+
|
170
|
+
// If contentEditable mode we need to find out the position of the closest element
|
171
|
+
if (body != ed.getDoc().body)
|
172
|
+
posY = dom.getPos(ed.selection.getStart(), body).y;
|
173
|
+
else
|
174
|
+
posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;
|
175
|
+
|
176
|
+
// Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
|
177
|
+
// If also needs to be in view on IE or the paste would fail
|
178
|
+
dom.setStyles(n, {
|
179
|
+
position : 'absolute',
|
180
|
+
left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div
|
181
|
+
top : posY - 25,
|
182
|
+
width : 1,
|
183
|
+
height : 1,
|
184
|
+
overflow : 'hidden'
|
185
|
+
});
|
186
|
+
|
187
|
+
if (tinymce.isIE) {
|
188
|
+
// Store away the old range
|
189
|
+
oldRng = sel.getRng();
|
190
|
+
|
191
|
+
// Select the container
|
192
|
+
rng = dom.doc.body.createTextRange();
|
193
|
+
rng.moveToElementText(n);
|
194
|
+
rng.execCommand('Paste');
|
195
|
+
|
196
|
+
// Remove container
|
197
|
+
dom.remove(n);
|
198
|
+
|
199
|
+
// Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
|
200
|
+
// to IE security settings so we pass the junk though better than nothing right
|
201
|
+
if (n.innerHTML === '\uFEFF\uFEFF') {
|
202
|
+
ed.execCommand('mcePasteWord');
|
203
|
+
e.preventDefault();
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
|
207
|
+
// Restore the old range and clear the contents before pasting
|
208
|
+
sel.setRng(oldRng);
|
209
|
+
sel.setContent('');
|
210
|
+
|
211
|
+
// For some odd reason we need to detach the the mceInsertContent call from the paste event
|
212
|
+
// It's like IE has a reference to the parent element that you paste in and the selection gets messed up
|
213
|
+
// when it tries to restore the selection
|
214
|
+
setTimeout(function() {
|
215
|
+
// Process contents
|
216
|
+
process({content : n.innerHTML});
|
217
|
+
}, 0);
|
218
|
+
|
219
|
+
// Block the real paste event
|
220
|
+
return tinymce.dom.Event.cancel(e);
|
221
|
+
} else {
|
222
|
+
function block(e) {
|
223
|
+
e.preventDefault();
|
224
|
+
};
|
225
|
+
|
226
|
+
// Block mousedown and click to prevent selection change
|
227
|
+
dom.bind(ed.getDoc(), 'mousedown', block);
|
228
|
+
dom.bind(ed.getDoc(), 'keydown', block);
|
229
|
+
|
230
|
+
or = ed.selection.getRng();
|
231
|
+
|
232
|
+
// Move select contents inside DIV
|
233
|
+
n = n.firstChild;
|
234
|
+
rng = ed.getDoc().createRange();
|
235
|
+
rng.setStart(n, 0);
|
236
|
+
rng.setEnd(n, 2);
|
237
|
+
sel.setRng(rng);
|
238
|
+
|
239
|
+
// Wait a while and grab the pasted contents
|
240
|
+
window.setTimeout(function() {
|
241
|
+
var h = '', nl;
|
242
|
+
|
243
|
+
// Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
|
244
|
+
if (!dom.select('div.mcePaste > div.mcePaste').length) {
|
245
|
+
nl = dom.select('div.mcePaste');
|
246
|
+
|
247
|
+
// WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
|
248
|
+
each(nl, function(n) {
|
249
|
+
var child = n.firstChild;
|
250
|
+
|
251
|
+
// WebKit inserts a DIV container with lots of odd styles
|
252
|
+
if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
|
253
|
+
dom.remove(child, 1);
|
254
|
+
}
|
255
|
+
|
256
|
+
// Remove apply style spans
|
257
|
+
each(dom.select('span.Apple-style-span', n), function(n) {
|
258
|
+
dom.remove(n, 1);
|
259
|
+
});
|
260
|
+
|
261
|
+
// Remove bogus br elements
|
262
|
+
each(dom.select('br[data-mce-bogus]', n), function(n) {
|
263
|
+
dom.remove(n);
|
264
|
+
});
|
265
|
+
|
266
|
+
// WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
|
267
|
+
if (n.parentNode.className != 'mcePaste')
|
268
|
+
h += n.innerHTML;
|
269
|
+
});
|
270
|
+
} else {
|
271
|
+
// Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc
|
272
|
+
// So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same
|
273
|
+
h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';
|
274
|
+
}
|
275
|
+
|
276
|
+
// Remove the nodes
|
277
|
+
each(dom.select('div.mcePaste'), function(n) {
|
278
|
+
dom.remove(n);
|
279
|
+
});
|
280
|
+
|
281
|
+
// Restore the old selection
|
282
|
+
if (or)
|
283
|
+
sel.setRng(or);
|
284
|
+
|
285
|
+
process({content : h});
|
286
|
+
|
287
|
+
// Unblock events ones we got the contents
|
288
|
+
dom.unbind(ed.getDoc(), 'mousedown', block);
|
289
|
+
dom.unbind(ed.getDoc(), 'keydown', block);
|
290
|
+
}, 0);
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
// Check if we should use the new auto process method
|
295
|
+
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
|
296
|
+
// Is it's Opera or older FF use key handler
|
297
|
+
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
298
|
+
ed.onKeyDown.addToTop(function(ed, e) {
|
299
|
+
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
|
300
|
+
grabContent(e);
|
301
|
+
});
|
302
|
+
} else {
|
303
|
+
// Grab contents on paste event on Gecko and WebKit
|
304
|
+
ed.onPaste.addToTop(function(ed, e) {
|
305
|
+
return grabContent(e);
|
306
|
+
});
|
307
|
+
}
|
308
|
+
}
|
309
|
+
|
310
|
+
ed.onInit.add(function() {
|
311
|
+
ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);
|
312
|
+
|
313
|
+
// Block all drag/drop events
|
314
|
+
if (getParam(ed, "paste_block_drop")) {
|
315
|
+
ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
|
316
|
+
e.preventDefault();
|
317
|
+
e.stopPropagation();
|
318
|
+
|
319
|
+
return false;
|
320
|
+
});
|
321
|
+
}
|
322
|
+
});
|
323
|
+
|
324
|
+
// Add legacy support
|
325
|
+
t._legacySupport();
|
326
|
+
},
|
327
|
+
|
328
|
+
getInfo : function() {
|
329
|
+
return {
|
330
|
+
longname : 'Paste text/word',
|
331
|
+
author : 'Moxiecode Systems AB',
|
332
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
333
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
|
334
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
335
|
+
};
|
336
|
+
},
|
337
|
+
|
338
|
+
_preProcess : function(pl, o) {
|
339
|
+
var ed = this.editor,
|
340
|
+
h = o.content,
|
341
|
+
grep = tinymce.grep,
|
342
|
+
explode = tinymce.explode,
|
343
|
+
trim = tinymce.trim,
|
344
|
+
len, stripClass;
|
345
|
+
|
346
|
+
//console.log('Before preprocess:' + o.content);
|
347
|
+
|
348
|
+
function process(items) {
|
349
|
+
each(items, function(v) {
|
350
|
+
// Remove or replace
|
351
|
+
if (v.constructor == RegExp)
|
352
|
+
h = h.replace(v, '');
|
353
|
+
else
|
354
|
+
h = h.replace(v[0], v[1]);
|
355
|
+
});
|
356
|
+
}
|
357
|
+
|
358
|
+
if (ed.settings.paste_enable_default_filters == false) {
|
359
|
+
return;
|
360
|
+
}
|
361
|
+
|
362
|
+
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
|
363
|
+
if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) {
|
364
|
+
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
|
365
|
+
process([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g, '$1']]);
|
366
|
+
|
367
|
+
// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
|
368
|
+
process([
|
369
|
+
[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
|
370
|
+
[/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
|
371
|
+
[/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
|
372
|
+
]);
|
373
|
+
}
|
374
|
+
|
375
|
+
// Detect Word content and process it more aggressive
|
376
|
+
if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
|
377
|
+
o.wordContent = true; // Mark the pasted contents as word specific content
|
378
|
+
//console.log('Word contents detected.');
|
379
|
+
|
380
|
+
// Process away some basic content
|
381
|
+
process([
|
382
|
+
/^\s*( )+/gi, // entities at the start of contents
|
383
|
+
/( |<br[^>]*>)+\s*$/gi // entities at the end of contents
|
384
|
+
]);
|
385
|
+
|
386
|
+
if (getParam(ed, "paste_convert_headers_to_strong")) {
|
387
|
+
h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
|
388
|
+
}
|
389
|
+
|
390
|
+
if (getParam(ed, "paste_convert_middot_lists")) {
|
391
|
+
process([
|
392
|
+
[/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
|
393
|
+
[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers
|
394
|
+
[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)
|
395
|
+
]);
|
396
|
+
}
|
397
|
+
|
398
|
+
process([
|
399
|
+
// Word comments like conditional comments etc
|
400
|
+
/<!--[\s\S]+?-->/gi,
|
401
|
+
|
402
|
+
// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
|
403
|
+
/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
|
404
|
+
|
405
|
+
// Convert <s> into <strike> for line-though
|
406
|
+
[/<(\/?)s>/gi, "<$1strike>"],
|
407
|
+
|
408
|
+
// Replace nsbp entites to char since it's easier to handle
|
409
|
+
[/ /gi, "\u00a0"]
|
410
|
+
]);
|
411
|
+
|
412
|
+
// Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
|
413
|
+
// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
|
414
|
+
do {
|
415
|
+
len = h.length;
|
416
|
+
h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
417
|
+
} while (len != h.length);
|
418
|
+
|
419
|
+
// Remove all spans if no styles is to be retained
|
420
|
+
if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
|
421
|
+
h = h.replace(/<\/?span[^>]*>/gi, "");
|
422
|
+
} else {
|
423
|
+
// We're keeping styles, so at least clean them up.
|
424
|
+
// CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
|
425
|
+
|
426
|
+
process([
|
427
|
+
// Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
|
428
|
+
[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
|
429
|
+
function(str, spaces) {
|
430
|
+
return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
|
431
|
+
}
|
432
|
+
],
|
433
|
+
|
434
|
+
// Examine all styles: delete junk, transform some, and keep the rest
|
435
|
+
[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
|
436
|
+
function(str, tag, style) {
|
437
|
+
var n = [],
|
438
|
+
i = 0,
|
439
|
+
s = explode(trim(style).replace(/"/gi, "'"), ";");
|
440
|
+
|
441
|
+
// Examine each style definition within the tag's style attribute
|
442
|
+
each(s, function(v) {
|
443
|
+
var name, value,
|
444
|
+
parts = explode(v, ":");
|
445
|
+
|
446
|
+
function ensureUnits(v) {
|
447
|
+
return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
|
448
|
+
}
|
449
|
+
|
450
|
+
if (parts.length == 2) {
|
451
|
+
name = parts[0].toLowerCase();
|
452
|
+
value = parts[1].toLowerCase();
|
453
|
+
|
454
|
+
// Translate certain MS Office styles into their CSS equivalents
|
455
|
+
switch (name) {
|
456
|
+
case "mso-padding-alt":
|
457
|
+
case "mso-padding-top-alt":
|
458
|
+
case "mso-padding-right-alt":
|
459
|
+
case "mso-padding-bottom-alt":
|
460
|
+
case "mso-padding-left-alt":
|
461
|
+
case "mso-margin-alt":
|
462
|
+
case "mso-margin-top-alt":
|
463
|
+
case "mso-margin-right-alt":
|
464
|
+
case "mso-margin-bottom-alt":
|
465
|
+
case "mso-margin-left-alt":
|
466
|
+
case "mso-table-layout-alt":
|
467
|
+
case "mso-height":
|
468
|
+
case "mso-width":
|
469
|
+
case "mso-vertical-align-alt":
|
470
|
+
n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
|
471
|
+
return;
|
472
|
+
|
473
|
+
case "horiz-align":
|
474
|
+
n[i++] = "text-align:" + value;
|
475
|
+
return;
|
476
|
+
|
477
|
+
case "vert-align":
|
478
|
+
n[i++] = "vertical-align:" + value;
|
479
|
+
return;
|
480
|
+
|
481
|
+
case "font-color":
|
482
|
+
case "mso-foreground":
|
483
|
+
n[i++] = "color:" + value;
|
484
|
+
return;
|
485
|
+
|
486
|
+
case "mso-background":
|
487
|
+
case "mso-highlight":
|
488
|
+
n[i++] = "background:" + value;
|
489
|
+
return;
|
490
|
+
|
491
|
+
case "mso-default-height":
|
492
|
+
n[i++] = "min-height:" + ensureUnits(value);
|
493
|
+
return;
|
494
|
+
|
495
|
+
case "mso-default-width":
|
496
|
+
n[i++] = "min-width:" + ensureUnits(value);
|
497
|
+
return;
|
498
|
+
|
499
|
+
case "mso-padding-between-alt":
|
500
|
+
n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
|
501
|
+
return;
|
502
|
+
|
503
|
+
case "text-line-through":
|
504
|
+
if ((value == "single") || (value == "double")) {
|
505
|
+
n[i++] = "text-decoration:line-through";
|
506
|
+
}
|
507
|
+
return;
|
508
|
+
|
509
|
+
case "mso-zero-height":
|
510
|
+
if (value == "yes") {
|
511
|
+
n[i++] = "display:none";
|
512
|
+
}
|
513
|
+
return;
|
514
|
+
}
|
515
|
+
|
516
|
+
// Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name
|
517
|
+
if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {
|
518
|
+
return;
|
519
|
+
}
|
520
|
+
|
521
|
+
// If it reached this point, it must be a valid CSS style
|
522
|
+
n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case
|
523
|
+
}
|
524
|
+
});
|
525
|
+
|
526
|
+
// If style attribute contained any valid styles the re-write it; otherwise delete style attribute.
|
527
|
+
if (i > 0) {
|
528
|
+
return tag + ' style="' + n.join(';') + '"';
|
529
|
+
} else {
|
530
|
+
return tag;
|
531
|
+
}
|
532
|
+
}
|
533
|
+
]
|
534
|
+
]);
|
535
|
+
}
|
536
|
+
}
|
537
|
+
|
538
|
+
// Replace headers with <strong>
|
539
|
+
if (getParam(ed, "paste_convert_headers_to_strong")) {
|
540
|
+
process([
|
541
|
+
[/<h[1-6][^>]*>/gi, "<p><strong>"],
|
542
|
+
[/<\/h[1-6][^>]*>/gi, "</strong></p>"]
|
543
|
+
]);
|
544
|
+
}
|
545
|
+
|
546
|
+
process([
|
547
|
+
// Copy paste from Java like Open Office will produce this junk on FF
|
548
|
+
[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']
|
549
|
+
]);
|
550
|
+
|
551
|
+
// Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
|
552
|
+
// Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
|
553
|
+
stripClass = getParam(ed, "paste_strip_class_attributes");
|
554
|
+
|
555
|
+
if (stripClass !== "none") {
|
556
|
+
function removeClasses(match, g1) {
|
557
|
+
if (stripClass === "all")
|
558
|
+
return '';
|
559
|
+
|
560
|
+
var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
|
561
|
+
function(v) {
|
562
|
+
return (/^(?!mso)/i.test(v));
|
563
|
+
}
|
564
|
+
);
|
565
|
+
|
566
|
+
return cls.length ? ' class="' + cls.join(" ") + '"' : '';
|
567
|
+
};
|
568
|
+
|
569
|
+
h = h.replace(/ class="([^"]+)"/gi, removeClasses);
|
570
|
+
h = h.replace(/ class=([\-\w]+)/gi, removeClasses);
|
571
|
+
}
|
572
|
+
|
573
|
+
// Remove spans option
|
574
|
+
if (getParam(ed, "paste_remove_spans")) {
|
575
|
+
h = h.replace(/<\/?span[^>]*>/gi, "");
|
576
|
+
}
|
577
|
+
|
578
|
+
//console.log('After preprocess:' + h);
|
579
|
+
|
580
|
+
o.content = h;
|
581
|
+
},
|
582
|
+
|
583
|
+
/**
|
584
|
+
* Various post process items.
|
585
|
+
*/
|
586
|
+
_postProcess : function(pl, o) {
|
587
|
+
var t = this, ed = t.editor, dom = ed.dom, styleProps;
|
588
|
+
|
589
|
+
if (ed.settings.paste_enable_default_filters == false) {
|
590
|
+
return;
|
591
|
+
}
|
592
|
+
|
593
|
+
if (o.wordContent) {
|
594
|
+
// Remove named anchors or TOC links
|
595
|
+
each(dom.select('a', o.node), function(a) {
|
596
|
+
if (!a.href || a.href.indexOf('#_Toc') != -1)
|
597
|
+
dom.remove(a, 1);
|
598
|
+
});
|
599
|
+
|
600
|
+
if (getParam(ed, "paste_convert_middot_lists")) {
|
601
|
+
t._convertLists(pl, o);
|
602
|
+
}
|
603
|
+
|
604
|
+
// Process styles
|
605
|
+
styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties
|
606
|
+
|
607
|
+
// Process only if a string was specified and not equal to "all" or "*"
|
608
|
+
if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {
|
609
|
+
styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));
|
610
|
+
|
611
|
+
// Retains some style properties
|
612
|
+
each(dom.select('*', o.node), function(el) {
|
613
|
+
var newStyle = {}, npc = 0, i, sp, sv;
|
614
|
+
|
615
|
+
// Store a subset of the existing styles
|
616
|
+
if (styleProps) {
|
617
|
+
for (i = 0; i < styleProps.length; i++) {
|
618
|
+
sp = styleProps[i];
|
619
|
+
sv = dom.getStyle(el, sp);
|
620
|
+
|
621
|
+
if (sv) {
|
622
|
+
newStyle[sp] = sv;
|
623
|
+
npc++;
|
624
|
+
}
|
625
|
+
}
|
626
|
+
}
|
627
|
+
|
628
|
+
// Remove all of the existing styles
|
629
|
+
dom.setAttrib(el, 'style', '');
|
630
|
+
|
631
|
+
if (styleProps && npc > 0)
|
632
|
+
dom.setStyles(el, newStyle); // Add back the stored subset of styles
|
633
|
+
else // Remove empty span tags that do not have class attributes
|
634
|
+
if (el.nodeName == 'SPAN' && !el.className)
|
635
|
+
dom.remove(el, true);
|
636
|
+
});
|
637
|
+
}
|
638
|
+
}
|
639
|
+
|
640
|
+
// Remove all style information or only specifically on WebKit to avoid the style bug on that browser
|
641
|
+
if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
|
642
|
+
each(dom.select('*[style]', o.node), function(el) {
|
643
|
+
el.removeAttribute('style');
|
644
|
+
el.removeAttribute('data-mce-style');
|
645
|
+
});
|
646
|
+
} else {
|
647
|
+
if (tinymce.isWebKit) {
|
648
|
+
// We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />
|
649
|
+
// Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
|
650
|
+
each(dom.select('*', o.node), function(el) {
|
651
|
+
el.removeAttribute('data-mce-style');
|
652
|
+
});
|
653
|
+
}
|
654
|
+
}
|
655
|
+
},
|
656
|
+
|
657
|
+
/**
|
658
|
+
* Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
|
659
|
+
*/
|
660
|
+
_convertLists : function(pl, o) {
|
661
|
+
var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
|
662
|
+
|
663
|
+
// Convert middot lists into real semantic lists
|
664
|
+
each(dom.select('p', o.node), function(p) {
|
665
|
+
var sib, val = '', type, html, idx, parents;
|
666
|
+
|
667
|
+
// Get text node value at beginning of paragraph
|
668
|
+
for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
|
669
|
+
val += sib.nodeValue;
|
670
|
+
|
671
|
+
val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0');
|
672
|
+
|
673
|
+
// Detect unordered lists look for bullets
|
674
|
+
if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val))
|
675
|
+
type = 'ul';
|
676
|
+
|
677
|
+
// Detect ordered lists 1., a. or ixv.
|
678
|
+
if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))
|
679
|
+
type = 'ol';
|
680
|
+
|
681
|
+
// Check if node value matches the list pattern: o
|
682
|
+
if (type) {
|
683
|
+
margin = parseFloat(p.style.marginLeft || 0);
|
684
|
+
|
685
|
+
if (margin > lastMargin)
|
686
|
+
levels.push(margin);
|
687
|
+
|
688
|
+
if (!listElm || type != lastType) {
|
689
|
+
listElm = dom.create(type);
|
690
|
+
dom.insertAfter(listElm, p);
|
691
|
+
} else {
|
692
|
+
// Nested list element
|
693
|
+
if (margin > lastMargin) {
|
694
|
+
listElm = li.appendChild(dom.create(type));
|
695
|
+
} else if (margin < lastMargin) {
|
696
|
+
// Find parent level based on margin value
|
697
|
+
idx = tinymce.inArray(levels, margin);
|
698
|
+
parents = dom.getParents(listElm.parentNode, type);
|
699
|
+
listElm = parents[parents.length - 1 - idx] || listElm;
|
700
|
+
}
|
701
|
+
}
|
702
|
+
|
703
|
+
// Remove middot or number spans if they exists
|
704
|
+
each(dom.select('span', p), function(span) {
|
705
|
+
var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
|
706
|
+
|
707
|
+
// Remove span with the middot or the number
|
708
|
+
if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html))
|
709
|
+
dom.remove(span);
|
710
|
+
else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html))
|
711
|
+
dom.remove(span);
|
712
|
+
});
|
713
|
+
|
714
|
+
html = p.innerHTML;
|
715
|
+
|
716
|
+
// Remove middot/list items
|
717
|
+
if (type == 'ul')
|
718
|
+
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
|
719
|
+
else
|
720
|
+
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');
|
721
|
+
|
722
|
+
// Create li and add paragraph data into the new li
|
723
|
+
li = listElm.appendChild(dom.create('li', 0, html));
|
724
|
+
dom.remove(p);
|
725
|
+
|
726
|
+
lastMargin = margin;
|
727
|
+
lastType = type;
|
728
|
+
} else
|
729
|
+
listElm = lastMargin = 0; // End list element
|
730
|
+
});
|
731
|
+
|
732
|
+
// Remove any left over makers
|
733
|
+
html = o.node.innerHTML;
|
734
|
+
if (html.indexOf('__MCE_ITEM__') != -1)
|
735
|
+
o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
|
736
|
+
},
|
737
|
+
|
738
|
+
/**
|
739
|
+
* Inserts the specified contents at the caret position.
|
740
|
+
*/
|
741
|
+
_insert : function(h, skip_undo) {
|
742
|
+
var ed = this.editor, r = ed.selection.getRng();
|
743
|
+
|
744
|
+
// First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.
|
745
|
+
if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)
|
746
|
+
ed.getDoc().execCommand('Delete', false, null);
|
747
|
+
|
748
|
+
ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});
|
749
|
+
},
|
750
|
+
|
751
|
+
/**
|
752
|
+
* Instead of the old plain text method which tried to re-create a paste operation, the
|
753
|
+
* new approach adds a plain text mode toggle switch that changes the behavior of paste.
|
754
|
+
* This function is passed the same input that the regular paste plugin produces.
|
755
|
+
* It performs additional scrubbing and produces (and inserts) the plain text.
|
756
|
+
* This approach leverages all of the great existing functionality in the paste
|
757
|
+
* plugin, and requires minimal changes to add the new functionality.
|
758
|
+
* Speednet - June 2009
|
759
|
+
*/
|
760
|
+
_insertPlainText : function(content) {
|
761
|
+
var ed = this.editor,
|
762
|
+
linebr = getParam(ed, "paste_text_linebreaktype"),
|
763
|
+
rl = getParam(ed, "paste_text_replacements"),
|
764
|
+
is = tinymce.is;
|
765
|
+
|
766
|
+
function process(items) {
|
767
|
+
each(items, function(v) {
|
768
|
+
if (v.constructor == RegExp)
|
769
|
+
content = content.replace(v, "");
|
770
|
+
else
|
771
|
+
content = content.replace(v[0], v[1]);
|
772
|
+
});
|
773
|
+
};
|
774
|
+
|
775
|
+
if ((typeof(content) === "string") && (content.length > 0)) {
|
776
|
+
// If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
|
777
|
+
if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) {
|
778
|
+
process([
|
779
|
+
/[\n\r]+/g
|
780
|
+
]);
|
781
|
+
} else {
|
782
|
+
// Otherwise just get rid of carriage returns (only need linefeeds)
|
783
|
+
process([
|
784
|
+
/\r+/g
|
785
|
+
]);
|
786
|
+
}
|
787
|
+
|
788
|
+
process([
|
789
|
+
[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them
|
790
|
+
[/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows
|
791
|
+
[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
|
792
|
+
/<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
|
793
|
+
[/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
|
794
|
+
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars.
|
795
|
+
]);
|
796
|
+
|
797
|
+
var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks"));
|
798
|
+
if (maxLinebreaks > -1) {
|
799
|
+
var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g");
|
800
|
+
var linebreakReplacement = "";
|
801
|
+
|
802
|
+
while (linebreakReplacement.length < maxLinebreaks) {
|
803
|
+
linebreakReplacement += "\n";
|
804
|
+
}
|
805
|
+
|
806
|
+
process([
|
807
|
+
[maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks
|
808
|
+
]);
|
809
|
+
}
|
810
|
+
|
811
|
+
content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
|
812
|
+
|
813
|
+
// Perform default or custom replacements
|
814
|
+
if (is(rl, "array")) {
|
815
|
+
process(rl);
|
816
|
+
} else if (is(rl, "string")) {
|
817
|
+
process(new RegExp(rl, "gi"));
|
818
|
+
}
|
819
|
+
|
820
|
+
// Treat paragraphs as specified in the config
|
821
|
+
if (linebr == "none") {
|
822
|
+
// Convert all line breaks to space
|
823
|
+
process([
|
824
|
+
[/\n+/g, " "]
|
825
|
+
]);
|
826
|
+
} else if (linebr == "br") {
|
827
|
+
// Convert all line breaks to <br />
|
828
|
+
process([
|
829
|
+
[/\n/g, "<br />"]
|
830
|
+
]);
|
831
|
+
} else if (linebr == "p") {
|
832
|
+
// Convert all line breaks to <p>...</p>
|
833
|
+
process([
|
834
|
+
[/\n+/g, "</p><p>"],
|
835
|
+
[/^(.*<\/p>)(<p>)$/, '<p>$1']
|
836
|
+
]);
|
837
|
+
} else {
|
838
|
+
// defaults to "combined"
|
839
|
+
// Convert single line breaks to <br /> and double line breaks to <p>...</p>
|
840
|
+
process([
|
841
|
+
[/\n\n/g, "</p><p>"],
|
842
|
+
[/^(.*<\/p>)(<p>)$/, '<p>$1'],
|
843
|
+
[/\n/g, "<br />"]
|
844
|
+
]);
|
845
|
+
}
|
846
|
+
|
847
|
+
ed.execCommand('mceInsertContent', false, content);
|
848
|
+
}
|
849
|
+
},
|
850
|
+
|
851
|
+
/**
|
852
|
+
* This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
|
853
|
+
*/
|
854
|
+
_legacySupport : function() {
|
855
|
+
var t = this, ed = t.editor;
|
856
|
+
|
857
|
+
// Register command(s) for backwards compatibility
|
858
|
+
ed.addCommand("mcePasteWord", function() {
|
859
|
+
ed.windowManager.open({
|
860
|
+
file: t.url + "/pasteword.htm",
|
861
|
+
width: parseInt(getParam(ed, "paste_dialog_width")),
|
862
|
+
height: parseInt(getParam(ed, "paste_dialog_height")),
|
863
|
+
inline: 1
|
864
|
+
});
|
865
|
+
});
|
866
|
+
|
867
|
+
if (getParam(ed, "paste_text_use_dialog")) {
|
868
|
+
ed.addCommand("mcePasteText", function() {
|
869
|
+
ed.windowManager.open({
|
870
|
+
file : t.url + "/pastetext.htm",
|
871
|
+
width: parseInt(getParam(ed, "paste_dialog_width")),
|
872
|
+
height: parseInt(getParam(ed, "paste_dialog_height")),
|
873
|
+
inline : 1
|
874
|
+
});
|
875
|
+
});
|
876
|
+
}
|
877
|
+
|
878
|
+
// Register button for backwards compatibility
|
879
|
+
ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});
|
880
|
+
}
|
881
|
+
});
|
882
|
+
|
883
|
+
// Register plugin
|
884
|
+
tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);
|
885
|
+
})();
|