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(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{return v&&u.tagName==="P"&&t.tagName==="P"}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(y){var v="TABBING";var s="EMPTY";var J="ESCAPE";var z="PARAGRAPH";var N="UNKNOWN";var x=N;function E(U){return U.keyCode===tinymce.VK.TAB&&!(U.altKey||U.ctrlKey)&&(y.queryCommandState("InsertUnorderedList")||y.queryCommandState("InsertOrderedList"))}function w(){var U=B();var W=U.parentNode.parentNode;var V=U.parentNode.lastChild===U;return V&&!t(W)&&P(U)}function t(U){if(n(U)){return U.parentNode&&U.parentNode.tagName==="LI"}else{return U.tagName==="LI"}}function F(){return y.selection.isCollapsed()&&P(B())}function B(){var U=y.selection.getStart();return((U.tagName=="BR"||U.tagName=="")&&U.parentNode.tagName=="LI")?U.parentNode:U}function P(U){var V=U.childNodes.length;if(U.tagName==="LI"){return V==0?true:V==1&&(U.firstChild.tagName==""||U.firstChild.tagName=="BR"||H(U))}return false}function H(U){var V=tinymce.grep(U.parentNode.childNodes,function(Y){return Y.tagName=="LI"});var W=U==V[V.length-1];var X=U.firstChild;return tinymce.isIE9&&W&&(X.nodeValue==String.fromCharCode(160)||X.nodeValue==String.fromCharCode(32))}function T(U){return U.keyCode===tinymce.VK.ENTER}function A(U){return T(U)&&!U.shiftKey}function M(U){if(E(U)){return v}else{if(A(U)&&w()){return N}else{if(A(U)&&F()){return s}else{return N}}}}function D(U,V){if(x==v||x==s||tinymce.isGecko&&x==J){r.cancel(V)}}function C(){var U=y.selection.getRng(true);var V=U.startContainer;if(V.nodeType==3){var W=V.nodeValue;if(tinymce.isIE9&&W.length>1&&W.charCodeAt(W.length-1)==32){return(U.endOffset==W.length-1)}else{return(U.endOffset==W.length)}}else{if(V.nodeType==1){return U.endOffset==V.childNodes.length}}return false}function I(){var W=y.selection.getNode();var V="h1,h2,h3,h4,h5,h6,p,div";var U=y.dom.is(W,V)&&W.parentNode.tagName==="LI"&&W.parentNode.lastChild===W;return y.selection.isCollapsed()&&U&&C()}function K(W,Y){if(A(Y)&&I()){var X=W.selection.getNode();var V=W.dom.create("li");var U=W.dom.getParent(X,"li");W.dom.insertAfter(V,U);if(tinymce.isIE6||tinymce.isIE7||tinyMCE.isIE8){W.selection.setCursorLocation(V,1)}else{W.selection.setCursorLocation(V,0)}Y.preventDefault()}}function u(X,Z){var ac;if(!tinymce.isGecko){return}var V=X.selection.getStart();if(Z.keyCode!=tinymce.VK.BACKSPACE||V.tagName!=="IMG"){return}function W(ag){var ah=ag.firstChild;var af=null;do{if(!ah){break}if(ah.tagName==="LI"){af=ah}}while(ah=ah.nextSibling);return af}function ae(ag,af){while(ag.childNodes.length>0){af.appendChild(ag.childNodes[0])}}ac=V.parentNode.previousSibling;if(!ac){return}var aa;if(ac.tagName==="UL"||ac.tagName==="OL"){aa=ac}else{if(ac.previousSibling&&(ac.previousSibling.tagName==="UL"||ac.previousSibling.tagName==="OL")){aa=ac.previousSibling}else{return}}var ad=W(aa);var U=X.dom.createRng();U.setStart(ad,1);U.setEnd(ad,1);X.selection.setRng(U);X.selection.collapse(true);var Y=X.selection.getBookmark();var ab=V.parentNode.cloneNode(true);if(ab.tagName==="P"||ab.tagName==="DIV"){ae(ab,ad)}else{ad.appendChild(ab)}V.parentNode.parentNode.removeChild(V.parentNode);X.selection.moveToBookmark(Y)}function G(U){var V=y.dom.getParent(U,"ol,ul");if(V!=null){var W=V.lastChild;y.selection.setCursorLocation(W,0)}}this.ed=y;y.addCommand("Indent",this.indent,this);y.addCommand("Outdent",this.outdent,this);y.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);y.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);y.onInit.add(function(){y.editorCommands.addCommands({outdent:function(){var V=y.selection,W=y.dom;function U(X){X=W.getParent(X,W.isBlock);return X&&(parseInt(y.dom.getStyle(X,"margin-left")||0,10)+parseInt(y.dom.getStyle(X,"padding-left")||0,10))>0}return U(V.getStart())||U(V.getEnd())||y.queryCommandState("InsertOrderedList")||y.queryCommandState("InsertUnorderedList")}},"state")});y.onKeyUp.add(function(V,W){if(x==v){V.execCommand(W.shiftKey?"Outdent":"Indent",true,null);x=N;return r.cancel(W)}else{if(x==s){var U=B();var Y=V.settings.list_outdent_on_enter===true||W.shiftKey;V.execCommand(Y?"Outdent":"Indent",true,null);if(tinymce.isIE){G(U)}return r.cancel(W)}else{if(x==J){if(tinymce.isIE6||tinymce.isIE7||tinymce.isIE8){var X=V.getDoc().createTextNode("\uFEFF");V.selection.getNode().appendChild(X)}else{if(tinymce.isIE9||tinymce.isGecko){V.execCommand("Outdent");return r.cancel(W)}}}}}});function L(V,U){var W=y.getDoc().createTextNode("\uFEFF");V.insertBefore(W,U);y.selection.setCursorLocation(W,0);y.execCommand("mceRepaint")}function R(V,X){if(T(X)){var U=B();if(U){var W=U.parentNode;var Y=W&&W.parentNode;if(Y&&Y.nodeName=="LI"&&Y.firstChild==W&&U==W.firstChild){L(Y,W)}}}}function S(V,X){if(T(X)){var U=B();if(V.dom.select("ul li",U).length===1){var W=U.firstChild;L(U,W)}}}function Q(W,aa){function X(ab){var ad=[];var ae=new tinymce.dom.TreeWalker(ab.firstChild,ab);for(var ac=ae.current();ac;ac=ae.next()){if(W.dom.is(ac,"ol,ul,li")){ad.push(ac)}}return ad}if(aa.keyCode==tinymce.VK.BACKSPACE){var U=B();if(U){var Z=W.dom.getParent(U,"ol,ul"),V=W.selection.getRng();if(Z&&Z.firstChild===U&&V.startOffset==0){var Y=X(U);Y.unshift(U);W.execCommand("Outdent",false,Y);W.undoManager.add();return r.cancel(aa)}}}}function O(V,X){var U=B();if(X.keyCode===tinymce.VK.BACKSPACE&&V.dom.is(U,"li")&&U.parentNode.firstChild!==U){if(V.dom.select("ul,ol",U).length===1){var Z=U.previousSibling;V.dom.remove(V.dom.select("br",U));V.dom.remove(U,true);var W=tinymce.grep(Z.childNodes,function(aa){return aa.nodeType===3});if(W.length===1){var Y=W[0];V.selection.setCursorLocation(Y,Y.length)}V.undoManager.add();return r.cancel(X)}}}y.onKeyDown.add(function(U,V){x=M(V)});y.onKeyDown.add(D);y.onKeyDown.add(u);y.onKeyDown.add(K);if(tinymce.isGecko){y.onKeyUp.add(R)}if(tinymce.isIE8){y.onKeyUp.add(S)}if(tinymce.isGecko||tinymce.isWebKit){y.onKeyDown.add(Q)}if(tinymce.isWebKit){y.onKeyDown.add(O)}},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(t){if(t.tagName==="LI"&&(M.tagName==="P"||G.length>1)){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true)}return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(P,L,N){var t,O=P,M;while(!I.isBlock(P.parentNode)&&P.parentNode!==I.getRoot()){P=I.split(P.parentNode,P.previousSibling);P=P.nextSibling;O=P}if(N){t=N.cloneNode(true);P.parentNode.insertBefore(t,P);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");P.parentNode.insertBefore(t,P)}while(O&&O!=L){M=O.nextSibling;t.appendChild(O);O=M}if(t.childNodes.length===0){t.innerHTML='<br _mce_bogus="1" />'}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(U){if(U.hasAttribute&&U.hasAttribute("_mce_bogus")){return true}if(P(N,U)){I.addClass(U,"_mce_tagged_br");N=S(U)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w&&!H||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D,elements:this.selectedBlocks()}}else{B={defaultAction:x,elements:this.selectedBlocks(),processEvenIfEmpty:true}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true),elements:this.selectedBlocks()})},outdent:function(y,x){var w=this,u=w.ed,z=u.dom,s=[];function A(t){var C,B,D;if(!d(u,t,s)){if(z.getStyle(t,"margin-left")!==""||z.getStyle(t,"padding-left")!==""){return w.adjustPaddingFunction(false)(t)}D=z.getStyle(t,"text-align",true);if(D==="center"||D==="right"){z.setStyle(t,"text-align","left");return}t=c(t,z);C=t.parentNode;B=t.parentNode.parentNode;if(B.tagName==="P"){z.split(B,t.parentNode)}else{z.split(C,t);if(B.tagName==="LI"){z.split(B,t)}else{if(!z.is(B,"ol,ul")){z.rename(t,"p")}}}s.push(t)}}var v=x&&tinymce.is(x,"array")?x:this.selectedBlocks();this.process({LI:A,defaultAction:this.adjustPaddingFunction(false),elements:v});e(s,m)},process:function(y){var F=this,w=F.ed.selection,z=F.ed.dom,E,u;function B(t){var s=tinymce.grep(t.childNodes,function(H){return !(H.nodeName==="BR"||H.nodeName==="SPAN"&&z.getAttrib(H,"data-mce-type")=="bookmark"||H.nodeType==3&&(H.nodeValue==String.fromCharCode(160)||H.nodeValue==""))});return s.length===0}function x(s){z.removeClass(s,"_mce_act_on");if(!s||s.nodeType!==1||!y.processEvenIfEmpty&&E.length>1&&B(s)){return}s=k(s,z);var t=y[s.tagName];if(!t){t=y.defaultAction}t(s)}function v(s){F.splitSafeEach(s.childNodes,x,true)}function C(s,t){return t>=0&&s.hasChildNodes()&&t<s.childNodes.length&&s.childNodes[t].tagName==="BR"}function D(){var t=w.getNode();var s=z.getParent(t,"td");return s!==null}E=y.elements;u=w.getRng(true);if(!u.collapsed){if(C(u.endContainer,u.endOffset-1)){u.setEnd(u.endContainer,u.endOffset-1);w.setRng(u)}if(C(u.startContainer,u.startOffset)){u.setStart(u.startContainer,u.startOffset+1);w.setRng(u)}}if(tinymce.isIE8){var G=F.ed.selection.getNode();if(G.tagName==="LI"&&!(G.parentNode.lastChild===G)){var A=F.ed.getDoc().createTextNode("\uFEFF");G.appendChild(A)}}g=w.getBookmark();y.OL=y.UL=v;F.splitSafeEach(E,x);w.moveToBookmark(g);g=null;if(!D()){F.ed.execCommand("mceRepaint")}},splitSafeEach:function(u,t,s){if(s||(tinymce.isGecko&&(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent)||/Firefox\/3\.[0-4]/.test(navigator.userAgent)))){this.classBasedEach(u,t)}else{e(u,t)}},classBasedEach:function(v,u){var w=this.ed.dom,s,t;e(v,function(x){w.addClass(x,"_mce_act_on")});s=w.select("._mce_act_on");while(s.length>0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},selectedBlocks:function(){var s=this.ed,t=s.selection.getSelectedBlocks();return t.length==0?[s.dom.getRoot()]:t},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}());
|
@@ -0,0 +1,955 @@
|
|
1
|
+
/**
|
2
|
+
* editor_plugin_src.js
|
3
|
+
*
|
4
|
+
* Copyright 2011, 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, Event = tinymce.dom.Event, bookmark;
|
13
|
+
|
14
|
+
// Skips text nodes that only contain whitespace since they aren't semantically important.
|
15
|
+
function skipWhitespaceNodes(e, next) {
|
16
|
+
while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
|
17
|
+
e = next(e);
|
18
|
+
}
|
19
|
+
return e;
|
20
|
+
}
|
21
|
+
|
22
|
+
function skipWhitespaceNodesBackwards(e) {
|
23
|
+
return skipWhitespaceNodes(e, function(e) {
|
24
|
+
return e.previousSibling;
|
25
|
+
});
|
26
|
+
}
|
27
|
+
|
28
|
+
function skipWhitespaceNodesForwards(e) {
|
29
|
+
return skipWhitespaceNodes(e, function(e) {
|
30
|
+
return e.nextSibling;
|
31
|
+
});
|
32
|
+
}
|
33
|
+
|
34
|
+
function hasParentInList(ed, e, list) {
|
35
|
+
return ed.dom.getParent(e, function(p) {
|
36
|
+
return tinymce.inArray(list, p) !== -1;
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
function isList(e) {
|
41
|
+
return e && (e.tagName === 'OL' || e.tagName === 'UL');
|
42
|
+
}
|
43
|
+
|
44
|
+
function splitNestedLists(element, dom) {
|
45
|
+
var tmp, nested, wrapItem;
|
46
|
+
tmp = skipWhitespaceNodesBackwards(element.lastChild);
|
47
|
+
while (isList(tmp)) {
|
48
|
+
nested = tmp;
|
49
|
+
tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
|
50
|
+
}
|
51
|
+
if (nested) {
|
52
|
+
wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
53
|
+
dom.split(element, nested);
|
54
|
+
dom.insertAfter(wrapItem, nested);
|
55
|
+
wrapItem.appendChild(nested);
|
56
|
+
wrapItem.appendChild(nested);
|
57
|
+
element = wrapItem.previousSibling;
|
58
|
+
}
|
59
|
+
return element;
|
60
|
+
}
|
61
|
+
|
62
|
+
function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
|
63
|
+
e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
|
64
|
+
return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
|
65
|
+
}
|
66
|
+
|
67
|
+
function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
|
68
|
+
var prev = skipWhitespaceNodesBackwards(e.previousSibling);
|
69
|
+
if (prev) {
|
70
|
+
return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
|
71
|
+
} else {
|
72
|
+
return e;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
|
77
|
+
var next = skipWhitespaceNodesForwards(e.nextSibling);
|
78
|
+
if (next) {
|
79
|
+
return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
|
80
|
+
} else {
|
81
|
+
return e;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
|
86
|
+
if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
|
87
|
+
return merge(e1, e2, differentStylesMasterElement);
|
88
|
+
} else if (e1 && e1.tagName === 'LI' && isList(e2)) {
|
89
|
+
// Fix invalidly nested lists.
|
90
|
+
e1.appendChild(e2);
|
91
|
+
}
|
92
|
+
return e2;
|
93
|
+
}
|
94
|
+
|
95
|
+
function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
|
96
|
+
if (!e1 || !e2) {
|
97
|
+
return false;
|
98
|
+
} else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
|
99
|
+
return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
|
100
|
+
} else if (isList(e1)) {
|
101
|
+
return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
|
102
|
+
} else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
|
103
|
+
}
|
104
|
+
|
105
|
+
function isListForIndent(e) {
|
106
|
+
var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
|
107
|
+
return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
|
108
|
+
}
|
109
|
+
|
110
|
+
function containsOnlyAList(e) {
|
111
|
+
var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
|
112
|
+
return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
|
113
|
+
}
|
114
|
+
|
115
|
+
function merge(e1, e2, masterElement) {
|
116
|
+
var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
|
117
|
+
if (e1.tagName === 'P') {
|
118
|
+
e1.appendChild(e1.ownerDocument.createElement('br'));
|
119
|
+
}
|
120
|
+
while (e2.firstChild) {
|
121
|
+
e1.appendChild(e2.firstChild);
|
122
|
+
}
|
123
|
+
if (masterElement) {
|
124
|
+
e1.style.listStyleType = masterElement.style.listStyleType;
|
125
|
+
}
|
126
|
+
e2.parentNode.removeChild(e2);
|
127
|
+
attemptMerge(lastOriginal, firstNew, false);
|
128
|
+
return e1;
|
129
|
+
}
|
130
|
+
|
131
|
+
function findItemToOperateOn(e, dom) {
|
132
|
+
var item;
|
133
|
+
if (!dom.is(e, 'li,ol,ul')) {
|
134
|
+
item = dom.getParent(e, 'li');
|
135
|
+
if (item) {
|
136
|
+
e = item;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return e;
|
140
|
+
}
|
141
|
+
|
142
|
+
tinymce.create('tinymce.plugins.Lists', {
|
143
|
+
init: function(ed) {
|
144
|
+
var LIST_TABBING = 'TABBING';
|
145
|
+
var LIST_EMPTY_ITEM = 'EMPTY';
|
146
|
+
var LIST_ESCAPE = 'ESCAPE';
|
147
|
+
var LIST_PARAGRAPH = 'PARAGRAPH';
|
148
|
+
var LIST_UNKNOWN = 'UNKNOWN';
|
149
|
+
var state = LIST_UNKNOWN;
|
150
|
+
|
151
|
+
function isTabInList(e) {
|
152
|
+
// Don't indent on Ctrl+Tab or Alt+Tab
|
153
|
+
return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
|
154
|
+
(ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
|
155
|
+
}
|
156
|
+
|
157
|
+
function isOnLastListItem() {
|
158
|
+
var li = getLi();
|
159
|
+
var grandParent = li.parentNode.parentNode;
|
160
|
+
var isLastItem = li.parentNode.lastChild === li;
|
161
|
+
return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
|
162
|
+
}
|
163
|
+
|
164
|
+
function isNestedList(grandParent) {
|
165
|
+
if (isList(grandParent)) {
|
166
|
+
return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
|
167
|
+
} else {
|
168
|
+
return grandParent.tagName === 'LI';
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
function isInEmptyListItem() {
|
173
|
+
return ed.selection.isCollapsed() && isEmptyListItem(getLi());
|
174
|
+
}
|
175
|
+
|
176
|
+
function getLi() {
|
177
|
+
var n = ed.selection.getStart();
|
178
|
+
// Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
|
179
|
+
return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
|
180
|
+
}
|
181
|
+
|
182
|
+
function isEmptyListItem(li) {
|
183
|
+
var numChildren = li.childNodes.length;
|
184
|
+
if (li.tagName === 'LI') {
|
185
|
+
return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
|
186
|
+
}
|
187
|
+
return false;
|
188
|
+
}
|
189
|
+
|
190
|
+
function isEmptyIE9Li(li) {
|
191
|
+
// only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
|
192
|
+
var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
|
193
|
+
var isLastLi = li == lis[lis.length - 1];
|
194
|
+
var child = li.firstChild;
|
195
|
+
return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
|
196
|
+
}
|
197
|
+
|
198
|
+
function isEnter(e) {
|
199
|
+
return e.keyCode === tinymce.VK.ENTER;
|
200
|
+
}
|
201
|
+
|
202
|
+
function isEnterWithoutShift(e) {
|
203
|
+
return isEnter(e) && !e.shiftKey;
|
204
|
+
}
|
205
|
+
|
206
|
+
function getListKeyState(e) {
|
207
|
+
if (isTabInList(e)) {
|
208
|
+
return LIST_TABBING;
|
209
|
+
} else if (isEnterWithoutShift(e) && isOnLastListItem()) {
|
210
|
+
// Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
|
211
|
+
//return LIST_ESCAPE;
|
212
|
+
return LIST_UNKNOWN;
|
213
|
+
} else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
|
214
|
+
return LIST_EMPTY_ITEM;
|
215
|
+
} else {
|
216
|
+
return LIST_UNKNOWN;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
function cancelDefaultEvents(ed, e) {
|
221
|
+
// list escape is done manually using outdent as it does not create paragraphs correctly in td's
|
222
|
+
if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
|
223
|
+
Event.cancel(e);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
function isCursorAtEndOfContainer() {
|
228
|
+
var range = ed.selection.getRng(true);
|
229
|
+
var startContainer = range.startContainer;
|
230
|
+
if (startContainer.nodeType == 3) {
|
231
|
+
var value = startContainer.nodeValue;
|
232
|
+
if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
|
233
|
+
// IE9 places a space on the end of the text in some cases so ignore last char
|
234
|
+
return (range.endOffset == value.length-1);
|
235
|
+
} else {
|
236
|
+
return (range.endOffset == value.length);
|
237
|
+
}
|
238
|
+
} else if (startContainer.nodeType == 1) {
|
239
|
+
return range.endOffset == startContainer.childNodes.length;
|
240
|
+
}
|
241
|
+
return false;
|
242
|
+
}
|
243
|
+
|
244
|
+
/*
|
245
|
+
If we are at the end of a list item surrounded with an element, pressing enter should create a
|
246
|
+
new list item instead without splitting the element e.g. don't want to create new P or H1 tag
|
247
|
+
*/
|
248
|
+
function isEndOfListItem() {
|
249
|
+
var node = ed.selection.getNode();
|
250
|
+
var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
|
251
|
+
var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
|
252
|
+
return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
|
253
|
+
}
|
254
|
+
|
255
|
+
// Creates a new list item after the current selection's list item parent
|
256
|
+
function createNewLi(ed, e) {
|
257
|
+
if (isEnterWithoutShift(e) && isEndOfListItem()) {
|
258
|
+
var node = ed.selection.getNode();
|
259
|
+
var li = ed.dom.create("li");
|
260
|
+
var parentLi = ed.dom.getParent(node, 'li');
|
261
|
+
ed.dom.insertAfter(li, parentLi);
|
262
|
+
|
263
|
+
// Move caret to new list element.
|
264
|
+
if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
|
265
|
+
// Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
|
266
|
+
//li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point
|
267
|
+
ed.selection.setCursorLocation(li, 1);
|
268
|
+
} else {
|
269
|
+
ed.selection.setCursorLocation(li, 0);
|
270
|
+
}
|
271
|
+
e.preventDefault();
|
272
|
+
}
|
273
|
+
}
|
274
|
+
|
275
|
+
function imageJoiningListItem(ed, e) {
|
276
|
+
var prevSibling;
|
277
|
+
|
278
|
+
if (!tinymce.isGecko)
|
279
|
+
return;
|
280
|
+
|
281
|
+
var n = ed.selection.getStart();
|
282
|
+
if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
|
283
|
+
return;
|
284
|
+
|
285
|
+
function lastLI(node) {
|
286
|
+
var child = node.firstChild;
|
287
|
+
var li = null;
|
288
|
+
do {
|
289
|
+
if (!child)
|
290
|
+
break;
|
291
|
+
|
292
|
+
if (child.tagName === 'LI')
|
293
|
+
li = child;
|
294
|
+
} while (child = child.nextSibling);
|
295
|
+
|
296
|
+
return li;
|
297
|
+
}
|
298
|
+
|
299
|
+
function addChildren(parentNode, destination) {
|
300
|
+
while (parentNode.childNodes.length > 0)
|
301
|
+
destination.appendChild(parentNode.childNodes[0]);
|
302
|
+
}
|
303
|
+
|
304
|
+
// Check if there is a previous sibling
|
305
|
+
prevSibling = n.parentNode.previousSibling;
|
306
|
+
if (!prevSibling)
|
307
|
+
return;
|
308
|
+
|
309
|
+
var ul;
|
310
|
+
if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
|
311
|
+
ul = prevSibling;
|
312
|
+
else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
|
313
|
+
ul = prevSibling.previousSibling;
|
314
|
+
else
|
315
|
+
return;
|
316
|
+
|
317
|
+
var li = lastLI(ul);
|
318
|
+
|
319
|
+
// move the caret to the end of the list item
|
320
|
+
var rng = ed.dom.createRng();
|
321
|
+
rng.setStart(li, 1);
|
322
|
+
rng.setEnd(li, 1);
|
323
|
+
ed.selection.setRng(rng);
|
324
|
+
ed.selection.collapse(true);
|
325
|
+
|
326
|
+
// save a bookmark at the end of the list item
|
327
|
+
var bookmark = ed.selection.getBookmark();
|
328
|
+
|
329
|
+
// copy the image an its text to the list item
|
330
|
+
var clone = n.parentNode.cloneNode(true);
|
331
|
+
if (clone.tagName === 'P' || clone.tagName === 'DIV')
|
332
|
+
addChildren(clone, li);
|
333
|
+
else
|
334
|
+
li.appendChild(clone);
|
335
|
+
|
336
|
+
// remove the old copy of the image
|
337
|
+
n.parentNode.parentNode.removeChild(n.parentNode);
|
338
|
+
|
339
|
+
// move the caret where we saved the bookmark
|
340
|
+
ed.selection.moveToBookmark(bookmark);
|
341
|
+
}
|
342
|
+
|
343
|
+
// fix the cursor position to ensure it is correct in IE
|
344
|
+
function setCursorPositionToOriginalLi(li) {
|
345
|
+
var list = ed.dom.getParent(li, 'ol,ul');
|
346
|
+
if (list != null) {
|
347
|
+
var lastLi = list.lastChild;
|
348
|
+
// Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
|
349
|
+
//lastLi.appendChild(ed.getDoc().createElement(''));
|
350
|
+
ed.selection.setCursorLocation(lastLi, 0);
|
351
|
+
}
|
352
|
+
}
|
353
|
+
|
354
|
+
this.ed = ed;
|
355
|
+
ed.addCommand('Indent', this.indent, this);
|
356
|
+
ed.addCommand('Outdent', this.outdent, this);
|
357
|
+
ed.addCommand('InsertUnorderedList', function() {
|
358
|
+
this.applyList('UL', 'OL');
|
359
|
+
}, this);
|
360
|
+
ed.addCommand('InsertOrderedList', function() {
|
361
|
+
this.applyList('OL', 'UL');
|
362
|
+
}, this);
|
363
|
+
|
364
|
+
ed.onInit.add(function() {
|
365
|
+
ed.editorCommands.addCommands({
|
366
|
+
'outdent': function() {
|
367
|
+
var sel = ed.selection, dom = ed.dom;
|
368
|
+
|
369
|
+
function hasStyleIndent(n) {
|
370
|
+
n = dom.getParent(n, dom.isBlock);
|
371
|
+
return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
|
372
|
+
}
|
373
|
+
|
374
|
+
return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
|
375
|
+
}
|
376
|
+
}, 'state');
|
377
|
+
});
|
378
|
+
|
379
|
+
ed.onKeyUp.add(function(ed, e) {
|
380
|
+
if (state == LIST_TABBING) {
|
381
|
+
ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
|
382
|
+
state = LIST_UNKNOWN;
|
383
|
+
return Event.cancel(e);
|
384
|
+
} else if (state == LIST_EMPTY_ITEM) {
|
385
|
+
var li = getLi();
|
386
|
+
var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
|
387
|
+
ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
|
388
|
+
if (tinymce.isIE) {
|
389
|
+
setCursorPositionToOriginalLi(li);
|
390
|
+
}
|
391
|
+
|
392
|
+
return Event.cancel(e);
|
393
|
+
} else if (state == LIST_ESCAPE) {
|
394
|
+
if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
|
395
|
+
// append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
|
396
|
+
// if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
|
397
|
+
// escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
|
398
|
+
var n = ed.getDoc().createTextNode('\uFEFF');
|
399
|
+
ed.selection.getNode().appendChild(n);
|
400
|
+
} else if (tinymce.isIE9 || tinymce.isGecko) {
|
401
|
+
// IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
|
402
|
+
// Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
|
403
|
+
ed.execCommand('Outdent');
|
404
|
+
return Event.cancel(e);
|
405
|
+
}
|
406
|
+
}
|
407
|
+
});
|
408
|
+
|
409
|
+
function fixListItem(parent, reference) {
|
410
|
+
// a zero-sized non-breaking space is placed in the empty list item so that the nested list is
|
411
|
+
// displayed on the below line instead of next to it
|
412
|
+
var n = ed.getDoc().createTextNode('\uFEFF');
|
413
|
+
parent.insertBefore(n, reference);
|
414
|
+
ed.selection.setCursorLocation(n, 0);
|
415
|
+
// repaint to remove rendering artifact. only visible when creating new list
|
416
|
+
ed.execCommand('mceRepaint');
|
417
|
+
}
|
418
|
+
|
419
|
+
function fixIndentedListItemForGecko(ed, e) {
|
420
|
+
if (isEnter(e)) {
|
421
|
+
var li = getLi();
|
422
|
+
if (li) {
|
423
|
+
var parent = li.parentNode;
|
424
|
+
var grandParent = parent && parent.parentNode;
|
425
|
+
if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
|
426
|
+
fixListItem(grandParent, parent);
|
427
|
+
}
|
428
|
+
}
|
429
|
+
}
|
430
|
+
}
|
431
|
+
|
432
|
+
function fixIndentedListItemForIE8(ed, e) {
|
433
|
+
if (isEnter(e)) {
|
434
|
+
var li = getLi();
|
435
|
+
if (ed.dom.select('ul li', li).length === 1) {
|
436
|
+
var list = li.firstChild;
|
437
|
+
fixListItem(li, list);
|
438
|
+
}
|
439
|
+
}
|
440
|
+
}
|
441
|
+
|
442
|
+
function fixDeletingFirstCharOfList(ed, e) {
|
443
|
+
function listElements(li) {
|
444
|
+
var elements = [];
|
445
|
+
var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
|
446
|
+
for (var node = walker.current(); node; node = walker.next()) {
|
447
|
+
if (ed.dom.is(node, 'ol,ul,li')) {
|
448
|
+
elements.push(node);
|
449
|
+
}
|
450
|
+
}
|
451
|
+
return elements;
|
452
|
+
}
|
453
|
+
|
454
|
+
if (e.keyCode == tinymce.VK.BACKSPACE) {
|
455
|
+
var li = getLi();
|
456
|
+
if (li) {
|
457
|
+
var list = ed.dom.getParent(li, 'ol,ul'),
|
458
|
+
rng = ed.selection.getRng();
|
459
|
+
if (list && list.firstChild === li && rng.startOffset == 0) {
|
460
|
+
var elements = listElements(li);
|
461
|
+
elements.unshift(li);
|
462
|
+
ed.execCommand("Outdent", false, elements);
|
463
|
+
ed.undoManager.add();
|
464
|
+
return Event.cancel(e);
|
465
|
+
}
|
466
|
+
}
|
467
|
+
}
|
468
|
+
}
|
469
|
+
|
470
|
+
function fixDeletingEmptyLiInWebkit(ed, e) {
|
471
|
+
var li = getLi();
|
472
|
+
if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
|
473
|
+
if (ed.dom.select('ul,ol', li).length === 1) {
|
474
|
+
var prevLi = li.previousSibling;
|
475
|
+
ed.dom.remove(ed.dom.select('br', li));
|
476
|
+
ed.dom.remove(li, true);
|
477
|
+
var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
|
478
|
+
if (textNodes.length === 1) {
|
479
|
+
var textNode = textNodes[0];
|
480
|
+
ed.selection.setCursorLocation(textNode, textNode.length);
|
481
|
+
}
|
482
|
+
ed.undoManager.add();
|
483
|
+
return Event.cancel(e);
|
484
|
+
}
|
485
|
+
}
|
486
|
+
}
|
487
|
+
|
488
|
+
ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
|
489
|
+
ed.onKeyDown.add(cancelDefaultEvents);
|
490
|
+
ed.onKeyDown.add(imageJoiningListItem);
|
491
|
+
ed.onKeyDown.add(createNewLi);
|
492
|
+
|
493
|
+
if (tinymce.isGecko) {
|
494
|
+
ed.onKeyUp.add(fixIndentedListItemForGecko);
|
495
|
+
}
|
496
|
+
if (tinymce.isIE8) {
|
497
|
+
ed.onKeyUp.add(fixIndentedListItemForIE8);
|
498
|
+
}
|
499
|
+
if (tinymce.isGecko || tinymce.isWebKit) {
|
500
|
+
ed.onKeyDown.add(fixDeletingFirstCharOfList);
|
501
|
+
}
|
502
|
+
if (tinymce.isWebKit) {
|
503
|
+
ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
|
504
|
+
}
|
505
|
+
},
|
506
|
+
|
507
|
+
applyList: function(targetListType, oppositeListType) {
|
508
|
+
var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
|
509
|
+
selectedBlocks = ed.selection.getSelectedBlocks();
|
510
|
+
|
511
|
+
function cleanupBr(e) {
|
512
|
+
if (e && e.tagName === 'BR') {
|
513
|
+
dom.remove(e);
|
514
|
+
}
|
515
|
+
}
|
516
|
+
|
517
|
+
function makeList(element) {
|
518
|
+
var list = dom.create(targetListType), li;
|
519
|
+
|
520
|
+
function adjustIndentForNewList(element) {
|
521
|
+
// If there's a margin-left, outdent one level to account for the extra list margin.
|
522
|
+
if (element.style.marginLeft || element.style.paddingLeft) {
|
523
|
+
t.adjustPaddingFunction(false)(element);
|
524
|
+
}
|
525
|
+
}
|
526
|
+
|
527
|
+
if (element.tagName === 'LI') {
|
528
|
+
// No change required.
|
529
|
+
} else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
|
530
|
+
processBrs(element, function(startSection, br) {
|
531
|
+
doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
|
532
|
+
li = startSection.parentNode;
|
533
|
+
adjustIndentForNewList(li);
|
534
|
+
cleanupBr(br);
|
535
|
+
});
|
536
|
+
if (li) {
|
537
|
+
if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
|
538
|
+
dom.split(li.parentNode.parentNode, li.parentNode);
|
539
|
+
}
|
540
|
+
attemptMergeWithAdjacent(li.parentNode, true);
|
541
|
+
}
|
542
|
+
return;
|
543
|
+
} else {
|
544
|
+
// Put the list around the element.
|
545
|
+
li = dom.create('li');
|
546
|
+
dom.insertAfter(li, element);
|
547
|
+
li.appendChild(element);
|
548
|
+
adjustIndentForNewList(element);
|
549
|
+
element = li;
|
550
|
+
}
|
551
|
+
dom.insertAfter(list, element);
|
552
|
+
list.appendChild(element);
|
553
|
+
attemptMergeWithAdjacent(list, true);
|
554
|
+
applied.push(element);
|
555
|
+
}
|
556
|
+
|
557
|
+
function doWrapList(start, end, template) {
|
558
|
+
var li, n = start, tmp;
|
559
|
+
while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
|
560
|
+
start = dom.split(start.parentNode, start.previousSibling);
|
561
|
+
start = start.nextSibling;
|
562
|
+
n = start;
|
563
|
+
}
|
564
|
+
if (template) {
|
565
|
+
li = template.cloneNode(true);
|
566
|
+
start.parentNode.insertBefore(li, start);
|
567
|
+
while (li.firstChild) dom.remove(li.firstChild);
|
568
|
+
li = dom.rename(li, 'li');
|
569
|
+
} else {
|
570
|
+
li = dom.create('li');
|
571
|
+
start.parentNode.insertBefore(li, start);
|
572
|
+
}
|
573
|
+
while (n && n != end) {
|
574
|
+
tmp = n.nextSibling;
|
575
|
+
li.appendChild(n);
|
576
|
+
n = tmp;
|
577
|
+
}
|
578
|
+
if (li.childNodes.length === 0) {
|
579
|
+
li.innerHTML = '<br _mce_bogus="1" />';
|
580
|
+
}
|
581
|
+
makeList(li);
|
582
|
+
}
|
583
|
+
|
584
|
+
function processBrs(element, callback) {
|
585
|
+
var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
|
586
|
+
breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
|
587
|
+
|
588
|
+
function isAnyPartSelected(start, end) {
|
589
|
+
var r = dom.createRng(), sel;
|
590
|
+
bookmark.keep = true;
|
591
|
+
ed.selection.moveToBookmark(bookmark);
|
592
|
+
bookmark.keep = false;
|
593
|
+
sel = ed.selection.getRng(true);
|
594
|
+
if (!end) {
|
595
|
+
end = start.parentNode.lastChild;
|
596
|
+
}
|
597
|
+
r.setStartBefore(start);
|
598
|
+
r.setEndAfter(end);
|
599
|
+
return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
|
600
|
+
}
|
601
|
+
|
602
|
+
function nextLeaf(br) {
|
603
|
+
if (br.nextSibling)
|
604
|
+
return br.nextSibling;
|
605
|
+
if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
|
606
|
+
return nextLeaf(br.parentNode);
|
607
|
+
}
|
608
|
+
|
609
|
+
// Split on BRs within the range and process those.
|
610
|
+
startSection = element.firstChild;
|
611
|
+
// First mark the BRs that have any part of the previous section selected.
|
612
|
+
var trailingContentSelected = false;
|
613
|
+
each(dom.select(breakElements, element), function(br) {
|
614
|
+
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
615
|
+
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
616
|
+
}
|
617
|
+
if (isAnyPartSelected(startSection, br)) {
|
618
|
+
dom.addClass(br, '_mce_tagged_br');
|
619
|
+
startSection = nextLeaf(br);
|
620
|
+
}
|
621
|
+
});
|
622
|
+
trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
|
623
|
+
startSection = element.firstChild;
|
624
|
+
each(dom.select(breakElements, element), function(br) {
|
625
|
+
// Got a section from start to br.
|
626
|
+
var tmp = nextLeaf(br);
|
627
|
+
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
628
|
+
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
629
|
+
}
|
630
|
+
if (dom.hasClass(br, '_mce_tagged_br')) {
|
631
|
+
callback(startSection, br, previousBR);
|
632
|
+
previousBR = null;
|
633
|
+
} else {
|
634
|
+
previousBR = br;
|
635
|
+
}
|
636
|
+
startSection = tmp;
|
637
|
+
});
|
638
|
+
if (trailingContentSelected) {
|
639
|
+
callback(startSection, undefined, previousBR);
|
640
|
+
}
|
641
|
+
}
|
642
|
+
|
643
|
+
function wrapList(element) {
|
644
|
+
processBrs(element, function(startSection, br, previousBR) {
|
645
|
+
// Need to indent this part
|
646
|
+
doWrapList(startSection, br);
|
647
|
+
cleanupBr(br);
|
648
|
+
cleanupBr(previousBR);
|
649
|
+
});
|
650
|
+
}
|
651
|
+
|
652
|
+
function changeList(element) {
|
653
|
+
if (tinymce.inArray(applied, element) !== -1) {
|
654
|
+
return;
|
655
|
+
}
|
656
|
+
if (element.parentNode.tagName === oppositeListType) {
|
657
|
+
dom.split(element.parentNode, element);
|
658
|
+
makeList(element);
|
659
|
+
attemptMergeWithNext(element.parentNode, false);
|
660
|
+
}
|
661
|
+
applied.push(element);
|
662
|
+
}
|
663
|
+
|
664
|
+
function convertListItemToParagraph(element) {
|
665
|
+
var child, nextChild, mergedElement, splitLast;
|
666
|
+
if (tinymce.inArray(applied, element) !== -1) {
|
667
|
+
return;
|
668
|
+
}
|
669
|
+
element = splitNestedLists(element, dom);
|
670
|
+
while (dom.is(element.parentNode, 'ol,ul,li')) {
|
671
|
+
dom.split(element.parentNode, element);
|
672
|
+
}
|
673
|
+
// Push the original element we have from the selection, not the renamed one.
|
674
|
+
applied.push(element);
|
675
|
+
element = dom.rename(element, 'p');
|
676
|
+
mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
|
677
|
+
if (mergedElement === element) {
|
678
|
+
// Now split out any block elements that can't be contained within a P.
|
679
|
+
// Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
|
680
|
+
child = element.firstChild;
|
681
|
+
while (child) {
|
682
|
+
if (dom.isBlock(child)) {
|
683
|
+
child = dom.split(child.parentNode, child);
|
684
|
+
splitLast = true;
|
685
|
+
nextChild = child.nextSibling && child.nextSibling.firstChild;
|
686
|
+
} else {
|
687
|
+
nextChild = child.nextSibling;
|
688
|
+
if (splitLast && child.tagName === 'BR') {
|
689
|
+
dom.remove(child);
|
690
|
+
}
|
691
|
+
splitLast = false;
|
692
|
+
}
|
693
|
+
child = nextChild;
|
694
|
+
}
|
695
|
+
}
|
696
|
+
}
|
697
|
+
|
698
|
+
each(selectedBlocks, function(e) {
|
699
|
+
e = findItemToOperateOn(e, dom);
|
700
|
+
if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
|
701
|
+
hasOppositeType = true;
|
702
|
+
} else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
|
703
|
+
hasSameType = true;
|
704
|
+
} else {
|
705
|
+
hasNonList = true;
|
706
|
+
}
|
707
|
+
});
|
708
|
+
|
709
|
+
if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
|
710
|
+
actions = {
|
711
|
+
'LI': changeList,
|
712
|
+
'H1': makeList,
|
713
|
+
'H2': makeList,
|
714
|
+
'H3': makeList,
|
715
|
+
'H4': makeList,
|
716
|
+
'H5': makeList,
|
717
|
+
'H6': makeList,
|
718
|
+
'P': makeList,
|
719
|
+
'BODY': makeList,
|
720
|
+
'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
|
721
|
+
defaultAction: wrapList,
|
722
|
+
elements: this.selectedBlocks()
|
723
|
+
};
|
724
|
+
} else {
|
725
|
+
actions = {
|
726
|
+
defaultAction: convertListItemToParagraph,
|
727
|
+
elements: this.selectedBlocks(),
|
728
|
+
processEvenIfEmpty: true
|
729
|
+
};
|
730
|
+
}
|
731
|
+
this.process(actions);
|
732
|
+
},
|
733
|
+
|
734
|
+
indent: function() {
|
735
|
+
var ed = this.ed, dom = ed.dom, indented = [];
|
736
|
+
|
737
|
+
function createWrapItem(element) {
|
738
|
+
var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
739
|
+
dom.insertAfter(wrapItem, element);
|
740
|
+
return wrapItem;
|
741
|
+
}
|
742
|
+
|
743
|
+
function createWrapList(element) {
|
744
|
+
var wrapItem = createWrapItem(element),
|
745
|
+
list = dom.getParent(element, 'ol,ul'),
|
746
|
+
listType = list.tagName,
|
747
|
+
listStyle = dom.getStyle(list, 'list-style-type'),
|
748
|
+
attrs = {},
|
749
|
+
wrapList;
|
750
|
+
if (listStyle !== '') {
|
751
|
+
attrs.style = 'list-style-type: ' + listStyle + ';';
|
752
|
+
}
|
753
|
+
wrapList = dom.create(listType, attrs);
|
754
|
+
wrapItem.appendChild(wrapList);
|
755
|
+
return wrapList;
|
756
|
+
}
|
757
|
+
|
758
|
+
function indentLI(element) {
|
759
|
+
if (!hasParentInList(ed, element, indented)) {
|
760
|
+
element = splitNestedLists(element, dom);
|
761
|
+
var wrapList = createWrapList(element);
|
762
|
+
wrapList.appendChild(element);
|
763
|
+
attemptMergeWithAdjacent(wrapList.parentNode, false);
|
764
|
+
attemptMergeWithAdjacent(wrapList, false);
|
765
|
+
indented.push(element);
|
766
|
+
}
|
767
|
+
}
|
768
|
+
|
769
|
+
this.process({
|
770
|
+
'LI': indentLI,
|
771
|
+
defaultAction: this.adjustPaddingFunction(true),
|
772
|
+
elements: this.selectedBlocks()
|
773
|
+
});
|
774
|
+
|
775
|
+
},
|
776
|
+
|
777
|
+
outdent: function(ui, elements) {
|
778
|
+
var t = this, ed = t.ed, dom = ed.dom, outdented = [];
|
779
|
+
|
780
|
+
function outdentLI(element) {
|
781
|
+
var listElement, targetParent, align;
|
782
|
+
if (!hasParentInList(ed, element, outdented)) {
|
783
|
+
if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
|
784
|
+
return t.adjustPaddingFunction(false)(element);
|
785
|
+
}
|
786
|
+
align = dom.getStyle(element, 'text-align', true);
|
787
|
+
if (align === 'center' || align === 'right') {
|
788
|
+
dom.setStyle(element, 'text-align', 'left');
|
789
|
+
return;
|
790
|
+
}
|
791
|
+
element = splitNestedLists(element, dom);
|
792
|
+
listElement = element.parentNode;
|
793
|
+
targetParent = element.parentNode.parentNode;
|
794
|
+
if (targetParent.tagName === 'P') {
|
795
|
+
dom.split(targetParent, element.parentNode);
|
796
|
+
} else {
|
797
|
+
dom.split(listElement, element);
|
798
|
+
if (targetParent.tagName === 'LI') {
|
799
|
+
// Nested list, need to split the LI and go back out to the OL/UL element.
|
800
|
+
dom.split(targetParent, element);
|
801
|
+
} else if (!dom.is(targetParent, 'ol,ul')) {
|
802
|
+
dom.rename(element, 'p');
|
803
|
+
}
|
804
|
+
}
|
805
|
+
outdented.push(element);
|
806
|
+
}
|
807
|
+
}
|
808
|
+
|
809
|
+
var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
|
810
|
+
this.process({
|
811
|
+
'LI': outdentLI,
|
812
|
+
defaultAction: this.adjustPaddingFunction(false),
|
813
|
+
elements: listElements
|
814
|
+
});
|
815
|
+
|
816
|
+
each(outdented, attemptMergeWithAdjacent);
|
817
|
+
},
|
818
|
+
|
819
|
+
process: function(actions) {
|
820
|
+
var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
|
821
|
+
|
822
|
+
function isEmptyElement(element) {
|
823
|
+
var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
|
824
|
+
return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
|
825
|
+
|| n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
|
826
|
+
});
|
827
|
+
return excludeBrsAndBookmarks.length === 0;
|
828
|
+
}
|
829
|
+
|
830
|
+
function processElement(element) {
|
831
|
+
dom.removeClass(element, '_mce_act_on');
|
832
|
+
if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
|
833
|
+
return;
|
834
|
+
}
|
835
|
+
element = findItemToOperateOn(element, dom);
|
836
|
+
var action = actions[element.tagName];
|
837
|
+
if (!action) {
|
838
|
+
action = actions.defaultAction;
|
839
|
+
}
|
840
|
+
action(element);
|
841
|
+
}
|
842
|
+
|
843
|
+
function recurse(element) {
|
844
|
+
t.splitSafeEach(element.childNodes, processElement, true);
|
845
|
+
}
|
846
|
+
|
847
|
+
function brAtEdgeOfSelection(container, offset) {
|
848
|
+
return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
|
849
|
+
container.childNodes[offset].tagName === 'BR';
|
850
|
+
}
|
851
|
+
|
852
|
+
function isInTable() {
|
853
|
+
var n = sel.getNode();
|
854
|
+
var p = dom.getParent(n, 'td');
|
855
|
+
return p !== null;
|
856
|
+
}
|
857
|
+
|
858
|
+
selectedBlocks = actions.elements;
|
859
|
+
|
860
|
+
r = sel.getRng(true);
|
861
|
+
if (!r.collapsed) {
|
862
|
+
if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
|
863
|
+
r.setEnd(r.endContainer, r.endOffset - 1);
|
864
|
+
sel.setRng(r);
|
865
|
+
}
|
866
|
+
if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
|
867
|
+
r.setStart(r.startContainer, r.startOffset + 1);
|
868
|
+
sel.setRng(r);
|
869
|
+
}
|
870
|
+
}
|
871
|
+
|
872
|
+
|
873
|
+
if (tinymce.isIE8) {
|
874
|
+
// append a zero sized nbsp so that caret is restored correctly using bookmark
|
875
|
+
var s = t.ed.selection.getNode();
|
876
|
+
if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
|
877
|
+
var i = t.ed.getDoc().createTextNode('\uFEFF');
|
878
|
+
s.appendChild(i);
|
879
|
+
}
|
880
|
+
}
|
881
|
+
|
882
|
+
bookmark = sel.getBookmark();
|
883
|
+
actions.OL = actions.UL = recurse;
|
884
|
+
t.splitSafeEach(selectedBlocks, processElement);
|
885
|
+
sel.moveToBookmark(bookmark);
|
886
|
+
bookmark = null;
|
887
|
+
|
888
|
+
// we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
|
889
|
+
if (!isInTable()) {
|
890
|
+
// Avoids table or image handles being left behind in Firefox.
|
891
|
+
t.ed.execCommand('mceRepaint');
|
892
|
+
}
|
893
|
+
},
|
894
|
+
|
895
|
+
splitSafeEach: function(elements, f, forceClassBase) {
|
896
|
+
if (forceClassBase ||
|
897
|
+
(tinymce.isGecko &&
|
898
|
+
(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
|
899
|
+
/Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
|
900
|
+
this.classBasedEach(elements, f);
|
901
|
+
} else {
|
902
|
+
each(elements, f);
|
903
|
+
}
|
904
|
+
},
|
905
|
+
|
906
|
+
classBasedEach: function(elements, f) {
|
907
|
+
var dom = this.ed.dom, nodes, element;
|
908
|
+
// Mark nodes
|
909
|
+
each(elements, function(element) {
|
910
|
+
dom.addClass(element, '_mce_act_on');
|
911
|
+
});
|
912
|
+
nodes = dom.select('._mce_act_on');
|
913
|
+
while (nodes.length > 0) {
|
914
|
+
element = nodes.shift();
|
915
|
+
dom.removeClass(element, '_mce_act_on');
|
916
|
+
f(element);
|
917
|
+
nodes = dom.select('._mce_act_on');
|
918
|
+
}
|
919
|
+
},
|
920
|
+
|
921
|
+
adjustPaddingFunction: function(isIndent) {
|
922
|
+
var indentAmount, indentUnits, ed = this.ed;
|
923
|
+
indentAmount = ed.settings.indentation;
|
924
|
+
indentUnits = /[a-z%]+/i.exec(indentAmount);
|
925
|
+
indentAmount = parseInt(indentAmount, 10);
|
926
|
+
return function(element) {
|
927
|
+
var currentIndent, newIndentAmount;
|
928
|
+
currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
|
929
|
+
if (isIndent) {
|
930
|
+
newIndentAmount = currentIndent + indentAmount;
|
931
|
+
} else {
|
932
|
+
newIndentAmount = currentIndent - indentAmount;
|
933
|
+
}
|
934
|
+
ed.dom.setStyle(element, 'padding-left', '');
|
935
|
+
ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
|
936
|
+
};
|
937
|
+
},
|
938
|
+
|
939
|
+
selectedBlocks: function() {
|
940
|
+
var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
|
941
|
+
return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
|
942
|
+
},
|
943
|
+
|
944
|
+
getInfo: function() {
|
945
|
+
return {
|
946
|
+
longname : 'Lists',
|
947
|
+
author : 'Moxiecode Systems AB',
|
948
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
949
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
|
950
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
951
|
+
};
|
952
|
+
}
|
953
|
+
});
|
954
|
+
tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
|
955
|
+
}());
|