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,70 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editable_selects.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
|
-
var TinyMCE_EditableSelects = {
|
12
|
-
editSelectElm : null,
|
13
|
-
|
14
|
-
init : function() {
|
15
|
-
var nl = document.getElementsByTagName("select"), i, d = document, o;
|
16
|
-
|
17
|
-
for (i=0; i<nl.length; i++) {
|
18
|
-
if (nl[i].className.indexOf('mceEditableSelect') != -1) {
|
19
|
-
o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
|
20
|
-
|
21
|
-
o.className = 'mceAddSelectValue';
|
22
|
-
|
23
|
-
nl[i].options[nl[i].options.length] = o;
|
24
|
-
nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
},
|
28
|
-
|
29
|
-
onChangeEditableSelect : function(e) {
|
30
|
-
var d = document, ne, se = window.event ? window.event.srcElement : e.target;
|
31
|
-
|
32
|
-
if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
|
33
|
-
ne = d.createElement("input");
|
34
|
-
ne.id = se.id + "_custom";
|
35
|
-
ne.name = se.name + "_custom";
|
36
|
-
ne.type = "text";
|
37
|
-
|
38
|
-
ne.style.width = se.offsetWidth + 'px';
|
39
|
-
se.parentNode.insertBefore(ne, se);
|
40
|
-
se.style.display = 'none';
|
41
|
-
ne.focus();
|
42
|
-
ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
|
43
|
-
ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
|
44
|
-
TinyMCE_EditableSelects.editSelectElm = se;
|
45
|
-
}
|
46
|
-
},
|
47
|
-
|
48
|
-
onBlurEditableSelectInput : function() {
|
49
|
-
var se = TinyMCE_EditableSelects.editSelectElm;
|
50
|
-
|
51
|
-
if (se) {
|
52
|
-
if (se.previousSibling.value != '') {
|
53
|
-
addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
|
54
|
-
selectByValue(document.forms[0], se.id, se.previousSibling.value);
|
55
|
-
} else
|
56
|
-
selectByValue(document.forms[0], se.id, '');
|
57
|
-
|
58
|
-
se.style.display = 'inline';
|
59
|
-
se.parentNode.removeChild(se.previousSibling);
|
60
|
-
TinyMCE_EditableSelects.editSelectElm = null;
|
61
|
-
}
|
62
|
-
},
|
63
|
-
|
64
|
-
onKeyDown : function(e) {
|
65
|
-
e = e || window.event;
|
66
|
-
|
67
|
-
if (e.keyCode == 13)
|
68
|
-
TinyMCE_EditableSelects.onBlurEditableSelectInput();
|
69
|
-
}
|
70
|
-
};
|
@@ -1,210 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* form_utils.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
|
-
var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
|
12
|
-
|
13
|
-
function getColorPickerHTML(id, target_form_element) {
|
14
|
-
var h = "", dom = tinyMCEPopup.dom;
|
15
|
-
|
16
|
-
if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
|
17
|
-
label.id = label.id || dom.uniqueId();
|
18
|
-
}
|
19
|
-
|
20
|
-
h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
|
21
|
-
h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> <span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
|
22
|
-
|
23
|
-
return h;
|
24
|
-
}
|
25
|
-
|
26
|
-
function updateColor(img_id, form_element_id) {
|
27
|
-
document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
|
28
|
-
}
|
29
|
-
|
30
|
-
function setBrowserDisabled(id, state) {
|
31
|
-
var img = document.getElementById(id);
|
32
|
-
var lnk = document.getElementById(id + "_link");
|
33
|
-
|
34
|
-
if (lnk) {
|
35
|
-
if (state) {
|
36
|
-
lnk.setAttribute("realhref", lnk.getAttribute("href"));
|
37
|
-
lnk.removeAttribute("href");
|
38
|
-
tinyMCEPopup.dom.addClass(img, 'disabled');
|
39
|
-
} else {
|
40
|
-
if (lnk.getAttribute("realhref"))
|
41
|
-
lnk.setAttribute("href", lnk.getAttribute("realhref"));
|
42
|
-
|
43
|
-
tinyMCEPopup.dom.removeClass(img, 'disabled');
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
function getBrowserHTML(id, target_form_element, type, prefix) {
|
49
|
-
var option = prefix + "_" + type + "_browser_callback", cb, html;
|
50
|
-
|
51
|
-
cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
|
52
|
-
|
53
|
-
if (!cb)
|
54
|
-
return "";
|
55
|
-
|
56
|
-
html = "";
|
57
|
-
html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
|
58
|
-
html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> </span></a>';
|
59
|
-
|
60
|
-
return html;
|
61
|
-
}
|
62
|
-
|
63
|
-
function openBrowser(img_id, target_form_element, type, option) {
|
64
|
-
var img = document.getElementById(img_id);
|
65
|
-
|
66
|
-
if (img.className != "mceButtonDisabled")
|
67
|
-
tinyMCEPopup.openBrowser(target_form_element, type, option);
|
68
|
-
}
|
69
|
-
|
70
|
-
function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
|
71
|
-
if (!form_obj || !form_obj.elements[field_name])
|
72
|
-
return;
|
73
|
-
|
74
|
-
if (!value)
|
75
|
-
value = "";
|
76
|
-
|
77
|
-
var sel = form_obj.elements[field_name];
|
78
|
-
|
79
|
-
var found = false;
|
80
|
-
for (var i=0; i<sel.options.length; i++) {
|
81
|
-
var option = sel.options[i];
|
82
|
-
|
83
|
-
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
|
84
|
-
option.selected = true;
|
85
|
-
found = true;
|
86
|
-
} else
|
87
|
-
option.selected = false;
|
88
|
-
}
|
89
|
-
|
90
|
-
if (!found && add_custom && value != '') {
|
91
|
-
var option = new Option(value, value);
|
92
|
-
option.selected = true;
|
93
|
-
sel.options[sel.options.length] = option;
|
94
|
-
sel.selectedIndex = sel.options.length - 1;
|
95
|
-
}
|
96
|
-
|
97
|
-
return found;
|
98
|
-
}
|
99
|
-
|
100
|
-
function getSelectValue(form_obj, field_name) {
|
101
|
-
var elm = form_obj.elements[field_name];
|
102
|
-
|
103
|
-
if (elm == null || elm.options == null || elm.selectedIndex === -1)
|
104
|
-
return "";
|
105
|
-
|
106
|
-
return elm.options[elm.selectedIndex].value;
|
107
|
-
}
|
108
|
-
|
109
|
-
function addSelectValue(form_obj, field_name, name, value) {
|
110
|
-
var s = form_obj.elements[field_name];
|
111
|
-
var o = new Option(name, value);
|
112
|
-
s.options[s.options.length] = o;
|
113
|
-
}
|
114
|
-
|
115
|
-
function addClassesToList(list_id, specific_option) {
|
116
|
-
// Setup class droplist
|
117
|
-
var styleSelectElm = document.getElementById(list_id);
|
118
|
-
var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
|
119
|
-
styles = tinyMCEPopup.getParam(specific_option, styles);
|
120
|
-
|
121
|
-
if (styles) {
|
122
|
-
var stylesAr = styles.split(';');
|
123
|
-
|
124
|
-
for (var i=0; i<stylesAr.length; i++) {
|
125
|
-
if (stylesAr != "") {
|
126
|
-
var key, value;
|
127
|
-
|
128
|
-
key = stylesAr[i].split('=')[0];
|
129
|
-
value = stylesAr[i].split('=')[1];
|
130
|
-
|
131
|
-
styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
|
132
|
-
}
|
133
|
-
}
|
134
|
-
} else {
|
135
|
-
tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
|
136
|
-
styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
|
137
|
-
});
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
function isVisible(element_id) {
|
142
|
-
var elm = document.getElementById(element_id);
|
143
|
-
|
144
|
-
return elm && elm.style.display != "none";
|
145
|
-
}
|
146
|
-
|
147
|
-
function convertRGBToHex(col) {
|
148
|
-
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
149
|
-
|
150
|
-
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
151
|
-
if (rgb.length == 3) {
|
152
|
-
r = parseInt(rgb[0]).toString(16);
|
153
|
-
g = parseInt(rgb[1]).toString(16);
|
154
|
-
b = parseInt(rgb[2]).toString(16);
|
155
|
-
|
156
|
-
r = r.length == 1 ? '0' + r : r;
|
157
|
-
g = g.length == 1 ? '0' + g : g;
|
158
|
-
b = b.length == 1 ? '0' + b : b;
|
159
|
-
|
160
|
-
return "#" + r + g + b;
|
161
|
-
}
|
162
|
-
|
163
|
-
return col;
|
164
|
-
}
|
165
|
-
|
166
|
-
function convertHexToRGB(col) {
|
167
|
-
if (col.indexOf('#') != -1) {
|
168
|
-
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
169
|
-
|
170
|
-
r = parseInt(col.substring(0, 2), 16);
|
171
|
-
g = parseInt(col.substring(2, 4), 16);
|
172
|
-
b = parseInt(col.substring(4, 6), 16);
|
173
|
-
|
174
|
-
return "rgb(" + r + "," + g + "," + b + ")";
|
175
|
-
}
|
176
|
-
|
177
|
-
return col;
|
178
|
-
}
|
179
|
-
|
180
|
-
function trimSize(size) {
|
181
|
-
return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
|
182
|
-
}
|
183
|
-
|
184
|
-
function getCSSSize(size) {
|
185
|
-
size = trimSize(size);
|
186
|
-
|
187
|
-
if (size == "")
|
188
|
-
return "";
|
189
|
-
|
190
|
-
// Add px
|
191
|
-
if (/^[0-9]+$/.test(size))
|
192
|
-
size += 'px';
|
193
|
-
// Sanity check, IE doesn't like broken values
|
194
|
-
else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
|
195
|
-
return "";
|
196
|
-
|
197
|
-
return size;
|
198
|
-
}
|
199
|
-
|
200
|
-
function getStyle(elm, attrib, style) {
|
201
|
-
var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
|
202
|
-
|
203
|
-
if (val != '')
|
204
|
-
return '' + val;
|
205
|
-
|
206
|
-
if (typeof(style) == 'undefined')
|
207
|
-
style = attrib;
|
208
|
-
|
209
|
-
return tinyMCEPopup.dom.getStyle(elm, style);
|
210
|
-
}
|
@@ -1,162 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* mctabs.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 MCTabs() {
|
12
|
-
this.settings = [];
|
13
|
-
this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
|
14
|
-
};
|
15
|
-
|
16
|
-
MCTabs.prototype.init = function(settings) {
|
17
|
-
this.settings = settings;
|
18
|
-
};
|
19
|
-
|
20
|
-
MCTabs.prototype.getParam = function(name, default_value) {
|
21
|
-
var value = null;
|
22
|
-
|
23
|
-
value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
|
24
|
-
|
25
|
-
// Fix bool values
|
26
|
-
if (value == "true" || value == "false")
|
27
|
-
return (value == "true");
|
28
|
-
|
29
|
-
return value;
|
30
|
-
};
|
31
|
-
|
32
|
-
MCTabs.prototype.showTab =function(tab){
|
33
|
-
tab.className = 'current';
|
34
|
-
tab.setAttribute("aria-selected", true);
|
35
|
-
tab.setAttribute("aria-expanded", true);
|
36
|
-
tab.tabIndex = 0;
|
37
|
-
};
|
38
|
-
|
39
|
-
MCTabs.prototype.hideTab =function(tab){
|
40
|
-
var t=this;
|
41
|
-
|
42
|
-
tab.className = '';
|
43
|
-
tab.setAttribute("aria-selected", false);
|
44
|
-
tab.setAttribute("aria-expanded", false);
|
45
|
-
tab.tabIndex = -1;
|
46
|
-
};
|
47
|
-
|
48
|
-
MCTabs.prototype.showPanel = function(panel) {
|
49
|
-
panel.className = 'current';
|
50
|
-
panel.setAttribute("aria-hidden", false);
|
51
|
-
};
|
52
|
-
|
53
|
-
MCTabs.prototype.hidePanel = function(panel) {
|
54
|
-
panel.className = 'panel';
|
55
|
-
panel.setAttribute("aria-hidden", true);
|
56
|
-
};
|
57
|
-
|
58
|
-
MCTabs.prototype.getPanelForTab = function(tabElm) {
|
59
|
-
return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
|
60
|
-
};
|
61
|
-
|
62
|
-
MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
|
63
|
-
var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
|
64
|
-
|
65
|
-
tabElm = document.getElementById(tab_id);
|
66
|
-
|
67
|
-
if (panel_id === undefined) {
|
68
|
-
panel_id = t.getPanelForTab(tabElm);
|
69
|
-
}
|
70
|
-
|
71
|
-
panelElm= document.getElementById(panel_id);
|
72
|
-
panelContainerElm = panelElm ? panelElm.parentNode : null;
|
73
|
-
tabContainerElm = tabElm ? tabElm.parentNode : null;
|
74
|
-
selectionClass = t.getParam('selection_class', 'current');
|
75
|
-
|
76
|
-
if (tabElm && tabContainerElm) {
|
77
|
-
nodes = tabContainerElm.childNodes;
|
78
|
-
|
79
|
-
// Hide all other tabs
|
80
|
-
for (i = 0; i < nodes.length; i++) {
|
81
|
-
if (nodes[i].nodeName == "LI") {
|
82
|
-
t.hideTab(nodes[i]);
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
// Show selected tab
|
87
|
-
t.showTab(tabElm);
|
88
|
-
}
|
89
|
-
|
90
|
-
if (panelElm && panelContainerElm) {
|
91
|
-
nodes = panelContainerElm.childNodes;
|
92
|
-
|
93
|
-
// Hide all other panels
|
94
|
-
for (i = 0; i < nodes.length; i++) {
|
95
|
-
if (nodes[i].nodeName == "DIV")
|
96
|
-
t.hidePanel(nodes[i]);
|
97
|
-
}
|
98
|
-
|
99
|
-
if (!avoid_focus) {
|
100
|
-
tabElm.focus();
|
101
|
-
}
|
102
|
-
|
103
|
-
// Show selected panel
|
104
|
-
t.showPanel(panelElm);
|
105
|
-
}
|
106
|
-
};
|
107
|
-
|
108
|
-
MCTabs.prototype.getAnchor = function() {
|
109
|
-
var pos, url = document.location.href;
|
110
|
-
|
111
|
-
if ((pos = url.lastIndexOf('#')) != -1)
|
112
|
-
return url.substring(pos + 1);
|
113
|
-
|
114
|
-
return "";
|
115
|
-
};
|
116
|
-
|
117
|
-
|
118
|
-
//Global instance
|
119
|
-
var mcTabs = new MCTabs();
|
120
|
-
|
121
|
-
tinyMCEPopup.onInit.add(function() {
|
122
|
-
var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
|
123
|
-
|
124
|
-
each(dom.select('div.tabs'), function(tabContainerElm) {
|
125
|
-
var keyNav;
|
126
|
-
|
127
|
-
dom.setAttrib(tabContainerElm, "role", "tablist");
|
128
|
-
|
129
|
-
var items = tinyMCEPopup.dom.select('li', tabContainerElm);
|
130
|
-
var action = function(id) {
|
131
|
-
mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
|
132
|
-
mcTabs.onChange.dispatch(id);
|
133
|
-
};
|
134
|
-
|
135
|
-
each(items, function(item) {
|
136
|
-
dom.setAttrib(item, 'role', 'tab');
|
137
|
-
dom.bind(item, 'click', function(evt) {
|
138
|
-
action(item.id);
|
139
|
-
});
|
140
|
-
});
|
141
|
-
|
142
|
-
dom.bind(dom.getRoot(), 'keydown', function(evt) {
|
143
|
-
if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
|
144
|
-
keyNav.moveFocus(evt.shiftKey ? -1 : 1);
|
145
|
-
tinymce.dom.Event.cancel(evt);
|
146
|
-
}
|
147
|
-
});
|
148
|
-
|
149
|
-
each(dom.select('a', tabContainerElm), function(a) {
|
150
|
-
dom.setAttrib(a, 'tabindex', '-1');
|
151
|
-
});
|
152
|
-
|
153
|
-
keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
154
|
-
root: tabContainerElm,
|
155
|
-
items: items,
|
156
|
-
onAction: action,
|
157
|
-
actOnFocus: true,
|
158
|
-
enableLeftRight: true,
|
159
|
-
enableUpDown: true
|
160
|
-
}, tinyMCEPopup.dom);
|
161
|
-
});
|
162
|
-
});
|
@@ -1,252 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* validate.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
|
-
/**
|
12
|
-
// String validation:
|
13
|
-
|
14
|
-
if (!Validator.isEmail('myemail'))
|
15
|
-
alert('Invalid email.');
|
16
|
-
|
17
|
-
// Form validation:
|
18
|
-
|
19
|
-
var f = document.forms['myform'];
|
20
|
-
|
21
|
-
if (!Validator.isEmail(f.myemail))
|
22
|
-
alert('Invalid email.');
|
23
|
-
*/
|
24
|
-
|
25
|
-
var Validator = {
|
26
|
-
isEmail : function(s) {
|
27
|
-
return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
|
28
|
-
},
|
29
|
-
|
30
|
-
isAbsUrl : function(s) {
|
31
|
-
return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
|
32
|
-
},
|
33
|
-
|
34
|
-
isSize : function(s) {
|
35
|
-
return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
|
36
|
-
},
|
37
|
-
|
38
|
-
isId : function(s) {
|
39
|
-
return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
|
40
|
-
},
|
41
|
-
|
42
|
-
isEmpty : function(s) {
|
43
|
-
var nl, i;
|
44
|
-
|
45
|
-
if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
|
46
|
-
return true;
|
47
|
-
|
48
|
-
if (s.type == 'checkbox' && !s.checked)
|
49
|
-
return true;
|
50
|
-
|
51
|
-
if (s.type == 'radio') {
|
52
|
-
for (i=0, nl = s.form.elements; i<nl.length; i++) {
|
53
|
-
if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
|
54
|
-
return false;
|
55
|
-
}
|
56
|
-
|
57
|
-
return true;
|
58
|
-
}
|
59
|
-
|
60
|
-
return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
|
61
|
-
},
|
62
|
-
|
63
|
-
isNumber : function(s, d) {
|
64
|
-
return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
|
65
|
-
},
|
66
|
-
|
67
|
-
test : function(s, p) {
|
68
|
-
s = s.nodeType == 1 ? s.value : s;
|
69
|
-
|
70
|
-
return s == '' || new RegExp(p).test(s);
|
71
|
-
}
|
72
|
-
};
|
73
|
-
|
74
|
-
var AutoValidator = {
|
75
|
-
settings : {
|
76
|
-
id_cls : 'id',
|
77
|
-
int_cls : 'int',
|
78
|
-
url_cls : 'url',
|
79
|
-
number_cls : 'number',
|
80
|
-
email_cls : 'email',
|
81
|
-
size_cls : 'size',
|
82
|
-
required_cls : 'required',
|
83
|
-
invalid_cls : 'invalid',
|
84
|
-
min_cls : 'min',
|
85
|
-
max_cls : 'max'
|
86
|
-
},
|
87
|
-
|
88
|
-
init : function(s) {
|
89
|
-
var n;
|
90
|
-
|
91
|
-
for (n in s)
|
92
|
-
this.settings[n] = s[n];
|
93
|
-
},
|
94
|
-
|
95
|
-
validate : function(f) {
|
96
|
-
var i, nl, s = this.settings, c = 0;
|
97
|
-
|
98
|
-
nl = this.tags(f, 'label');
|
99
|
-
for (i=0; i<nl.length; i++) {
|
100
|
-
this.removeClass(nl[i], s.invalid_cls);
|
101
|
-
nl[i].setAttribute('aria-invalid', false);
|
102
|
-
}
|
103
|
-
|
104
|
-
c += this.validateElms(f, 'input');
|
105
|
-
c += this.validateElms(f, 'select');
|
106
|
-
c += this.validateElms(f, 'textarea');
|
107
|
-
|
108
|
-
return c == 3;
|
109
|
-
},
|
110
|
-
|
111
|
-
invalidate : function(n) {
|
112
|
-
this.mark(n.form, n);
|
113
|
-
},
|
114
|
-
|
115
|
-
getErrorMessages : function(f) {
|
116
|
-
var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
|
117
|
-
nl = this.tags(f, "label");
|
118
|
-
for (i=0; i<nl.length; i++) {
|
119
|
-
if (this.hasClass(nl[i], s.invalid_cls)) {
|
120
|
-
field = document.getElementById(nl[i].getAttribute("for"));
|
121
|
-
values = { field: nl[i].textContent };
|
122
|
-
if (this.hasClass(field, s.min_cls, true)) {
|
123
|
-
message = ed.getLang('invalid_data_min');
|
124
|
-
values.min = this.getNum(field, s.min_cls);
|
125
|
-
} else if (this.hasClass(field, s.number_cls)) {
|
126
|
-
message = ed.getLang('invalid_data_number');
|
127
|
-
} else if (this.hasClass(field, s.size_cls)) {
|
128
|
-
message = ed.getLang('invalid_data_size');
|
129
|
-
} else {
|
130
|
-
message = ed.getLang('invalid_data');
|
131
|
-
}
|
132
|
-
|
133
|
-
message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
|
134
|
-
return values[b] || '{#' + b + '}';
|
135
|
-
});
|
136
|
-
messages.push(message);
|
137
|
-
}
|
138
|
-
}
|
139
|
-
return messages;
|
140
|
-
},
|
141
|
-
|
142
|
-
reset : function(e) {
|
143
|
-
var t = ['label', 'input', 'select', 'textarea'];
|
144
|
-
var i, j, nl, s = this.settings;
|
145
|
-
|
146
|
-
if (e == null)
|
147
|
-
return;
|
148
|
-
|
149
|
-
for (i=0; i<t.length; i++) {
|
150
|
-
nl = this.tags(e.form ? e.form : e, t[i]);
|
151
|
-
for (j=0; j<nl.length; j++) {
|
152
|
-
this.removeClass(nl[j], s.invalid_cls);
|
153
|
-
nl[j].setAttribute('aria-invalid', false);
|
154
|
-
}
|
155
|
-
}
|
156
|
-
},
|
157
|
-
|
158
|
-
validateElms : function(f, e) {
|
159
|
-
var nl, i, n, s = this.settings, st = true, va = Validator, v;
|
160
|
-
|
161
|
-
nl = this.tags(f, e);
|
162
|
-
for (i=0; i<nl.length; i++) {
|
163
|
-
n = nl[i];
|
164
|
-
|
165
|
-
this.removeClass(n, s.invalid_cls);
|
166
|
-
|
167
|
-
if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
|
168
|
-
st = this.mark(f, n);
|
169
|
-
|
170
|
-
if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
|
171
|
-
st = this.mark(f, n);
|
172
|
-
|
173
|
-
if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
|
174
|
-
st = this.mark(f, n);
|
175
|
-
|
176
|
-
if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
|
177
|
-
st = this.mark(f, n);
|
178
|
-
|
179
|
-
if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
|
180
|
-
st = this.mark(f, n);
|
181
|
-
|
182
|
-
if (this.hasClass(n, s.size_cls) && !va.isSize(n))
|
183
|
-
st = this.mark(f, n);
|
184
|
-
|
185
|
-
if (this.hasClass(n, s.id_cls) && !va.isId(n))
|
186
|
-
st = this.mark(f, n);
|
187
|
-
|
188
|
-
if (this.hasClass(n, s.min_cls, true)) {
|
189
|
-
v = this.getNum(n, s.min_cls);
|
190
|
-
|
191
|
-
if (isNaN(v) || parseInt(n.value) < parseInt(v))
|
192
|
-
st = this.mark(f, n);
|
193
|
-
}
|
194
|
-
|
195
|
-
if (this.hasClass(n, s.max_cls, true)) {
|
196
|
-
v = this.getNum(n, s.max_cls);
|
197
|
-
|
198
|
-
if (isNaN(v) || parseInt(n.value) > parseInt(v))
|
199
|
-
st = this.mark(f, n);
|
200
|
-
}
|
201
|
-
}
|
202
|
-
|
203
|
-
return st;
|
204
|
-
},
|
205
|
-
|
206
|
-
hasClass : function(n, c, d) {
|
207
|
-
return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
|
208
|
-
},
|
209
|
-
|
210
|
-
getNum : function(n, c) {
|
211
|
-
c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
|
212
|
-
c = c.replace(/[^0-9]/g, '');
|
213
|
-
|
214
|
-
return c;
|
215
|
-
},
|
216
|
-
|
217
|
-
addClass : function(n, c, b) {
|
218
|
-
var o = this.removeClass(n, c);
|
219
|
-
n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
|
220
|
-
},
|
221
|
-
|
222
|
-
removeClass : function(n, c) {
|
223
|
-
c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
|
224
|
-
return n.className = c != ' ' ? c : '';
|
225
|
-
},
|
226
|
-
|
227
|
-
tags : function(f, s) {
|
228
|
-
return f.getElementsByTagName(s);
|
229
|
-
},
|
230
|
-
|
231
|
-
mark : function(f, n) {
|
232
|
-
var s = this.settings;
|
233
|
-
|
234
|
-
this.addClass(n, s.invalid_cls);
|
235
|
-
n.setAttribute('aria-invalid', 'true');
|
236
|
-
this.markLabels(f, n, s.invalid_cls);
|
237
|
-
|
238
|
-
return false;
|
239
|
-
},
|
240
|
-
|
241
|
-
markLabels : function(f, n, ic) {
|
242
|
-
var nl, i;
|
243
|
-
|
244
|
-
nl = this.tags(f, "label");
|
245
|
-
for (i=0; i<nl.length; i++) {
|
246
|
-
if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
|
247
|
-
this.addClass(nl[i], ic);
|
248
|
-
}
|
249
|
-
|
250
|
-
return null;
|
251
|
-
}
|
252
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module Concerns
|
2
|
-
module SpudAuthentication
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
included do
|
5
|
-
acts_as_authentic do |c|
|
6
|
-
# c.my_config_option = my_value # for available options see documentation in: Authlogic::ActsAsAuthentic
|
7
|
-
end # block optional
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|