tinymce_rails 3.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +14 -0
- data/Rakefile +1 -0
- data/lib/tinymce_rails.rb +11 -0
- data/lib/tinymce_rails/version.rb +3 -0
- data/tinymce_rails.gemspec +24 -0
- data/vendor/assets/javascripts/tiny_mce/jquery.tinymce.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/langs/en.js +218 -0
- data/vendor/assets/javascripts/tiny_mce/license.txt +504 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +7 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advhr/rule.htm +58 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/image.htm +235 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/js/image.js +445 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +45 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlink/js/advlink.js +528 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +54 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlink/link.htm +338 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/advlist/editor_plugin_src.js +154 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autolink/editor_plugin_src.js +156 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +422 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/autosave/langs/en.js +4 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +156 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/emotions.htm +41 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/dialog.htm +22 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/js/dialog.js +19 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/langs/en.js +3 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +182 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +571 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +471 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +151 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +696 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +100 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +212 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +136 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/lists/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/lists/editor_plugin_src.js +617 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/css/content.css +6 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/css/media.css +16 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +414 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/flash.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/flv_player.swf +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/quicktime.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/realmedia.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/shockwave.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/trans.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/js/embed.js +73 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/js/media.js +630 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +103 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/media/media.htm +818 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +90 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/pagebreak/css/content.css +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +77 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +1035 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/pastetext.htm +27 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/paste/pasteword.htm +21 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/preview/example.html +28 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/preview/preview.html +17 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +57 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +140 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +100 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +417 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/style/css/props.css +13 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/style/js/props.js +641 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +70 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/style/props.htm +838 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +114 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/cell.htm +178 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/css/cell.css +17 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/css/row.css +25 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/css/table.css +13 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +1139 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/js/cell.js +286 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/js/row.js +237 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/js/table.js +454 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/merge_cells.htm +32 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/row.htm +157 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/table/table.htm +188 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/blank.htm +12 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/css/template.css +23 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/js/template.js +106 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/template/template.htm +31 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +83 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +98 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +126 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +231 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +52 -0
- data/vendor/assets/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/about.htm +48 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/anchor.htm +26 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/color_picker.htm +74 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1326 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/image.htm +80 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/about.js +73 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/anchor.js +37 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/charmap.js +353 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/color_picker.js +329 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/image.js +247 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/link.js +156 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/source_editor.js +56 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/langs/en.js +68 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +53 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/link.htm +58 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/shortcuts.htm +47 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/content.css +37 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +213 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/content.css +23 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css +101 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +36 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +116 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
- data/vendor/assets/javascripts/tiny_mce/themes/advanced/source_editor.htm +25 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/editor_template.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/editor_template_src.js +85 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/langs/en.js +11 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/vendor/assets/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
- data/vendor/assets/javascripts/tiny_mce/tiny_mce.js +1 -0
- data/vendor/assets/javascripts/tiny_mce/tiny_mce_popup.js +5 -0
- data/vendor/assets/javascripts/tiny_mce/tiny_mce_src.js +13913 -0
- data/vendor/assets/javascripts/tiny_mce/utils/editable_selects.js +70 -0
- data/vendor/assets/javascripts/tiny_mce/utils/form_utils.js +206 -0
- data/vendor/assets/javascripts/tiny_mce/utils/mctabs.js +151 -0
- data/vendor/assets/javascripts/tiny_mce/utils/validate.js +252 -0
- metadata +305 -0
@@ -0,0 +1 @@
|
|
1
|
+
(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* editor_plugin_src.js
|
3
|
+
*
|
4
|
+
* Copyright 2009, Moxiecode Systems AB
|
5
|
+
* Released under LGPL License.
|
6
|
+
*
|
7
|
+
* License: http://tinymce.moxiecode.com/license
|
8
|
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function() {
|
12
|
+
tinymce.create('tinymce.plugins.InsertDateTime', {
|
13
|
+
init : function(ed, url) {
|
14
|
+
var t = this;
|
15
|
+
|
16
|
+
t.editor = ed;
|
17
|
+
|
18
|
+
ed.addCommand('mceInsertDate', function() {
|
19
|
+
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
|
20
|
+
|
21
|
+
ed.execCommand('mceInsertContent', false, str);
|
22
|
+
});
|
23
|
+
|
24
|
+
ed.addCommand('mceInsertTime', function() {
|
25
|
+
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
|
26
|
+
|
27
|
+
ed.execCommand('mceInsertContent', false, str);
|
28
|
+
});
|
29
|
+
|
30
|
+
ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
|
31
|
+
ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
|
32
|
+
},
|
33
|
+
|
34
|
+
getInfo : function() {
|
35
|
+
return {
|
36
|
+
longname : 'Insert date/time',
|
37
|
+
author : 'Moxiecode Systems AB',
|
38
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
39
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
|
40
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
41
|
+
};
|
42
|
+
},
|
43
|
+
|
44
|
+
// Private methods
|
45
|
+
|
46
|
+
_getDateTime : function(d, fmt) {
|
47
|
+
var ed = this.editor;
|
48
|
+
|
49
|
+
function addZeros(value, len) {
|
50
|
+
value = "" + value;
|
51
|
+
|
52
|
+
if (value.length < len) {
|
53
|
+
for (var i=0; i<(len-value.length); i++)
|
54
|
+
value = "0" + value;
|
55
|
+
}
|
56
|
+
|
57
|
+
return value;
|
58
|
+
};
|
59
|
+
|
60
|
+
fmt = fmt.replace("%D", "%m/%d/%y");
|
61
|
+
fmt = fmt.replace("%r", "%I:%M:%S %p");
|
62
|
+
fmt = fmt.replace("%Y", "" + d.getFullYear());
|
63
|
+
fmt = fmt.replace("%y", "" + d.getYear());
|
64
|
+
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
|
65
|
+
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
|
66
|
+
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
|
67
|
+
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
|
68
|
+
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
|
69
|
+
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
|
70
|
+
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
|
71
|
+
fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
|
72
|
+
fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
|
73
|
+
fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
|
74
|
+
fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
|
75
|
+
fmt = fmt.replace("%%", "%");
|
76
|
+
|
77
|
+
return fmt;
|
78
|
+
}
|
79
|
+
});
|
80
|
+
|
81
|
+
// Register plugin
|
82
|
+
tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
|
83
|
+
})();
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
|
@@ -0,0 +1,212 @@
|
|
1
|
+
/**
|
2
|
+
* editor_plugin_src.js
|
3
|
+
*
|
4
|
+
* Copyright 2009, Moxiecode Systems AB
|
5
|
+
* Released under LGPL License.
|
6
|
+
*
|
7
|
+
* License: http://tinymce.moxiecode.com/license
|
8
|
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function() {
|
12
|
+
tinymce.create('tinymce.plugins.Layer', {
|
13
|
+
init : function(ed, url) {
|
14
|
+
var t = this;
|
15
|
+
|
16
|
+
t.editor = ed;
|
17
|
+
|
18
|
+
// Register commands
|
19
|
+
ed.addCommand('mceInsertLayer', t._insertLayer, t);
|
20
|
+
|
21
|
+
ed.addCommand('mceMoveForward', function() {
|
22
|
+
t._move(1);
|
23
|
+
});
|
24
|
+
|
25
|
+
ed.addCommand('mceMoveBackward', function() {
|
26
|
+
t._move(-1);
|
27
|
+
});
|
28
|
+
|
29
|
+
ed.addCommand('mceMakeAbsolute', function() {
|
30
|
+
t._toggleAbsolute();
|
31
|
+
});
|
32
|
+
|
33
|
+
// Register buttons
|
34
|
+
ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
|
35
|
+
ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
|
36
|
+
ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
|
37
|
+
ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
|
38
|
+
|
39
|
+
ed.onInit.add(function() {
|
40
|
+
if (tinymce.isIE)
|
41
|
+
ed.getDoc().execCommand('2D-Position', false, true);
|
42
|
+
});
|
43
|
+
|
44
|
+
ed.onNodeChange.add(t._nodeChange, t);
|
45
|
+
ed.onVisualAid.add(t._visualAid, t);
|
46
|
+
},
|
47
|
+
|
48
|
+
getInfo : function() {
|
49
|
+
return {
|
50
|
+
longname : 'Layer',
|
51
|
+
author : 'Moxiecode Systems AB',
|
52
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
53
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
|
54
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
55
|
+
};
|
56
|
+
},
|
57
|
+
|
58
|
+
// Private methods
|
59
|
+
|
60
|
+
_nodeChange : function(ed, cm, n) {
|
61
|
+
var le, p;
|
62
|
+
|
63
|
+
le = this._getParentLayer(n);
|
64
|
+
p = ed.dom.getParent(n, 'DIV,P,IMG');
|
65
|
+
|
66
|
+
if (!p) {
|
67
|
+
cm.setDisabled('absolute', 1);
|
68
|
+
cm.setDisabled('moveforward', 1);
|
69
|
+
cm.setDisabled('movebackward', 1);
|
70
|
+
} else {
|
71
|
+
cm.setDisabled('absolute', 0);
|
72
|
+
cm.setDisabled('moveforward', !le);
|
73
|
+
cm.setDisabled('movebackward', !le);
|
74
|
+
cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
|
75
|
+
}
|
76
|
+
},
|
77
|
+
|
78
|
+
// Private methods
|
79
|
+
|
80
|
+
_visualAid : function(ed, e, s) {
|
81
|
+
var dom = ed.dom;
|
82
|
+
|
83
|
+
tinymce.each(dom.select('div,p', e), function(e) {
|
84
|
+
if (/^(absolute|relative|static)$/i.test(e.style.position)) {
|
85
|
+
if (s)
|
86
|
+
dom.addClass(e, 'mceItemVisualAid');
|
87
|
+
else
|
88
|
+
dom.removeClass(e, 'mceItemVisualAid');
|
89
|
+
}
|
90
|
+
});
|
91
|
+
},
|
92
|
+
|
93
|
+
_move : function(d) {
|
94
|
+
var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
|
95
|
+
|
96
|
+
nl = [];
|
97
|
+
tinymce.walk(ed.getBody(), function(n) {
|
98
|
+
if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
|
99
|
+
nl.push(n);
|
100
|
+
}, 'childNodes');
|
101
|
+
|
102
|
+
// Find z-indexes
|
103
|
+
for (i=0; i<nl.length; i++) {
|
104
|
+
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
|
105
|
+
|
106
|
+
if (ci < 0 && nl[i] == le)
|
107
|
+
ci = i;
|
108
|
+
}
|
109
|
+
|
110
|
+
if (d < 0) {
|
111
|
+
// Move back
|
112
|
+
|
113
|
+
// Try find a lower one
|
114
|
+
for (i=0; i<z.length; i++) {
|
115
|
+
if (z[i] < z[ci]) {
|
116
|
+
fi = i;
|
117
|
+
break;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
if (fi > -1) {
|
122
|
+
nl[ci].style.zIndex = z[fi];
|
123
|
+
nl[fi].style.zIndex = z[ci];
|
124
|
+
} else {
|
125
|
+
if (z[ci] > 0)
|
126
|
+
nl[ci].style.zIndex = z[ci] - 1;
|
127
|
+
}
|
128
|
+
} else {
|
129
|
+
// Move forward
|
130
|
+
|
131
|
+
// Try find a higher one
|
132
|
+
for (i=0; i<z.length; i++) {
|
133
|
+
if (z[i] > z[ci]) {
|
134
|
+
fi = i;
|
135
|
+
break;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
if (fi > -1) {
|
140
|
+
nl[ci].style.zIndex = z[fi];
|
141
|
+
nl[fi].style.zIndex = z[ci];
|
142
|
+
} else
|
143
|
+
nl[ci].style.zIndex = z[ci] + 1;
|
144
|
+
}
|
145
|
+
|
146
|
+
ed.execCommand('mceRepaint');
|
147
|
+
},
|
148
|
+
|
149
|
+
_getParentLayer : function(n) {
|
150
|
+
return this.editor.dom.getParent(n, function(n) {
|
151
|
+
return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
|
152
|
+
});
|
153
|
+
},
|
154
|
+
|
155
|
+
_insertLayer : function() {
|
156
|
+
var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*'));
|
157
|
+
|
158
|
+
ed.dom.add(ed.getBody(), 'div', {
|
159
|
+
style : {
|
160
|
+
position : 'absolute',
|
161
|
+
left : p.x,
|
162
|
+
top : (p.y > 20 ? p.y : 20),
|
163
|
+
width : 100,
|
164
|
+
height : 100
|
165
|
+
},
|
166
|
+
'class' : 'mceItemVisualAid'
|
167
|
+
}, ed.selection.getContent() || ed.getLang('layer.content'));
|
168
|
+
},
|
169
|
+
|
170
|
+
_toggleAbsolute : function() {
|
171
|
+
var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
|
172
|
+
|
173
|
+
if (!le)
|
174
|
+
le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
|
175
|
+
|
176
|
+
if (le) {
|
177
|
+
if (le.style.position.toLowerCase() == "absolute") {
|
178
|
+
ed.dom.setStyles(le, {
|
179
|
+
position : '',
|
180
|
+
left : '',
|
181
|
+
top : '',
|
182
|
+
width : '',
|
183
|
+
height : ''
|
184
|
+
});
|
185
|
+
|
186
|
+
ed.dom.removeClass(le, 'mceItemVisualAid');
|
187
|
+
} else {
|
188
|
+
if (le.style.left == "")
|
189
|
+
le.style.left = 20 + 'px';
|
190
|
+
|
191
|
+
if (le.style.top == "")
|
192
|
+
le.style.top = 20 + 'px';
|
193
|
+
|
194
|
+
if (le.style.width == "")
|
195
|
+
le.style.width = le.width ? (le.width + 'px') : '100px';
|
196
|
+
|
197
|
+
if (le.style.height == "")
|
198
|
+
le.style.height = le.height ? (le.height + 'px') : '100px';
|
199
|
+
|
200
|
+
le.style.position = "absolute";
|
201
|
+
ed.addVisual(ed.getBody());
|
202
|
+
}
|
203
|
+
|
204
|
+
ed.execCommand('mceRepaint');
|
205
|
+
ed.nodeChanged();
|
206
|
+
}
|
207
|
+
}
|
208
|
+
});
|
209
|
+
|
210
|
+
// Register plugin
|
211
|
+
tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
|
212
|
+
})();
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.serializer;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"full"}},bold:{inline:"b"},italic:{inline:"i"},underline:{inline:"u"},strikethrough:{inline:"strike"},fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});d._setup();a.each("b,i,u,strike".split(","),function(f){var g=d.rules[f];if(!g){d.addRules(f)}});if(!d.rules.font){d.addRules("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.rules[f],g;if(h){a.each(h.attribs,function(j,i){if(i.name=="align"){g=true;return false}});if(!g){h.attribs.push({name:"align"})}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
|
@@ -0,0 +1,136 @@
|
|
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
|
+
* This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align
|
11
|
+
* attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash
|
12
|
+
*
|
13
|
+
* However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are
|
14
|
+
* not apart of the newer specifications for HTML and XHTML.
|
15
|
+
*/
|
16
|
+
|
17
|
+
(function(tinymce) {
|
18
|
+
// Override inline_styles setting to force TinyMCE to produce deprecated contents
|
19
|
+
tinymce.onAddEditor.addToTop(function(tinymce, editor) {
|
20
|
+
editor.settings.inline_styles = false;
|
21
|
+
});
|
22
|
+
|
23
|
+
// Create the legacy ouput plugin
|
24
|
+
tinymce.create('tinymce.plugins.LegacyOutput', {
|
25
|
+
init : function(editor) {
|
26
|
+
editor.onInit.add(function() {
|
27
|
+
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
|
28
|
+
fontSizes = tinymce.explode(editor.settings.font_size_style_values),
|
29
|
+
serializer = editor.serializer;
|
30
|
+
|
31
|
+
// Override some internal formats to produce legacy elements and attributes
|
32
|
+
editor.formatter.register({
|
33
|
+
// Change alignment formats to use the deprecated align attribute
|
34
|
+
alignleft : {selector : alignElements, attributes : {align : 'left'}},
|
35
|
+
aligncenter : {selector : alignElements, attributes : {align : 'center'}},
|
36
|
+
alignright : {selector : alignElements, attributes : {align : 'right'}},
|
37
|
+
alignfull : {selector : alignElements, attributes : {align : 'full'}},
|
38
|
+
|
39
|
+
// Change the basic formatting elements to use deprecated element types
|
40
|
+
bold : {inline : 'b'},
|
41
|
+
italic : {inline : 'i'},
|
42
|
+
underline : {inline : 'u'},
|
43
|
+
strikethrough : {inline : 'strike'},
|
44
|
+
|
45
|
+
// Change font size and font family to use the deprecated font element
|
46
|
+
fontname : {inline : 'font', attributes : {face : '%value'}},
|
47
|
+
fontsize : {
|
48
|
+
inline : 'font',
|
49
|
+
attributes : {
|
50
|
+
size : function(vars) {
|
51
|
+
return tinymce.inArray(fontSizes, vars.value) + 1;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
},
|
55
|
+
|
56
|
+
// Setup font elements for colors as well
|
57
|
+
forecolor : {inline : 'font', styles : {color : '%value'}},
|
58
|
+
hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}
|
59
|
+
});
|
60
|
+
|
61
|
+
// Force parsing of the serializer rules
|
62
|
+
serializer._setup();
|
63
|
+
|
64
|
+
// Check that deprecated elements are allowed if not add them
|
65
|
+
tinymce.each('b,i,u,strike'.split(','), function(name) {
|
66
|
+
var rule = serializer.rules[name];
|
67
|
+
|
68
|
+
if (!rule)
|
69
|
+
serializer.addRules(name);
|
70
|
+
});
|
71
|
+
|
72
|
+
// Add font element if it's missing
|
73
|
+
if (!serializer.rules["font"])
|
74
|
+
serializer.addRules("font[face|size|color|style]");
|
75
|
+
|
76
|
+
// Add the missing and depreacted align attribute for the serialization engine
|
77
|
+
tinymce.each(alignElements.split(','), function(name) {
|
78
|
+
var rule = serializer.rules[name], found;
|
79
|
+
|
80
|
+
if (rule) {
|
81
|
+
tinymce.each(rule.attribs, function(name, attr) {
|
82
|
+
if (attr.name == 'align') {
|
83
|
+
found = true;
|
84
|
+
return false;
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
if (!found)
|
89
|
+
rule.attribs.push({name : 'align'});
|
90
|
+
}
|
91
|
+
});
|
92
|
+
|
93
|
+
// Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes
|
94
|
+
editor.onNodeChange.add(function(editor, control_manager) {
|
95
|
+
var control, fontElm, fontName, fontSize;
|
96
|
+
|
97
|
+
// Find font element get it's name and size
|
98
|
+
fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
|
99
|
+
if (fontElm) {
|
100
|
+
fontName = fontElm.face;
|
101
|
+
fontSize = fontElm.size;
|
102
|
+
}
|
103
|
+
|
104
|
+
// Select/unselect the font name in droplist
|
105
|
+
if (control = control_manager.get('fontselect')) {
|
106
|
+
control.select(function(value) {
|
107
|
+
return value == fontName;
|
108
|
+
});
|
109
|
+
}
|
110
|
+
|
111
|
+
// Select/unselect the font size in droplist
|
112
|
+
if (control = control_manager.get('fontsizeselect')) {
|
113
|
+
control.select(function(value) {
|
114
|
+
var index = tinymce.inArray(fontSizes, value.fontSize);
|
115
|
+
|
116
|
+
return index + 1 == fontSize;
|
117
|
+
});
|
118
|
+
}
|
119
|
+
});
|
120
|
+
});
|
121
|
+
},
|
122
|
+
|
123
|
+
getInfo : function() {
|
124
|
+
return {
|
125
|
+
longname : 'LegacyOutput',
|
126
|
+
author : 'Moxiecode Systems AB',
|
127
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
128
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',
|
129
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
130
|
+
};
|
131
|
+
}
|
132
|
+
});
|
133
|
+
|
134
|
+
// Register plugin
|
135
|
+
tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);
|
136
|
+
})(tinymce);
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{if(v&&u.tagName==="P"&&t.tagName==="P"){return true}else{return false}}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(u,v){var s=false;function x(y){return y.keyCode===9&&(u.queryCommandState("InsertUnorderedList")||u.queryCommandState("InsertOrderedList"))}function w(y,A){var z=y.selection,B;if(A.keyCode===13){B=z.getStart();s=z.isCollapsed()&&B&&B.tagName==="LI"&&B.childNodes.length===0;return s}}function t(y,z){if(x(z)||w(y,z)){return r.cancel(z)}}this.ed=u;u.addCommand("Indent",this.indent,this);u.addCommand("Outdent",this.outdent,this);u.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);u.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);u.onInit.add(function(){u.editorCommands.addCommands({outdent:function(){var z=u.selection,A=u.dom;function y(B){B=A.getParent(B,A.isBlock);return B&&(parseInt(u.dom.getStyle(B,"margin-left")||0,10)+parseInt(u.dom.getStyle(B,"padding-left")||0,10))>0}return y(z.getStart())||y(z.getEnd())||u.queryCommandState("InsertOrderedList")||u.queryCommandState("InsertUnorderedList")}},"state")});u.onKeyUp.add(function(z,A){var B,y;if(x(A)){z.execCommand(A.shiftKey?"Outdent":"Indent",true,null);return r.cancel(A)}else{if(s&&w(z,A)){if(z.queryCommandState("InsertOrderedList")){z.execCommand("InsertOrderedList")}else{z.execCommand("InsertUnorderedList")}B=z.selection.getStart();if(B&&B.tagName==="LI"){B=z.dom.getParent(B,"ol,ul").nextSibling;if(B&&B.tagName==="P"){if(!B.firstChild){B.appendChild(z.getDoc().createTextNode(""))}y=z.dom.createRng();y.setStart(B.firstChild,1);y.setEnd(B.firstChild,1);z.selection.setRng(y)}}return r.cancel(A)}}});u.onKeyPress.add(t);u.onKeyDown.add(t)},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O,Q){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(M.tagName==="P"||G.length>1){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true);return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(Q,L,O){var t,P=Q,N,M;while(!I.isBlock(Q.parentNode)&&Q.parentNode!==I.getRoot()){Q=I.split(Q.parentNode,Q.previousSibling);Q=Q.nextSibling;P=Q}if(O){t=O.cloneNode(true);Q.parentNode.insertBefore(t,Q);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");Q.parentNode.insertBefore(t,Q)}while(P&&P!=L){N=P.nextSibling;t.appendChild(P);P=N}if(t.childNodes.length===0){t.innerHTML='<br _mce_bogus="1" />'}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(V){var U;if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(P(N,V)){I.addClass(V,"_mce_tagged_br");N=S(V)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D}}else{B={defaultAction:x}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true)})},outdent:function(){var v=this,u=v.ed,w=u.dom,s=[];function x(t){var z,y,A;if(!d(u,t,s)){if(w.getStyle(t,"margin-left")!==""||w.getStyle(t,"padding-left")!==""){return v.adjustPaddingFunction(false)(t)}A=w.getStyle(t,"text-align",true);if(A==="center"||A==="right"){w.setStyle(t,"text-align","left");return}t=c(t,w);z=t.parentNode;y=t.parentNode.parentNode;if(y.tagName==="P"){w.split(y,t.parentNode)}else{w.split(z,t);if(y.tagName==="LI"){w.split(y,t)}else{if(!w.is(y,"ol,ul")){w.rename(t,"p")}}}s.push(t)}}this.process({LI:x,defaultAction:this.adjustPaddingFunction(false)});e(s,m)},process:function(x){var B=this,v=B.ed.selection,y=B.ed.dom,A,s;function w(t){y.removeClass(t,"_mce_act_on");if(!t||t.nodeType!==1){return}t=k(t,y);var C=x[t.tagName];if(!C){C=x.defaultAction}C(t)}function u(t){B.splitSafeEach(t.childNodes,w)}function z(t,C){return C>=0&&t.hasChildNodes()&&C<t.childNodes.length&&t.childNodes[C].tagName==="BR"}A=v.getSelectedBlocks();if(A.length===0){A=[y.getRoot()]}s=v.getRng(true);if(!s.collapsed){if(z(s.endContainer,s.endOffset-1)){s.setEnd(s.endContainer,s.endOffset-1);v.setRng(s)}if(z(s.startContainer,s.startOffset)){s.setStart(s.startContainer,s.startOffset+1);v.setRng(s)}}g=v.getBookmark();x.OL=x.UL=u;B.splitSafeEach(A,w);v.moveToBookmark(g);g=null;B.ed.execCommand("mceRepaint")},splitSafeEach:function(t,s){if(tinymce.isGecko&&(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent)||/Firefox\/3\.[0-4]/.test(navigator.userAgent))){this.classBasedEach(t,s)}else{e(t,s)}},classBasedEach:function(v,u){var w=this.ed.dom,s,t;e(v,function(x){w.addClass(x,"_mce_act_on")});s=w.select("._mce_act_on");while(s.length>0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}());
|
@@ -0,0 +1,617 @@
|
|
1
|
+
/**
|
2
|
+
* editor_plugin_src.js
|
3
|
+
*
|
4
|
+
* Copyright 2011, Moxiecode Systems AB
|
5
|
+
* Released under LGPL License.
|
6
|
+
*
|
7
|
+
* License: http://tinymce.moxiecode.com/license
|
8
|
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function() {
|
12
|
+
var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
|
13
|
+
|
14
|
+
// Skips text nodes that only contain whitespace since they aren't semantically important.
|
15
|
+
function skipWhitespaceNodes(e, next) {
|
16
|
+
while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
|
17
|
+
e = next(e);
|
18
|
+
}
|
19
|
+
return e;
|
20
|
+
}
|
21
|
+
|
22
|
+
function skipWhitespaceNodesBackwards(e) {
|
23
|
+
return skipWhitespaceNodes(e, function(e) { return e.previousSibling; });
|
24
|
+
}
|
25
|
+
|
26
|
+
function skipWhitespaceNodesForwards(e) {
|
27
|
+
return skipWhitespaceNodes(e, function(e) { return e.nextSibling; });
|
28
|
+
}
|
29
|
+
|
30
|
+
function hasParentInList(ed, e, list) {
|
31
|
+
return ed.dom.getParent(e, function(p) {
|
32
|
+
return tinymce.inArray(list, p) !== -1;
|
33
|
+
});
|
34
|
+
}
|
35
|
+
|
36
|
+
function isList(e) {
|
37
|
+
return e && (e.tagName === 'OL' || e.tagName === 'UL');
|
38
|
+
}
|
39
|
+
|
40
|
+
function splitNestedLists(element, dom) {
|
41
|
+
var tmp, nested, wrapItem;
|
42
|
+
tmp = skipWhitespaceNodesBackwards(element.lastChild);
|
43
|
+
while (isList(tmp)) {
|
44
|
+
nested = tmp;
|
45
|
+
tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
|
46
|
+
}
|
47
|
+
if (nested) {
|
48
|
+
wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
49
|
+
dom.split(element, nested);
|
50
|
+
dom.insertAfter(wrapItem, nested);
|
51
|
+
wrapItem.appendChild(nested);
|
52
|
+
wrapItem.appendChild(nested);
|
53
|
+
element = wrapItem.previousSibling;
|
54
|
+
}
|
55
|
+
return element;
|
56
|
+
}
|
57
|
+
|
58
|
+
function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
|
59
|
+
e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
|
60
|
+
return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
|
61
|
+
}
|
62
|
+
|
63
|
+
function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
|
64
|
+
var prev = skipWhitespaceNodesBackwards(e.previousSibling);
|
65
|
+
if (prev) {
|
66
|
+
return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
|
67
|
+
} else {
|
68
|
+
return e;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
|
73
|
+
var next = skipWhitespaceNodesForwards(e.nextSibling);
|
74
|
+
if (next) {
|
75
|
+
return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
|
76
|
+
} else {
|
77
|
+
return e;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
|
82
|
+
if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
|
83
|
+
return merge(e1, e2, differentStylesMasterElement);
|
84
|
+
} else if (e1 && e1.tagName === 'LI' && isList(e2)) {
|
85
|
+
// Fix invalidly nested lists.
|
86
|
+
e1.appendChild(e2);
|
87
|
+
}
|
88
|
+
return e2;
|
89
|
+
}
|
90
|
+
|
91
|
+
function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
|
92
|
+
if (!e1 || !e2) {
|
93
|
+
return false;
|
94
|
+
} else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
|
95
|
+
return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
|
96
|
+
} else if (isList(e1)) {
|
97
|
+
return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
|
98
|
+
} else if (mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P') {
|
99
|
+
return true;
|
100
|
+
} else {
|
101
|
+
return false;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
function isListForIndent(e) {
|
106
|
+
var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
|
107
|
+
return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
|
108
|
+
}
|
109
|
+
|
110
|
+
function containsOnlyAList(e) {
|
111
|
+
var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
|
112
|
+
return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
|
113
|
+
}
|
114
|
+
|
115
|
+
function merge(e1, e2, masterElement) {
|
116
|
+
var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
|
117
|
+
if (e1.tagName === 'P') {
|
118
|
+
e1.appendChild(e1.ownerDocument.createElement('br'));
|
119
|
+
}
|
120
|
+
while (e2.firstChild) {
|
121
|
+
e1.appendChild(e2.firstChild);
|
122
|
+
}
|
123
|
+
if (masterElement) {
|
124
|
+
e1.style.listStyleType = masterElement.style.listStyleType;
|
125
|
+
}
|
126
|
+
e2.parentNode.removeChild(e2);
|
127
|
+
attemptMerge(lastOriginal, firstNew, false);
|
128
|
+
return e1;
|
129
|
+
}
|
130
|
+
|
131
|
+
function findItemToOperateOn(e, dom) {
|
132
|
+
var item;
|
133
|
+
if (!dom.is(e, 'li,ol,ul')) {
|
134
|
+
item = dom.getParent(e, 'li');
|
135
|
+
if (item) {
|
136
|
+
e = item;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return e;
|
140
|
+
}
|
141
|
+
|
142
|
+
tinymce.create('tinymce.plugins.Lists', {
|
143
|
+
init: function(ed, url) {
|
144
|
+
var enterDownInEmptyList = false;
|
145
|
+
function isTriggerKey(e) {
|
146
|
+
return e.keyCode === 9 && (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
|
147
|
+
}
|
148
|
+
function isEnterInEmptyListItem(ed, e) {
|
149
|
+
var sel = ed.selection, n;
|
150
|
+
if (e.keyCode === 13) {
|
151
|
+
n = sel.getStart();
|
152
|
+
enterDownInEmptyList = sel.isCollapsed() && n && n.tagName === 'LI' && n.childNodes.length === 0;
|
153
|
+
return enterDownInEmptyList;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
function cancelKeys(ed, e) {
|
157
|
+
if (isTriggerKey(e) || isEnterInEmptyListItem(ed, e)) {
|
158
|
+
return Event.cancel(e);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
this.ed = ed;
|
163
|
+
ed.addCommand('Indent', this.indent, this);
|
164
|
+
ed.addCommand('Outdent', this.outdent, this);
|
165
|
+
ed.addCommand('InsertUnorderedList', function() {
|
166
|
+
this.applyList('UL', 'OL');
|
167
|
+
}, this);
|
168
|
+
ed.addCommand('InsertOrderedList', function() {
|
169
|
+
this.applyList('OL', 'UL');
|
170
|
+
}, this);
|
171
|
+
|
172
|
+
ed.onInit.add(function() {
|
173
|
+
ed.editorCommands.addCommands({
|
174
|
+
'outdent': function() {
|
175
|
+
var sel = ed.selection, dom = ed.dom;
|
176
|
+
function hasStyleIndent(n) {
|
177
|
+
n = dom.getParent(n, dom.isBlock);
|
178
|
+
return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
|
179
|
+
}
|
180
|
+
return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
|
181
|
+
}
|
182
|
+
}, 'state');
|
183
|
+
});
|
184
|
+
|
185
|
+
ed.onKeyUp.add(function(ed, e) {
|
186
|
+
var n, rng;
|
187
|
+
if (isTriggerKey(e)) {
|
188
|
+
ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
|
189
|
+
return Event.cancel(e);
|
190
|
+
} else if (enterDownInEmptyList && isEnterInEmptyListItem(ed, e)) {
|
191
|
+
if (ed.queryCommandState('InsertOrderedList')) {
|
192
|
+
ed.execCommand('InsertOrderedList');
|
193
|
+
} else {
|
194
|
+
ed.execCommand('InsertUnorderedList');
|
195
|
+
}
|
196
|
+
n = ed.selection.getStart();
|
197
|
+
if (n && n.tagName === 'LI') {
|
198
|
+
// Fix the caret position on IE since it jumps back up to the previous list item.
|
199
|
+
n = ed.dom.getParent(n, 'ol,ul').nextSibling;
|
200
|
+
if (n && n.tagName === 'P') {
|
201
|
+
if (!n.firstChild) {
|
202
|
+
n.appendChild(ed.getDoc().createTextNode(''));
|
203
|
+
}
|
204
|
+
rng = ed.dom.createRng();
|
205
|
+
rng.setStart(n.firstChild, 1);
|
206
|
+
rng.setEnd(n.firstChild, 1);
|
207
|
+
ed.selection.setRng(rng);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
return Event.cancel(e);
|
211
|
+
}
|
212
|
+
});
|
213
|
+
ed.onKeyPress.add(cancelKeys);
|
214
|
+
ed.onKeyDown.add(cancelKeys);
|
215
|
+
},
|
216
|
+
|
217
|
+
applyList: function(targetListType, oppositeListType) {
|
218
|
+
var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
|
219
|
+
selectedBlocks = ed.selection.getSelectedBlocks();
|
220
|
+
|
221
|
+
function cleanupBr(e) {
|
222
|
+
if (e && e.tagName === 'BR') {
|
223
|
+
dom.remove(e);
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
function makeList(element) {
|
228
|
+
var list = dom.create(targetListType), li;
|
229
|
+
function adjustIndentForNewList(element) {
|
230
|
+
// If there's a margin-left, outdent one level to account for the extra list margin.
|
231
|
+
if (element.style.marginLeft || element.style.paddingLeft) {
|
232
|
+
t.adjustPaddingFunction(false)(element);
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
if (element.tagName === 'LI') {
|
237
|
+
// No change required.
|
238
|
+
} else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
|
239
|
+
processBrs(element, function(startSection, br, previousBR) {
|
240
|
+
doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
|
241
|
+
li = startSection.parentNode;
|
242
|
+
adjustIndentForNewList(li);
|
243
|
+
cleanupBr(br);
|
244
|
+
});
|
245
|
+
if (element.tagName === 'P' || selectedBlocks.length > 1) {
|
246
|
+
dom.split(li.parentNode.parentNode, li.parentNode);
|
247
|
+
}
|
248
|
+
attemptMergeWithAdjacent(li.parentNode, true);
|
249
|
+
return;
|
250
|
+
} else {
|
251
|
+
// Put the list around the element.
|
252
|
+
li = dom.create('li');
|
253
|
+
dom.insertAfter(li, element);
|
254
|
+
li.appendChild(element);
|
255
|
+
adjustIndentForNewList(element);
|
256
|
+
element = li;
|
257
|
+
}
|
258
|
+
dom.insertAfter(list, element);
|
259
|
+
list.appendChild(element);
|
260
|
+
attemptMergeWithAdjacent(list, true);
|
261
|
+
applied.push(element);
|
262
|
+
}
|
263
|
+
|
264
|
+
function doWrapList(start, end, template) {
|
265
|
+
var li, n = start, tmp, i;
|
266
|
+
while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
|
267
|
+
start = dom.split(start.parentNode, start.previousSibling);
|
268
|
+
start = start.nextSibling;
|
269
|
+
n = start;
|
270
|
+
}
|
271
|
+
if (template) {
|
272
|
+
li = template.cloneNode(true);
|
273
|
+
start.parentNode.insertBefore(li, start);
|
274
|
+
while (li.firstChild) dom.remove(li.firstChild);
|
275
|
+
li = dom.rename(li, 'li');
|
276
|
+
} else {
|
277
|
+
li = dom.create('li');
|
278
|
+
start.parentNode.insertBefore(li, start);
|
279
|
+
}
|
280
|
+
while (n && n != end) {
|
281
|
+
tmp = n.nextSibling;
|
282
|
+
li.appendChild(n);
|
283
|
+
n = tmp;
|
284
|
+
}
|
285
|
+
if (li.childNodes.length === 0) {
|
286
|
+
li.innerHTML = '<br _mce_bogus="1" />';
|
287
|
+
}
|
288
|
+
makeList(li);
|
289
|
+
}
|
290
|
+
|
291
|
+
function processBrs(element, callback) {
|
292
|
+
var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
|
293
|
+
breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
|
294
|
+
function isAnyPartSelected(start, end) {
|
295
|
+
var r = dom.createRng(), sel;
|
296
|
+
bookmark.keep = true;
|
297
|
+
ed.selection.moveToBookmark(bookmark);
|
298
|
+
bookmark.keep = false;
|
299
|
+
sel = ed.selection.getRng(true);
|
300
|
+
if (!end) {
|
301
|
+
end = start.parentNode.lastChild;
|
302
|
+
}
|
303
|
+
r.setStartBefore(start);
|
304
|
+
r.setEndAfter(end);
|
305
|
+
return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
|
306
|
+
}
|
307
|
+
function nextLeaf(br) {
|
308
|
+
if (br.nextSibling)
|
309
|
+
return br.nextSibling;
|
310
|
+
if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
|
311
|
+
return nextLeaf(br.parentNode);
|
312
|
+
}
|
313
|
+
// Split on BRs within the range and process those.
|
314
|
+
startSection = element.firstChild;
|
315
|
+
// First mark the BRs that have any part of the previous section selected.
|
316
|
+
var trailingContentSelected = false;
|
317
|
+
each(dom.select(breakElements, element), function(br) {
|
318
|
+
var b;
|
319
|
+
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
320
|
+
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
321
|
+
}
|
322
|
+
if (isAnyPartSelected(startSection, br)) {
|
323
|
+
dom.addClass(br, '_mce_tagged_br');
|
324
|
+
startSection = nextLeaf(br);
|
325
|
+
}
|
326
|
+
});
|
327
|
+
trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
|
328
|
+
startSection = element.firstChild;
|
329
|
+
each(dom.select(breakElements, element), function(br) {
|
330
|
+
// Got a section from start to br.
|
331
|
+
var tmp = nextLeaf(br);
|
332
|
+
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
333
|
+
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
334
|
+
}
|
335
|
+
if (dom.hasClass(br, '_mce_tagged_br')) {
|
336
|
+
callback(startSection, br, previousBR);
|
337
|
+
previousBR = null;
|
338
|
+
} else {
|
339
|
+
previousBR = br;
|
340
|
+
}
|
341
|
+
startSection = tmp;
|
342
|
+
});
|
343
|
+
if (trailingContentSelected) {
|
344
|
+
callback(startSection, undefined, previousBR);
|
345
|
+
}
|
346
|
+
}
|
347
|
+
|
348
|
+
function wrapList(element) {
|
349
|
+
processBrs(element, function(startSection, br, previousBR) {
|
350
|
+
// Need to indent this part
|
351
|
+
doWrapList(startSection, br);
|
352
|
+
cleanupBr(br);
|
353
|
+
cleanupBr(previousBR);
|
354
|
+
});
|
355
|
+
}
|
356
|
+
|
357
|
+
function changeList(element) {
|
358
|
+
if (tinymce.inArray(applied, element) !== -1) {
|
359
|
+
return;
|
360
|
+
}
|
361
|
+
if (element.parentNode.tagName === oppositeListType) {
|
362
|
+
dom.split(element.parentNode, element);
|
363
|
+
makeList(element);
|
364
|
+
attemptMergeWithNext(element.parentNode, false);
|
365
|
+
}
|
366
|
+
applied.push(element);
|
367
|
+
}
|
368
|
+
|
369
|
+
function convertListItemToParagraph(element) {
|
370
|
+
var child, nextChild, mergedElement, splitLast;
|
371
|
+
if (tinymce.inArray(applied, element) !== -1) {
|
372
|
+
return;
|
373
|
+
}
|
374
|
+
element = splitNestedLists(element, dom);
|
375
|
+
while (dom.is(element.parentNode, 'ol,ul,li')) {
|
376
|
+
dom.split(element.parentNode, element);
|
377
|
+
}
|
378
|
+
// Push the original element we have from the selection, not the renamed one.
|
379
|
+
applied.push(element);
|
380
|
+
element = dom.rename(element, 'p');
|
381
|
+
mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
|
382
|
+
if (mergedElement === element) {
|
383
|
+
// Now split out any block elements that can't be contained within a P.
|
384
|
+
// Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
|
385
|
+
child = element.firstChild;
|
386
|
+
while (child) {
|
387
|
+
if (dom.isBlock(child)) {
|
388
|
+
child = dom.split(child.parentNode, child);
|
389
|
+
splitLast = true;
|
390
|
+
nextChild = child.nextSibling && child.nextSibling.firstChild;
|
391
|
+
} else {
|
392
|
+
nextChild = child.nextSibling;
|
393
|
+
if (splitLast && child.tagName === 'BR') {
|
394
|
+
dom.remove(child);
|
395
|
+
}
|
396
|
+
splitLast = false;
|
397
|
+
}
|
398
|
+
child = nextChild;
|
399
|
+
}
|
400
|
+
}
|
401
|
+
}
|
402
|
+
|
403
|
+
each(selectedBlocks, function(e) {
|
404
|
+
e = findItemToOperateOn(e, dom);
|
405
|
+
if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
|
406
|
+
hasOppositeType = true;
|
407
|
+
} else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
|
408
|
+
hasSameType = true;
|
409
|
+
} else {
|
410
|
+
hasNonList = true;
|
411
|
+
}
|
412
|
+
});
|
413
|
+
|
414
|
+
if (hasNonList || hasOppositeType || selectedBlocks.length === 0) {
|
415
|
+
actions = {
|
416
|
+
'LI': changeList,
|
417
|
+
'H1': makeList,
|
418
|
+
'H2': makeList,
|
419
|
+
'H3': makeList,
|
420
|
+
'H4': makeList,
|
421
|
+
'H5': makeList,
|
422
|
+
'H6': makeList,
|
423
|
+
'P': makeList,
|
424
|
+
'BODY': makeList,
|
425
|
+
'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
|
426
|
+
defaultAction: wrapList
|
427
|
+
};
|
428
|
+
} else {
|
429
|
+
actions = {
|
430
|
+
defaultAction: convertListItemToParagraph
|
431
|
+
};
|
432
|
+
}
|
433
|
+
this.process(actions);
|
434
|
+
},
|
435
|
+
|
436
|
+
indent: function() {
|
437
|
+
var ed = this.ed, dom = ed.dom, indented = [];
|
438
|
+
|
439
|
+
function createWrapItem(element) {
|
440
|
+
var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
441
|
+
dom.insertAfter(wrapItem, element);
|
442
|
+
return wrapItem;
|
443
|
+
}
|
444
|
+
|
445
|
+
function createWrapList(element) {
|
446
|
+
var wrapItem = createWrapItem(element),
|
447
|
+
list = dom.getParent(element, 'ol,ul'),
|
448
|
+
listType = list.tagName,
|
449
|
+
listStyle = dom.getStyle(list, 'list-style-type'),
|
450
|
+
attrs = {},
|
451
|
+
wrapList;
|
452
|
+
if (listStyle !== '') {
|
453
|
+
attrs.style = 'list-style-type: ' + listStyle + ';';
|
454
|
+
}
|
455
|
+
wrapList = dom.create(listType, attrs);
|
456
|
+
wrapItem.appendChild(wrapList);
|
457
|
+
return wrapList;
|
458
|
+
}
|
459
|
+
|
460
|
+
function indentLI(element) {
|
461
|
+
if (!hasParentInList(ed, element, indented)) {
|
462
|
+
element = splitNestedLists(element, dom);
|
463
|
+
var wrapList = createWrapList(element);
|
464
|
+
wrapList.appendChild(element);
|
465
|
+
attemptMergeWithAdjacent(wrapList.parentNode, false);
|
466
|
+
attemptMergeWithAdjacent(wrapList, false);
|
467
|
+
indented.push(element);
|
468
|
+
}
|
469
|
+
}
|
470
|
+
|
471
|
+
this.process({
|
472
|
+
'LI': indentLI,
|
473
|
+
defaultAction: this.adjustPaddingFunction(true)
|
474
|
+
});
|
475
|
+
|
476
|
+
},
|
477
|
+
|
478
|
+
outdent: function() {
|
479
|
+
var t = this, ed = t.ed, dom = ed.dom, outdented = [];
|
480
|
+
|
481
|
+
function outdentLI(element) {
|
482
|
+
var listElement, targetParent, align;
|
483
|
+
if (!hasParentInList(ed, element, outdented)) {
|
484
|
+
if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
|
485
|
+
return t.adjustPaddingFunction(false)(element);
|
486
|
+
}
|
487
|
+
align = dom.getStyle(element, 'text-align', true);
|
488
|
+
if (align === 'center' || align === 'right') {
|
489
|
+
dom.setStyle(element, 'text-align', 'left');
|
490
|
+
return;
|
491
|
+
}
|
492
|
+
element = splitNestedLists(element, dom);
|
493
|
+
listElement = element.parentNode;
|
494
|
+
targetParent = element.parentNode.parentNode;
|
495
|
+
if (targetParent.tagName === 'P') {
|
496
|
+
dom.split(targetParent, element.parentNode);
|
497
|
+
} else {
|
498
|
+
dom.split(listElement, element);
|
499
|
+
if (targetParent.tagName === 'LI') {
|
500
|
+
// Nested list, need to split the LI and go back out to the OL/UL element.
|
501
|
+
dom.split(targetParent, element);
|
502
|
+
} else if (!dom.is(targetParent, 'ol,ul')) {
|
503
|
+
dom.rename(element, 'p');
|
504
|
+
}
|
505
|
+
}
|
506
|
+
outdented.push(element);
|
507
|
+
}
|
508
|
+
}
|
509
|
+
|
510
|
+
this.process({
|
511
|
+
'LI': outdentLI,
|
512
|
+
defaultAction: this.adjustPaddingFunction(false)
|
513
|
+
});
|
514
|
+
|
515
|
+
each(outdented, attemptMergeWithAdjacent);
|
516
|
+
},
|
517
|
+
|
518
|
+
process: function(actions) {
|
519
|
+
var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
|
520
|
+
function processElement(element) {
|
521
|
+
dom.removeClass(element, '_mce_act_on');
|
522
|
+
if (!element || element.nodeType !== 1) {
|
523
|
+
return;
|
524
|
+
}
|
525
|
+
element = findItemToOperateOn(element, dom);
|
526
|
+
var action = actions[element.tagName];
|
527
|
+
if (!action) {
|
528
|
+
action = actions.defaultAction;
|
529
|
+
}
|
530
|
+
action(element);
|
531
|
+
}
|
532
|
+
function recurse(element) {
|
533
|
+
t.splitSafeEach(element.childNodes, processElement);
|
534
|
+
}
|
535
|
+
function brAtEdgeOfSelection(container, offset) {
|
536
|
+
return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
|
537
|
+
container.childNodes[offset].tagName === 'BR';
|
538
|
+
}
|
539
|
+
selectedBlocks = sel.getSelectedBlocks();
|
540
|
+
if (selectedBlocks.length === 0) {
|
541
|
+
selectedBlocks = [ dom.getRoot() ];
|
542
|
+
}
|
543
|
+
|
544
|
+
r = sel.getRng(true);
|
545
|
+
if (!r.collapsed) {
|
546
|
+
if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
|
547
|
+
r.setEnd(r.endContainer, r.endOffset - 1);
|
548
|
+
sel.setRng(r);
|
549
|
+
}
|
550
|
+
if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
|
551
|
+
r.setStart(r.startContainer, r.startOffset + 1);
|
552
|
+
sel.setRng(r);
|
553
|
+
}
|
554
|
+
}
|
555
|
+
bookmark = sel.getBookmark();
|
556
|
+
actions.OL = actions.UL = recurse;
|
557
|
+
t.splitSafeEach(selectedBlocks, processElement);
|
558
|
+
sel.moveToBookmark(bookmark);
|
559
|
+
bookmark = null;
|
560
|
+
// Avoids table or image handles being left behind in Firefox.
|
561
|
+
t.ed.execCommand('mceRepaint');
|
562
|
+
},
|
563
|
+
|
564
|
+
splitSafeEach: function(elements, f) {
|
565
|
+
if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
|
566
|
+
/Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
|
567
|
+
this.classBasedEach(elements, f);
|
568
|
+
} else {
|
569
|
+
each(elements, f);
|
570
|
+
}
|
571
|
+
},
|
572
|
+
|
573
|
+
classBasedEach: function(elements, f) {
|
574
|
+
var dom = this.ed.dom, nodes, element;
|
575
|
+
// Mark nodes
|
576
|
+
each(elements, function(element) {
|
577
|
+
dom.addClass(element, '_mce_act_on');
|
578
|
+
});
|
579
|
+
nodes = dom.select('._mce_act_on');
|
580
|
+
while (nodes.length > 0) {
|
581
|
+
element = nodes.shift();
|
582
|
+
dom.removeClass(element, '_mce_act_on');
|
583
|
+
f(element);
|
584
|
+
nodes = dom.select('._mce_act_on');
|
585
|
+
}
|
586
|
+
},
|
587
|
+
|
588
|
+
adjustPaddingFunction: function(isIndent) {
|
589
|
+
var indentAmount, indentUnits, ed = this.ed;
|
590
|
+
indentAmount = ed.settings.indentation;
|
591
|
+
indentUnits = /[a-z%]+/i.exec(indentAmount);
|
592
|
+
indentAmount = parseInt(indentAmount, 10);
|
593
|
+
return function(element) {
|
594
|
+
var currentIndent, newIndentAmount;
|
595
|
+
currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
|
596
|
+
if (isIndent) {
|
597
|
+
newIndentAmount = currentIndent + indentAmount;
|
598
|
+
} else {
|
599
|
+
newIndentAmount = currentIndent - indentAmount;
|
600
|
+
}
|
601
|
+
ed.dom.setStyle(element, 'padding-left', '');
|
602
|
+
ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
|
603
|
+
};
|
604
|
+
},
|
605
|
+
|
606
|
+
getInfo: function() {
|
607
|
+
return {
|
608
|
+
longname : 'Lists',
|
609
|
+
author : 'Moxiecode Systems AB',
|
610
|
+
authorurl : 'http://tinymce.moxiecode.com',
|
611
|
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
|
612
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
613
|
+
};
|
614
|
+
}
|
615
|
+
});
|
616
|
+
tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
|
617
|
+
}());
|