tb_core 1.1.10 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.md +50 -2
- data/app/assets/javascripts/admin/core/application.js +2 -2
- data/app/assets/javascripts/admin/core/editor.js +1 -0
- data/app/assets/javascripts/admin/core/preinit.js +1 -1
- data/app/assets/javascripts/admin/core/split_pane.js +4 -0
- data/app/assets/javascripts/admin/core/users.js +59 -12
- data/app/assets/libs/bootstrap/css/{bootstrap.css → bootstrap.css.scss} +11 -11
- data/app/assets/libs/{tiny_mce → tinymce}/plugins/tableDropdown/editor_plugin.js +0 -0
- data/app/controllers/admin/application_controller.rb +0 -1
- data/app/controllers/admin/roles_controller.rb +10 -4
- data/app/controllers/admin/settings_controller.rb +10 -2
- data/app/controllers/admin/setup_controller.rb +7 -1
- data/app/controllers/admin/users_controller.rb +8 -2
- data/app/controllers/sitemaps_controller.rb +0 -1
- data/app/controllers/spud/application_controller.rb +9 -2
- data/app/helpers/spud/application_helper.rb +21 -0
- data/app/models/spud/spud_user_model.rb +79 -0
- data/app/models/spud_role.rb +0 -1
- data/app/models/spud_role_permission.rb +0 -1
- data/app/models/spud_user.rb +2 -80
- data/app/views/admin/roles/index.html.erb +4 -2
- data/app/views/admin/users/_form.html.erb +3 -0
- data/app/views/admin/users/_form_additions.html.erb +1 -0
- data/app/views/admin/users/_show_additions.html.erb +1 -0
- data/app/views/admin/users/show.html.erb +1 -0
- data/config/routes.rb +3 -3
- data/lib/generators/spud/module_generator.rb +5 -1
- data/lib/generators/spud/templates/admin_controller.rb.erb +6 -2
- data/lib/generators/spud/templates/views/admin/index.html.erb +5 -7
- data/lib/spud_core/engine.rb +2 -24
- data/lib/spud_core/version.rb +1 -1
- data/spec/controllers/admin/settings_controller_spec.rb +2 -2
- data/spec/controllers/sitemap_controllers_spec.rb +4 -3
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/environments/test.rb +9 -2
- data/spec/dummy/config/initializers/secret_token.rb +1 -0
- data/spec/dummy/log/test.log +12429 -0
- data/spec/dummy/tmp/cache/assets/test/sass/05388b0d18737541b44c9082e3fa19afa6bf3826/application.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/05388b0d18737541b44c9082e3fa19afa6bf3826/login.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/05388b0d18737541b44c9082e3fa19afa6bf3826/split_pane.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/05388b0d18737541b44c9082e3fa19afa6bf3826/users.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sass/e99c58815a3ff18987eada90ba5c7e95383074f2/bootstrap.css.scssc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0075c6e170e8012f220c7ed9fb5dc88b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/01666d6af504317dcf63364a37ce60f4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/03dcdc877f0257624872c73967d201c6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/06d52af2fa483161bb27dd39c3b34ee3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/098869073bd11dbc41fcaa47716a0ce7 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0cabf8a5146f359edd424e4f820e07f1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0f971f36ba87298fbaf46154fa8a5d30 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13809885160329b0a1a4e7885fb75ca4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/16243b3ad44c2997ad70996b58c56a2a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/169b221054fadd95f44252a232a5f053 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1816341e15110810c4647824cc81d1aa +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/18d440ef7bcf78056d346ac1ff2a6793 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1c06ad369cba88ec3ff5afc06e982d7c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1fa18bd231ff77b2af93913518487967 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/21e6a044a925c5f44f5a9d9b9e2d164a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2393e42173c512eb5171116ee479ab7e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2b94b5653a1151795fb999b3e98fd1d8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2fe2bffc50d1c3cd5c0a896a5528e23b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3024a96b82ffd6a5f68295a953231c92 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3123e8917685babc03cb0c8aeccac695 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/353180d0c9fd2a3ccef3718d7e6ace6c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/37539a535fefc75cd61aa9438d821846 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/38eabf5ce9c4dda42d09332aee816d3e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/39efa102c753ebe9defd90062785a8aa +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3cc30d9fb936455c063d7a950c46bb32 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4546971591261f8a01d0837f5a31af35 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/45b53d5ab2cac60703cd9d2cf52c14eb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/49d27d2d81616b48039efe15075da4f2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4a689e727abc31a4f93798253a176295 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/55d4fc42707dc9a3400faf92bed0360a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5759e8cff07b97209ca7ea6a93b3ed1a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5c4e1741d24424c6947eaff78829d41f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5cdaff8b68930bd29868b3d0fcb33766 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5de67e95811f3524bac96ba237505ae6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5fe538b2e33228dd92d36cfce50cf4b7 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6671fad14ea054e577e2dfbcd98e571c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6d7103090b0047c9b8d5746d75e8fac9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/705426de92785d4afa88b06757d25f7d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/71e715ef316e725981280e9bfe9d0527 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7391889bc52e8664fd5d590d58a7ec8f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7828cb89eaa43959329e301a04ef10a6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/80dda53c03df39ae9ed8c2400f05990a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8121614a686088a7f27165baf5d63da3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/85af4404353b8373764b166027ce78a4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/85cdc3810a743722e618b949199320ec +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/88099ac9106f32ee56c2cdde301f4aeb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/89fbb1e40182037e0eec01e0d3bab067 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8bb56cbae5a8a5b5f1cf04183a746966 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8fb7066c091dc8956fadaa0c316fb808 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/9214ad2c4fc7c0298ec351e00379a706 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/9313c3ae5de2dc96635bfa4e6957a149 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/940374cda01486d892775b6f65986599 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/966f020d24b19c1d685c51c240d1923a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a444109f6d82fec9d3e8224e0508abc9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a4adceeb24e0e96b3cd701b06c7b53d2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a4c8d8c64ed3eca5b07e3c1478b00a81 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a7305f76eab9ded7ce734cea8967a8ee +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/aa893fde36bb6d9e2184bba8385ce160 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b26e8bc7c7c32058397f892cd9d046d8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b8d4b4de990b07fda478ecb232a3b76f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ba173160d353bfb6e1f0f284bac8b9de +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/bc750b216ba26d779bcf79fac037b36b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/bef9d4af2f246671b5c9d21c40b49545 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c0eaf65fe0db1674c49ba2ae6cccb410 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c4fa3869fe96ebf26a17b08d5b45d5fb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c666b756412f64241236e1112b2e403d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c7301f1b1c7ee199b8b8487f43ce78c8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cb96d7509d3c2b2f16d6d3a1eaac2b79 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d02977fa67cf6643e31bb4c063a6d205 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d5b4ee9436615cb36bb22b9ba87791cf +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/daec02064da70ae5def8a75a5c36e58d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/dd32919d4bcd591d7aa6937ba4b39ddb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e12ec2fd151046a8235cb53a379b3151 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e232a62130dade197fcabdd428cf737c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e7d7a71fa09119e96e640cba43763911 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f165c137fabbacd60c1bc9fbb6878ae9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f365efd4df73b42e492cd479032636ca +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f81f473be9c249d9ff823b35ba6c7130 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fda81067bc547bd67ac35e1bc4a7c167 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fde0dc66d618f90500842b827a11d83b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fe35aa99166bfe64fdab2f5f5373a80d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ff91e57c48a0748be0394a67cd555438 +0 -0
- metadata +240 -182
- data/app/assets/libs/tiny_mce/jquery.tinymce.js +0 -1
- data/app/assets/libs/tiny_mce/langs/en.js +0 -1
- data/app/assets/libs/tiny_mce/license.txt +0 -504
- data/app/assets/libs/tiny_mce/plugins/advhr/css/advhr.css +0 -5
- data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin_src.js +0 -57
- data/app/assets/libs/tiny_mce/plugins/advhr/js/rule.js +0 -43
- data/app/assets/libs/tiny_mce/plugins/advhr/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advhr/rule.htm +0 -58
- data/app/assets/libs/tiny_mce/plugins/advimage/css/advimage.css +0 -13
- data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin_src.js +0 -50
- data/app/assets/libs/tiny_mce/plugins/advimage/image.htm +0 -235
- data/app/assets/libs/tiny_mce/plugins/advimage/img/sample.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/advimage/js/image.js +0 -462
- data/app/assets/libs/tiny_mce/plugins/advimage/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlink/css/advlink.css +0 -8
- data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin_src.js +0 -61
- data/app/assets/libs/tiny_mce/plugins/advlink/js/advlink.js +0 -539
- data/app/assets/libs/tiny_mce/plugins/advlink/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlink/link.htm +0 -338
- data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin_src.js +0 -174
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +0 -699
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/template.htm +0 -387
- data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin_src.js +0 -951
- data/app/assets/libs/tiny_mce/plugins/media/css/media.css +0 -17
- data/app/assets/libs/tiny_mce/plugins/media/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/media/editor_plugin_src.js +0 -890
- data/app/assets/libs/tiny_mce/plugins/media/js/embed.js +0 -73
- data/app/assets/libs/tiny_mce/plugins/media/js/media.js +0 -470
- data/app/assets/libs/tiny_mce/plugins/media/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/media/media.htm +0 -922
- data/app/assets/libs/tiny_mce/plugins/media/moxieplayer.swf +0 -0
- data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin_src.js +0 -871
- data/app/assets/libs/tiny_mce/plugins/paste/js/pastetext.js +0 -36
- data/app/assets/libs/tiny_mce/plugins/paste/js/pasteword.js +0 -51
- data/app/assets/libs/tiny_mce/plugins/paste/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/paste/pastetext.htm +0 -27
- data/app/assets/libs/tiny_mce/plugins/paste/pasteword.htm +0 -21
- data/app/assets/libs/tiny_mce/plugins/table/cell.htm +0 -180
- data/app/assets/libs/tiny_mce/plugins/table/css/cell.css +0 -17
- data/app/assets/libs/tiny_mce/plugins/table/css/row.css +0 -25
- data/app/assets/libs/tiny_mce/plugins/table/css/table.css +0 -13
- data/app/assets/libs/tiny_mce/plugins/table/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/table/editor_plugin_src.js +0 -1428
- data/app/assets/libs/tiny_mce/plugins/table/js/cell.js +0 -319
- data/app/assets/libs/tiny_mce/plugins/table/js/merge_cells.js +0 -27
- data/app/assets/libs/tiny_mce/plugins/table/js/row.js +0 -237
- data/app/assets/libs/tiny_mce/plugins/table/js/table.js +0 -489
- data/app/assets/libs/tiny_mce/plugins/table/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/table/merge_cells.htm +0 -32
- data/app/assets/libs/tiny_mce/plugins/table/row.htm +0 -158
- data/app/assets/libs/tiny_mce/plugins/table/table.htm +0 -188
- data/app/assets/libs/tiny_mce/themes/advanced/about.htm +0 -52
- data/app/assets/libs/tiny_mce/themes/advanced/anchor.htm +0 -26
- data/app/assets/libs/tiny_mce/themes/advanced/charmap.htm +0 -55
- data/app/assets/libs/tiny_mce/themes/advanced/color_picker.htm +0 -70
- data/app/assets/libs/tiny_mce/themes/advanced/editor_template.js +0 -1
- data/app/assets/libs/tiny_mce/themes/advanced/editor_template_src.js +0 -1467
- data/app/assets/libs/tiny_mce/themes/advanced/image.htm +0 -80
- data/app/assets/libs/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/iframe.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/trans.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/video.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/js/about.js +0 -73
- data/app/assets/libs/tiny_mce/themes/advanced/js/anchor.js +0 -44
- data/app/assets/libs/tiny_mce/themes/advanced/js/charmap.js +0 -363
- data/app/assets/libs/tiny_mce/themes/advanced/js/color_picker.js +0 -345
- data/app/assets/libs/tiny_mce/themes/advanced/js/image.js +0 -251
- data/app/assets/libs/tiny_mce/themes/advanced/js/link.js +0 -153
- data/app/assets/libs/tiny_mce/themes/advanced/js/source_editor.js +0 -78
- data/app/assets/libs/tiny_mce/themes/advanced/langs/en.js +0 -1
- data/app/assets/libs/tiny_mce/themes/advanced/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/themes/advanced/link.htm +0 -57
- data/app/assets/libs/tiny_mce/themes/advanced/shortcuts.htm +0 -47
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/content.css +0 -51
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/dialog.css +0 -118
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/ui.css +0 -215
- data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/content.css +0 -25
- data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +0 -106
- data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/ui.css +0 -102
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/content.css +0 -49
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/dialog.css +0 -118
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui.css +0 -218
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +0 -8
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
- data/app/assets/libs/tiny_mce/themes/advanced/source_editor.htm +0 -25
- data/app/assets/libs/tiny_mce/themes/simple/editor_template.js +0 -1
- data/app/assets/libs/tiny_mce/themes/simple/editor_template_src.js +0 -84
- data/app/assets/libs/tiny_mce/themes/simple/img/icons.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/simple/langs/en.js +0 -1
- data/app/assets/libs/tiny_mce/themes/simple/skins/default/content.css +0 -25
- data/app/assets/libs/tiny_mce/themes/simple/skins/default/ui.css +0 -32
- data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/content.css +0 -17
- data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/ui.css +0 -35
- data/app/assets/libs/tiny_mce/tiny_mce.js +0 -1
- data/app/assets/libs/tiny_mce/tiny_mce_popup.js +0 -5
- data/app/assets/libs/tiny_mce/tiny_mce_src.js +0 -16753
- data/app/assets/libs/tiny_mce/utils/editable_selects.js +0 -70
- data/app/assets/libs/tiny_mce/utils/form_utils.js +0 -210
- data/app/assets/libs/tiny_mce/utils/mctabs.js +0 -162
- data/app/assets/libs/tiny_mce/utils/validate.js +0 -252
- data/app/models/concerns/spud_authentication.rb +0 -10
@@ -1,871 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_plugin_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2009, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function() {
|
12
|
-
var each = tinymce.each,
|
13
|
-
defs = {
|
14
|
-
paste_auto_cleanup_on_paste : true,
|
15
|
-
paste_enable_default_filters : true,
|
16
|
-
paste_block_drop : false,
|
17
|
-
paste_retain_style_properties : "none",
|
18
|
-
paste_strip_class_attributes : "mso",
|
19
|
-
paste_remove_spans : false,
|
20
|
-
paste_remove_styles : false,
|
21
|
-
paste_remove_styles_if_webkit : true,
|
22
|
-
paste_convert_middot_lists : true,
|
23
|
-
paste_convert_headers_to_strong : false,
|
24
|
-
paste_dialog_width : "450",
|
25
|
-
paste_dialog_height : "400",
|
26
|
-
paste_text_use_dialog : false,
|
27
|
-
paste_text_sticky : false,
|
28
|
-
paste_text_sticky_default : false,
|
29
|
-
paste_text_notifyalways : false,
|
30
|
-
paste_text_linebreaktype : "combined",
|
31
|
-
paste_text_replacements : [
|
32
|
-
[/\u2026/g, "..."],
|
33
|
-
[/[\x93\x94\u201c\u201d]/g, '"'],
|
34
|
-
[/[\x60\x91\x92\u2018\u2019]/g, "'"]
|
35
|
-
]
|
36
|
-
};
|
37
|
-
|
38
|
-
function getParam(ed, name) {
|
39
|
-
return ed.getParam(name, defs[name]);
|
40
|
-
}
|
41
|
-
|
42
|
-
tinymce.create('tinymce.plugins.PastePlugin', {
|
43
|
-
init : function(ed, url) {
|
44
|
-
var t = this;
|
45
|
-
|
46
|
-
t.editor = ed;
|
47
|
-
t.url = url;
|
48
|
-
|
49
|
-
// Setup plugin events
|
50
|
-
t.onPreProcess = new tinymce.util.Dispatcher(t);
|
51
|
-
t.onPostProcess = new tinymce.util.Dispatcher(t);
|
52
|
-
|
53
|
-
// Register default handlers
|
54
|
-
t.onPreProcess.add(t._preProcess);
|
55
|
-
t.onPostProcess.add(t._postProcess);
|
56
|
-
|
57
|
-
// Register optional preprocess handler
|
58
|
-
t.onPreProcess.add(function(pl, o) {
|
59
|
-
ed.execCallback('paste_preprocess', pl, o);
|
60
|
-
});
|
61
|
-
|
62
|
-
// Register optional postprocess
|
63
|
-
t.onPostProcess.add(function(pl, o) {
|
64
|
-
ed.execCallback('paste_postprocess', pl, o);
|
65
|
-
});
|
66
|
-
|
67
|
-
ed.onKeyDown.addToTop(function(ed, e) {
|
68
|
-
// Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that
|
69
|
-
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
|
70
|
-
return false; // Stop other listeners
|
71
|
-
});
|
72
|
-
|
73
|
-
// Initialize plain text flag
|
74
|
-
ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');
|
75
|
-
|
76
|
-
// This function executes the process handlers and inserts the contents
|
77
|
-
// force_rich overrides plain text mode set by user, important for pasting with execCommand
|
78
|
-
function process(o, force_rich) {
|
79
|
-
var dom = ed.dom, rng;
|
80
|
-
|
81
|
-
// Execute pre process handlers
|
82
|
-
t.onPreProcess.dispatch(t, o);
|
83
|
-
|
84
|
-
// Create DOM structure
|
85
|
-
o.node = dom.create('div', 0, o.content);
|
86
|
-
|
87
|
-
// If pasting inside the same element and the contents is only one block
|
88
|
-
// remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
|
89
|
-
if (tinymce.isGecko) {
|
90
|
-
rng = ed.selection.getRng(true);
|
91
|
-
if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
|
92
|
-
// Is only one block node and it doesn't contain word stuff
|
93
|
-
if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)
|
94
|
-
dom.remove(o.node.firstChild, true);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
// Execute post process handlers
|
99
|
-
t.onPostProcess.dispatch(t, o);
|
100
|
-
|
101
|
-
// Serialize content
|
102
|
-
o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});
|
103
|
-
|
104
|
-
// Plain text option active?
|
105
|
-
if ((!force_rich) && (ed.pasteAsPlainText)) {
|
106
|
-
t._insertPlainText(o.content);
|
107
|
-
|
108
|
-
if (!getParam(ed, "paste_text_sticky")) {
|
109
|
-
ed.pasteAsPlainText = false;
|
110
|
-
ed.controlManager.setActive("pastetext", false);
|
111
|
-
}
|
112
|
-
} else {
|
113
|
-
t._insert(o.content);
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
// Add command for external usage
|
118
|
-
ed.addCommand('mceInsertClipboardContent', function(u, o) {
|
119
|
-
process(o, true);
|
120
|
-
});
|
121
|
-
|
122
|
-
if (!getParam(ed, "paste_text_use_dialog")) {
|
123
|
-
ed.addCommand('mcePasteText', function(u, v) {
|
124
|
-
var cookie = tinymce.util.Cookie;
|
125
|
-
|
126
|
-
ed.pasteAsPlainText = !ed.pasteAsPlainText;
|
127
|
-
ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
|
128
|
-
|
129
|
-
if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
|
130
|
-
if (getParam(ed, "paste_text_sticky")) {
|
131
|
-
ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
|
132
|
-
} else {
|
133
|
-
ed.windowManager.alert(ed.translate('paste.plaintext_mode'));
|
134
|
-
}
|
135
|
-
|
136
|
-
if (!getParam(ed, "paste_text_notifyalways")) {
|
137
|
-
cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
|
138
|
-
}
|
139
|
-
}
|
140
|
-
});
|
141
|
-
}
|
142
|
-
|
143
|
-
ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
|
144
|
-
ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
|
145
|
-
|
146
|
-
// This function grabs the contents from the clipboard by adding a
|
147
|
-
// hidden div and placing the caret inside it and after the browser paste
|
148
|
-
// is done it grabs that contents and processes that
|
149
|
-
function grabContent(e) {
|
150
|
-
var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
|
151
|
-
|
152
|
-
// Check if browser supports direct plaintext access
|
153
|
-
if (e.clipboardData || dom.doc.dataTransfer) {
|
154
|
-
textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
|
155
|
-
|
156
|
-
if (ed.pasteAsPlainText) {
|
157
|
-
e.preventDefault();
|
158
|
-
process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});
|
159
|
-
return;
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
if (dom.get('_mcePaste'))
|
164
|
-
return;
|
165
|
-
|
166
|
-
// Create container to paste into
|
167
|
-
n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');
|
168
|
-
|
169
|
-
// If contentEditable mode we need to find out the position of the closest element
|
170
|
-
if (body != ed.getDoc().body)
|
171
|
-
posY = dom.getPos(ed.selection.getStart(), body).y;
|
172
|
-
else
|
173
|
-
posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;
|
174
|
-
|
175
|
-
// Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
|
176
|
-
// If also needs to be in view on IE or the paste would fail
|
177
|
-
dom.setStyles(n, {
|
178
|
-
position : 'absolute',
|
179
|
-
left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div
|
180
|
-
top : posY - 25,
|
181
|
-
width : 1,
|
182
|
-
height : 1,
|
183
|
-
overflow : 'hidden'
|
184
|
-
});
|
185
|
-
|
186
|
-
if (tinymce.isIE) {
|
187
|
-
// Store away the old range
|
188
|
-
oldRng = sel.getRng();
|
189
|
-
|
190
|
-
// Select the container
|
191
|
-
rng = dom.doc.body.createTextRange();
|
192
|
-
rng.moveToElementText(n);
|
193
|
-
rng.execCommand('Paste');
|
194
|
-
|
195
|
-
// Remove container
|
196
|
-
dom.remove(n);
|
197
|
-
|
198
|
-
// Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
|
199
|
-
// to IE security settings so we pass the junk though better than nothing right
|
200
|
-
if (n.innerHTML === '\uFEFF\uFEFF') {
|
201
|
-
ed.execCommand('mcePasteWord');
|
202
|
-
e.preventDefault();
|
203
|
-
return;
|
204
|
-
}
|
205
|
-
|
206
|
-
// Restore the old range and clear the contents before pasting
|
207
|
-
sel.setRng(oldRng);
|
208
|
-
sel.setContent('');
|
209
|
-
|
210
|
-
// For some odd reason we need to detach the the mceInsertContent call from the paste event
|
211
|
-
// It's like IE has a reference to the parent element that you paste in and the selection gets messed up
|
212
|
-
// when it tries to restore the selection
|
213
|
-
setTimeout(function() {
|
214
|
-
// Process contents
|
215
|
-
process({content : n.innerHTML});
|
216
|
-
}, 0);
|
217
|
-
|
218
|
-
// Block the real paste event
|
219
|
-
return tinymce.dom.Event.cancel(e);
|
220
|
-
} else {
|
221
|
-
function block(e) {
|
222
|
-
e.preventDefault();
|
223
|
-
};
|
224
|
-
|
225
|
-
// Block mousedown and click to prevent selection change
|
226
|
-
dom.bind(ed.getDoc(), 'mousedown', block);
|
227
|
-
dom.bind(ed.getDoc(), 'keydown', block);
|
228
|
-
|
229
|
-
or = ed.selection.getRng();
|
230
|
-
|
231
|
-
// Move select contents inside DIV
|
232
|
-
n = n.firstChild;
|
233
|
-
rng = ed.getDoc().createRange();
|
234
|
-
rng.setStart(n, 0);
|
235
|
-
rng.setEnd(n, 2);
|
236
|
-
sel.setRng(rng);
|
237
|
-
|
238
|
-
// Wait a while and grab the pasted contents
|
239
|
-
window.setTimeout(function() {
|
240
|
-
var h = '', nl;
|
241
|
-
|
242
|
-
// Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
|
243
|
-
if (!dom.select('div.mcePaste > div.mcePaste').length) {
|
244
|
-
nl = dom.select('div.mcePaste');
|
245
|
-
|
246
|
-
// WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
|
247
|
-
each(nl, function(n) {
|
248
|
-
var child = n.firstChild;
|
249
|
-
|
250
|
-
// WebKit inserts a DIV container with lots of odd styles
|
251
|
-
if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
|
252
|
-
dom.remove(child, 1);
|
253
|
-
}
|
254
|
-
|
255
|
-
// Remove apply style spans
|
256
|
-
each(dom.select('span.Apple-style-span', n), function(n) {
|
257
|
-
dom.remove(n, 1);
|
258
|
-
});
|
259
|
-
|
260
|
-
// Remove bogus br elements
|
261
|
-
each(dom.select('br[data-mce-bogus]', n), function(n) {
|
262
|
-
dom.remove(n);
|
263
|
-
});
|
264
|
-
|
265
|
-
// WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
|
266
|
-
if (n.parentNode.className != 'mcePaste')
|
267
|
-
h += n.innerHTML;
|
268
|
-
});
|
269
|
-
} else {
|
270
|
-
// Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc
|
271
|
-
// So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same
|
272
|
-
h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';
|
273
|
-
}
|
274
|
-
|
275
|
-
// Remove the nodes
|
276
|
-
each(dom.select('div.mcePaste'), function(n) {
|
277
|
-
dom.remove(n);
|
278
|
-
});
|
279
|
-
|
280
|
-
// Restore the old selection
|
281
|
-
if (or)
|
282
|
-
sel.setRng(or);
|
283
|
-
|
284
|
-
process({content : h});
|
285
|
-
|
286
|
-
// Unblock events ones we got the contents
|
287
|
-
dom.unbind(ed.getDoc(), 'mousedown', block);
|
288
|
-
dom.unbind(ed.getDoc(), 'keydown', block);
|
289
|
-
}, 0);
|
290
|
-
}
|
291
|
-
}
|
292
|
-
|
293
|
-
// Check if we should use the new auto process method
|
294
|
-
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
|
295
|
-
// Is it's Opera or older FF use key handler
|
296
|
-
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
297
|
-
ed.onKeyDown.addToTop(function(ed, e) {
|
298
|
-
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
|
299
|
-
grabContent(e);
|
300
|
-
});
|
301
|
-
} else {
|
302
|
-
// Grab contents on paste event on Gecko and WebKit
|
303
|
-
ed.onPaste.addToTop(function(ed, e) {
|
304
|
-
return grabContent(e);
|
305
|
-
});
|
306
|
-
}
|
307
|
-
}
|
308
|
-
|
309
|
-
ed.onInit.add(function() {
|
310
|
-
ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);
|
311
|
-
|
312
|
-
// Block all drag/drop events
|
313
|
-
if (getParam(ed, "paste_block_drop")) {
|
314
|
-
ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
|
315
|
-
e.preventDefault();
|
316
|
-
e.stopPropagation();
|
317
|
-
|
318
|
-
return false;
|
319
|
-
});
|
320
|
-
}
|
321
|
-
});
|
322
|
-
|
323
|
-
// Add legacy support
|
324
|
-
t._legacySupport();
|
325
|
-
},
|
326
|
-
|
327
|
-
getInfo : function() {
|
328
|
-
return {
|
329
|
-
longname : 'Paste text/word',
|
330
|
-
author : 'Moxiecode Systems AB',
|
331
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
332
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
|
333
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
334
|
-
};
|
335
|
-
},
|
336
|
-
|
337
|
-
_preProcess : function(pl, o) {
|
338
|
-
var ed = this.editor,
|
339
|
-
h = o.content,
|
340
|
-
grep = tinymce.grep,
|
341
|
-
explode = tinymce.explode,
|
342
|
-
trim = tinymce.trim,
|
343
|
-
len, stripClass;
|
344
|
-
|
345
|
-
//console.log('Before preprocess:' + o.content);
|
346
|
-
|
347
|
-
function process(items) {
|
348
|
-
each(items, function(v) {
|
349
|
-
// Remove or replace
|
350
|
-
if (v.constructor == RegExp)
|
351
|
-
h = h.replace(v, '');
|
352
|
-
else
|
353
|
-
h = h.replace(v[0], v[1]);
|
354
|
-
});
|
355
|
-
}
|
356
|
-
|
357
|
-
if (ed.settings.paste_enable_default_filters == false) {
|
358
|
-
return;
|
359
|
-
}
|
360
|
-
|
361
|
-
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
|
362
|
-
if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) {
|
363
|
-
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
|
364
|
-
process([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g, '$1']]);
|
365
|
-
|
366
|
-
// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
|
367
|
-
process([
|
368
|
-
[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
|
369
|
-
[/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
|
370
|
-
[/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
|
371
|
-
]);
|
372
|
-
}
|
373
|
-
|
374
|
-
// Detect Word content and process it more aggressive
|
375
|
-
if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
|
376
|
-
o.wordContent = true; // Mark the pasted contents as word specific content
|
377
|
-
//console.log('Word contents detected.');
|
378
|
-
|
379
|
-
// Process away some basic content
|
380
|
-
process([
|
381
|
-
/^\s*( )+/gi, // entities at the start of contents
|
382
|
-
/( |<br[^>]*>)+\s*$/gi // entities at the end of contents
|
383
|
-
]);
|
384
|
-
|
385
|
-
if (getParam(ed, "paste_convert_headers_to_strong")) {
|
386
|
-
h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
|
387
|
-
}
|
388
|
-
|
389
|
-
if (getParam(ed, "paste_convert_middot_lists")) {
|
390
|
-
process([
|
391
|
-
[/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
|
392
|
-
[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers
|
393
|
-
[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)
|
394
|
-
]);
|
395
|
-
}
|
396
|
-
|
397
|
-
process([
|
398
|
-
// Word comments like conditional comments etc
|
399
|
-
/<!--[\s\S]+?-->/gi,
|
400
|
-
|
401
|
-
// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
|
402
|
-
/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
|
403
|
-
|
404
|
-
// Convert <s> into <strike> for line-though
|
405
|
-
[/<(\/?)s>/gi, "<$1strike>"],
|
406
|
-
|
407
|
-
// Replace nsbp entites to char since it's easier to handle
|
408
|
-
[/ /gi, "\u00a0"]
|
409
|
-
]);
|
410
|
-
|
411
|
-
// Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
|
412
|
-
// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
|
413
|
-
do {
|
414
|
-
len = h.length;
|
415
|
-
h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
416
|
-
} while (len != h.length);
|
417
|
-
|
418
|
-
// Remove all spans if no styles is to be retained
|
419
|
-
if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
|
420
|
-
h = h.replace(/<\/?span[^>]*>/gi, "");
|
421
|
-
} else {
|
422
|
-
// We're keeping styles, so at least clean them up.
|
423
|
-
// CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
|
424
|
-
|
425
|
-
process([
|
426
|
-
// Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
|
427
|
-
[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
|
428
|
-
function(str, spaces) {
|
429
|
-
return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
|
430
|
-
}
|
431
|
-
],
|
432
|
-
|
433
|
-
// Examine all styles: delete junk, transform some, and keep the rest
|
434
|
-
[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
|
435
|
-
function(str, tag, style) {
|
436
|
-
var n = [],
|
437
|
-
i = 0,
|
438
|
-
s = explode(trim(style).replace(/"/gi, "'"), ";");
|
439
|
-
|
440
|
-
// Examine each style definition within the tag's style attribute
|
441
|
-
each(s, function(v) {
|
442
|
-
var name, value,
|
443
|
-
parts = explode(v, ":");
|
444
|
-
|
445
|
-
function ensureUnits(v) {
|
446
|
-
return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
|
447
|
-
}
|
448
|
-
|
449
|
-
if (parts.length == 2) {
|
450
|
-
name = parts[0].toLowerCase();
|
451
|
-
value = parts[1].toLowerCase();
|
452
|
-
|
453
|
-
// Translate certain MS Office styles into their CSS equivalents
|
454
|
-
switch (name) {
|
455
|
-
case "mso-padding-alt":
|
456
|
-
case "mso-padding-top-alt":
|
457
|
-
case "mso-padding-right-alt":
|
458
|
-
case "mso-padding-bottom-alt":
|
459
|
-
case "mso-padding-left-alt":
|
460
|
-
case "mso-margin-alt":
|
461
|
-
case "mso-margin-top-alt":
|
462
|
-
case "mso-margin-right-alt":
|
463
|
-
case "mso-margin-bottom-alt":
|
464
|
-
case "mso-margin-left-alt":
|
465
|
-
case "mso-table-layout-alt":
|
466
|
-
case "mso-height":
|
467
|
-
case "mso-width":
|
468
|
-
case "mso-vertical-align-alt":
|
469
|
-
n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
|
470
|
-
return;
|
471
|
-
|
472
|
-
case "horiz-align":
|
473
|
-
n[i++] = "text-align:" + value;
|
474
|
-
return;
|
475
|
-
|
476
|
-
case "vert-align":
|
477
|
-
n[i++] = "vertical-align:" + value;
|
478
|
-
return;
|
479
|
-
|
480
|
-
case "font-color":
|
481
|
-
case "mso-foreground":
|
482
|
-
n[i++] = "color:" + value;
|
483
|
-
return;
|
484
|
-
|
485
|
-
case "mso-background":
|
486
|
-
case "mso-highlight":
|
487
|
-
n[i++] = "background:" + value;
|
488
|
-
return;
|
489
|
-
|
490
|
-
case "mso-default-height":
|
491
|
-
n[i++] = "min-height:" + ensureUnits(value);
|
492
|
-
return;
|
493
|
-
|
494
|
-
case "mso-default-width":
|
495
|
-
n[i++] = "min-width:" + ensureUnits(value);
|
496
|
-
return;
|
497
|
-
|
498
|
-
case "mso-padding-between-alt":
|
499
|
-
n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
|
500
|
-
return;
|
501
|
-
|
502
|
-
case "text-line-through":
|
503
|
-
if ((value == "single") || (value == "double")) {
|
504
|
-
n[i++] = "text-decoration:line-through";
|
505
|
-
}
|
506
|
-
return;
|
507
|
-
|
508
|
-
case "mso-zero-height":
|
509
|
-
if (value == "yes") {
|
510
|
-
n[i++] = "display:none";
|
511
|
-
}
|
512
|
-
return;
|
513
|
-
}
|
514
|
-
|
515
|
-
// Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name
|
516
|
-
if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {
|
517
|
-
return;
|
518
|
-
}
|
519
|
-
|
520
|
-
// If it reached this point, it must be a valid CSS style
|
521
|
-
n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case
|
522
|
-
}
|
523
|
-
});
|
524
|
-
|
525
|
-
// If style attribute contained any valid styles the re-write it; otherwise delete style attribute.
|
526
|
-
if (i > 0) {
|
527
|
-
return tag + ' style="' + n.join(';') + '"';
|
528
|
-
} else {
|
529
|
-
return tag;
|
530
|
-
}
|
531
|
-
}
|
532
|
-
]
|
533
|
-
]);
|
534
|
-
}
|
535
|
-
}
|
536
|
-
|
537
|
-
// Replace headers with <strong>
|
538
|
-
if (getParam(ed, "paste_convert_headers_to_strong")) {
|
539
|
-
process([
|
540
|
-
[/<h[1-6][^>]*>/gi, "<p><strong>"],
|
541
|
-
[/<\/h[1-6][^>]*>/gi, "</strong></p>"]
|
542
|
-
]);
|
543
|
-
}
|
544
|
-
|
545
|
-
process([
|
546
|
-
// Copy paste from Java like Open Office will produce this junk on FF
|
547
|
-
[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']
|
548
|
-
]);
|
549
|
-
|
550
|
-
// Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
|
551
|
-
// Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
|
552
|
-
stripClass = getParam(ed, "paste_strip_class_attributes");
|
553
|
-
|
554
|
-
if (stripClass !== "none") {
|
555
|
-
function removeClasses(match, g1) {
|
556
|
-
if (stripClass === "all")
|
557
|
-
return '';
|
558
|
-
|
559
|
-
var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
|
560
|
-
function(v) {
|
561
|
-
return (/^(?!mso)/i.test(v));
|
562
|
-
}
|
563
|
-
);
|
564
|
-
|
565
|
-
return cls.length ? ' class="' + cls.join(" ") + '"' : '';
|
566
|
-
};
|
567
|
-
|
568
|
-
h = h.replace(/ class="([^"]+)"/gi, removeClasses);
|
569
|
-
h = h.replace(/ class=([\-\w]+)/gi, removeClasses);
|
570
|
-
}
|
571
|
-
|
572
|
-
// Remove spans option
|
573
|
-
if (getParam(ed, "paste_remove_spans")) {
|
574
|
-
h = h.replace(/<\/?span[^>]*>/gi, "");
|
575
|
-
}
|
576
|
-
|
577
|
-
//console.log('After preprocess:' + h);
|
578
|
-
|
579
|
-
o.content = h;
|
580
|
-
},
|
581
|
-
|
582
|
-
/**
|
583
|
-
* Various post process items.
|
584
|
-
*/
|
585
|
-
_postProcess : function(pl, o) {
|
586
|
-
var t = this, ed = t.editor, dom = ed.dom, styleProps;
|
587
|
-
|
588
|
-
if (ed.settings.paste_enable_default_filters == false) {
|
589
|
-
return;
|
590
|
-
}
|
591
|
-
|
592
|
-
if (o.wordContent) {
|
593
|
-
// Remove named anchors or TOC links
|
594
|
-
each(dom.select('a', o.node), function(a) {
|
595
|
-
if (!a.href || a.href.indexOf('#_Toc') != -1)
|
596
|
-
dom.remove(a, 1);
|
597
|
-
});
|
598
|
-
|
599
|
-
if (getParam(ed, "paste_convert_middot_lists")) {
|
600
|
-
t._convertLists(pl, o);
|
601
|
-
}
|
602
|
-
|
603
|
-
// Process styles
|
604
|
-
styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties
|
605
|
-
|
606
|
-
// Process only if a string was specified and not equal to "all" or "*"
|
607
|
-
if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {
|
608
|
-
styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));
|
609
|
-
|
610
|
-
// Retains some style properties
|
611
|
-
each(dom.select('*', o.node), function(el) {
|
612
|
-
var newStyle = {}, npc = 0, i, sp, sv;
|
613
|
-
|
614
|
-
// Store a subset of the existing styles
|
615
|
-
if (styleProps) {
|
616
|
-
for (i = 0; i < styleProps.length; i++) {
|
617
|
-
sp = styleProps[i];
|
618
|
-
sv = dom.getStyle(el, sp);
|
619
|
-
|
620
|
-
if (sv) {
|
621
|
-
newStyle[sp] = sv;
|
622
|
-
npc++;
|
623
|
-
}
|
624
|
-
}
|
625
|
-
}
|
626
|
-
|
627
|
-
// Remove all of the existing styles
|
628
|
-
dom.setAttrib(el, 'style', '');
|
629
|
-
|
630
|
-
if (styleProps && npc > 0)
|
631
|
-
dom.setStyles(el, newStyle); // Add back the stored subset of styles
|
632
|
-
else // Remove empty span tags that do not have class attributes
|
633
|
-
if (el.nodeName == 'SPAN' && !el.className)
|
634
|
-
dom.remove(el, true);
|
635
|
-
});
|
636
|
-
}
|
637
|
-
}
|
638
|
-
|
639
|
-
// Remove all style information or only specifically on WebKit to avoid the style bug on that browser
|
640
|
-
if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
|
641
|
-
each(dom.select('*[style]', o.node), function(el) {
|
642
|
-
el.removeAttribute('style');
|
643
|
-
el.removeAttribute('data-mce-style');
|
644
|
-
});
|
645
|
-
} else {
|
646
|
-
if (tinymce.isWebKit) {
|
647
|
-
// We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />
|
648
|
-
// Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
|
649
|
-
each(dom.select('*', o.node), function(el) {
|
650
|
-
el.removeAttribute('data-mce-style');
|
651
|
-
});
|
652
|
-
}
|
653
|
-
}
|
654
|
-
},
|
655
|
-
|
656
|
-
/**
|
657
|
-
* Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
|
658
|
-
*/
|
659
|
-
_convertLists : function(pl, o) {
|
660
|
-
var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
|
661
|
-
|
662
|
-
// Convert middot lists into real semantic lists
|
663
|
-
each(dom.select('p', o.node), function(p) {
|
664
|
-
var sib, val = '', type, html, idx, parents;
|
665
|
-
|
666
|
-
// Get text node value at beginning of paragraph
|
667
|
-
for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
|
668
|
-
val += sib.nodeValue;
|
669
|
-
|
670
|
-
val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0');
|
671
|
-
|
672
|
-
// Detect unordered lists look for bullets
|
673
|
-
if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val))
|
674
|
-
type = 'ul';
|
675
|
-
|
676
|
-
// Detect ordered lists 1., a. or ixv.
|
677
|
-
if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))
|
678
|
-
type = 'ol';
|
679
|
-
|
680
|
-
// Check if node value matches the list pattern: o
|
681
|
-
if (type) {
|
682
|
-
margin = parseFloat(p.style.marginLeft || 0);
|
683
|
-
|
684
|
-
if (margin > lastMargin)
|
685
|
-
levels.push(margin);
|
686
|
-
|
687
|
-
if (!listElm || type != lastType) {
|
688
|
-
listElm = dom.create(type);
|
689
|
-
dom.insertAfter(listElm, p);
|
690
|
-
} else {
|
691
|
-
// Nested list element
|
692
|
-
if (margin > lastMargin) {
|
693
|
-
listElm = li.appendChild(dom.create(type));
|
694
|
-
} else if (margin < lastMargin) {
|
695
|
-
// Find parent level based on margin value
|
696
|
-
idx = tinymce.inArray(levels, margin);
|
697
|
-
parents = dom.getParents(listElm.parentNode, type);
|
698
|
-
listElm = parents[parents.length - 1 - idx] || listElm;
|
699
|
-
}
|
700
|
-
}
|
701
|
-
|
702
|
-
// Remove middot or number spans if they exists
|
703
|
-
each(dom.select('span', p), function(span) {
|
704
|
-
var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
|
705
|
-
|
706
|
-
// Remove span with the middot or the number
|
707
|
-
if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html))
|
708
|
-
dom.remove(span);
|
709
|
-
else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html))
|
710
|
-
dom.remove(span);
|
711
|
-
});
|
712
|
-
|
713
|
-
html = p.innerHTML;
|
714
|
-
|
715
|
-
// Remove middot/list items
|
716
|
-
if (type == 'ul')
|
717
|
-
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, '');
|
718
|
-
else
|
719
|
-
html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');
|
720
|
-
|
721
|
-
// Create li and add paragraph data into the new li
|
722
|
-
li = listElm.appendChild(dom.create('li', 0, html));
|
723
|
-
dom.remove(p);
|
724
|
-
|
725
|
-
lastMargin = margin;
|
726
|
-
lastType = type;
|
727
|
-
} else
|
728
|
-
listElm = lastMargin = 0; // End list element
|
729
|
-
});
|
730
|
-
|
731
|
-
// Remove any left over makers
|
732
|
-
html = o.node.innerHTML;
|
733
|
-
if (html.indexOf('__MCE_ITEM__') != -1)
|
734
|
-
o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
|
735
|
-
},
|
736
|
-
|
737
|
-
/**
|
738
|
-
* Inserts the specified contents at the caret position.
|
739
|
-
*/
|
740
|
-
_insert : function(h, skip_undo) {
|
741
|
-
var ed = this.editor, r = ed.selection.getRng();
|
742
|
-
|
743
|
-
// First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.
|
744
|
-
if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)
|
745
|
-
ed.getDoc().execCommand('Delete', false, null);
|
746
|
-
|
747
|
-
ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});
|
748
|
-
},
|
749
|
-
|
750
|
-
/**
|
751
|
-
* Instead of the old plain text method which tried to re-create a paste operation, the
|
752
|
-
* new approach adds a plain text mode toggle switch that changes the behavior of paste.
|
753
|
-
* This function is passed the same input that the regular paste plugin produces.
|
754
|
-
* It performs additional scrubbing and produces (and inserts) the plain text.
|
755
|
-
* This approach leverages all of the great existing functionality in the paste
|
756
|
-
* plugin, and requires minimal changes to add the new functionality.
|
757
|
-
* Speednet - June 2009
|
758
|
-
*/
|
759
|
-
_insertPlainText : function(content) {
|
760
|
-
var ed = this.editor,
|
761
|
-
linebr = getParam(ed, "paste_text_linebreaktype"),
|
762
|
-
rl = getParam(ed, "paste_text_replacements"),
|
763
|
-
is = tinymce.is;
|
764
|
-
|
765
|
-
function process(items) {
|
766
|
-
each(items, function(v) {
|
767
|
-
if (v.constructor == RegExp)
|
768
|
-
content = content.replace(v, "");
|
769
|
-
else
|
770
|
-
content = content.replace(v[0], v[1]);
|
771
|
-
});
|
772
|
-
};
|
773
|
-
|
774
|
-
if ((typeof(content) === "string") && (content.length > 0)) {
|
775
|
-
// If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
|
776
|
-
if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) {
|
777
|
-
process([
|
778
|
-
/[\n\r]+/g
|
779
|
-
]);
|
780
|
-
} else {
|
781
|
-
// Otherwise just get rid of carriage returns (only need linefeeds)
|
782
|
-
process([
|
783
|
-
/\r+/g
|
784
|
-
]);
|
785
|
-
}
|
786
|
-
|
787
|
-
process([
|
788
|
-
[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them
|
789
|
-
[/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows
|
790
|
-
[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
|
791
|
-
/<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
|
792
|
-
[/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
|
793
|
-
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars.
|
794
|
-
[/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks
|
795
|
-
]);
|
796
|
-
|
797
|
-
content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
|
798
|
-
|
799
|
-
// Perform default or custom replacements
|
800
|
-
if (is(rl, "array")) {
|
801
|
-
process(rl);
|
802
|
-
} else if (is(rl, "string")) {
|
803
|
-
process(new RegExp(rl, "gi"));
|
804
|
-
}
|
805
|
-
|
806
|
-
// Treat paragraphs as specified in the config
|
807
|
-
if (linebr == "none") {
|
808
|
-
// Convert all line breaks to space
|
809
|
-
process([
|
810
|
-
[/\n+/g, " "]
|
811
|
-
]);
|
812
|
-
} else if (linebr == "br") {
|
813
|
-
// Convert all line breaks to <br />
|
814
|
-
process([
|
815
|
-
[/\n/g, "<br />"]
|
816
|
-
]);
|
817
|
-
} else if (linebr == "p") {
|
818
|
-
// Convert all line breaks to <p>...</p>
|
819
|
-
process([
|
820
|
-
[/\n+/g, "</p><p>"],
|
821
|
-
[/^(.*<\/p>)(<p>)$/, '<p>$1']
|
822
|
-
]);
|
823
|
-
} else {
|
824
|
-
// defaults to "combined"
|
825
|
-
// Convert single line breaks to <br /> and double line breaks to <p>...</p>
|
826
|
-
process([
|
827
|
-
[/\n\n/g, "</p><p>"],
|
828
|
-
[/^(.*<\/p>)(<p>)$/, '<p>$1'],
|
829
|
-
[/\n/g, "<br />"]
|
830
|
-
]);
|
831
|
-
}
|
832
|
-
|
833
|
-
ed.execCommand('mceInsertContent', false, content);
|
834
|
-
}
|
835
|
-
},
|
836
|
-
|
837
|
-
/**
|
838
|
-
* This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
|
839
|
-
*/
|
840
|
-
_legacySupport : function() {
|
841
|
-
var t = this, ed = t.editor;
|
842
|
-
|
843
|
-
// Register command(s) for backwards compatibility
|
844
|
-
ed.addCommand("mcePasteWord", function() {
|
845
|
-
ed.windowManager.open({
|
846
|
-
file: t.url + "/pasteword.htm",
|
847
|
-
width: parseInt(getParam(ed, "paste_dialog_width")),
|
848
|
-
height: parseInt(getParam(ed, "paste_dialog_height")),
|
849
|
-
inline: 1
|
850
|
-
});
|
851
|
-
});
|
852
|
-
|
853
|
-
if (getParam(ed, "paste_text_use_dialog")) {
|
854
|
-
ed.addCommand("mcePasteText", function() {
|
855
|
-
ed.windowManager.open({
|
856
|
-
file : t.url + "/pastetext.htm",
|
857
|
-
width: parseInt(getParam(ed, "paste_dialog_width")),
|
858
|
-
height: parseInt(getParam(ed, "paste_dialog_height")),
|
859
|
-
inline : 1
|
860
|
-
});
|
861
|
-
});
|
862
|
-
}
|
863
|
-
|
864
|
-
// Register button for backwards compatibility
|
865
|
-
ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});
|
866
|
-
}
|
867
|
-
});
|
868
|
-
|
869
|
-
// Register plugin
|
870
|
-
tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);
|
871
|
-
})();
|