From f55779fd831029f764c885bf1fd026a7e94f08eb Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Mar 2012 20:47:31 -0700 Subject: [PATCH] update tinymce to 3.5b2 to fix issues with FF 11 and pasting into code blocks --- .../plugins.bbcode.editor_plugin_src.js | 258 + .../mcefixes/themes.advanced.img.icons.gif | Bin 0 -> 11776 bytes .../themes.advanced.skins.default.dialog.css | 117 + .../themes.advanced.skins.default.ui.css | 213 + library/tinymce/changelog.txt | 453 + library/tinymce/examples/accessibility.html | 101 + library/tinymce/examples/css/content.css | 0 library/tinymce/examples/css/word.css | 0 library/tinymce/examples/custom_formats.html | 8 +- library/tinymce/examples/full.html | 31 +- library/tinymce/examples/index.html | 0 library/tinymce/examples/lists/image_list.js | 0 library/tinymce/examples/lists/link_list.js | 0 library/tinymce/examples/lists/media_list.js | 6 +- .../tinymce/examples/lists/template_list.js | 0 library/tinymce/examples/media/logo.jpg | Bin library/tinymce/examples/media/logo_over.jpg | Bin library/tinymce/examples/media/sample.avi | Bin library/tinymce/examples/media/sample.dcr | Bin library/tinymce/examples/media/sample.flv | Bin 0 -> 88722 bytes library/tinymce/examples/media/sample.mov | Bin library/tinymce/examples/media/sample.ram | 0 library/tinymce/examples/media/sample.rm | Bin library/tinymce/examples/media/sample.swf | Bin library/tinymce/examples/menu.html | 3 +- library/tinymce/examples/simple.html | 6 +- library/tinymce/examples/skins.html | 14 +- .../tinymce/examples/templates/layout1.htm | 0 .../tinymce/examples/templates/snippet1.htm | 0 library/tinymce/examples/translate.html | 80 - library/tinymce/examples/word.html | 11 +- library/tinymce/jscripts/tiny_mce/langs/en.js | 171 +- library/tinymce/jscripts/tiny_mce/license.txt | 0 .../tiny_mce/plugins/advhr/css/advhr.css | 0 .../tiny_mce/plugins/advhr/editor_plugin.js | 0 .../plugins/advhr/editor_plugin_src.js | 0 .../tiny_mce/plugins/advhr/js/rule.js | 0 .../tiny_mce/plugins/advhr/langs/en_dlg.js | 6 +- .../jscripts/tiny_mce/plugins/advhr/rule.htm | 59 +- .../plugins/advimage/css/advimage.css | 0 .../plugins/advimage/editor_plugin.js | 2 +- .../plugins/advimage/editor_plugin_src.js | 2 +- .../tiny_mce/plugins/advimage/image.htm | 65 +- .../tiny_mce/plugins/advimage/img/sample.gif | Bin .../tiny_mce/plugins/advimage/js/image.js | 45 +- .../tiny_mce/plugins/advimage/langs/en_dlg.js | 44 +- .../tiny_mce/plugins/advlink/css/advlink.css | 0 .../tiny_mce/plugins/advlink/editor_plugin.js | 0 .../plugins/advlink/editor_plugin_src.js | 0 .../tiny_mce/plugins/advlink/js/advlink.js | 49 +- .../tiny_mce/plugins/advlink/langs/en_dlg.js | 53 +- .../tiny_mce/plugins/advlink/link.htm | 65 +- .../tiny_mce/plugins/advlist/editor_plugin.js | 2 +- .../plugins/advlist/editor_plugin_src.js | 40 +- .../plugins/autolink/editor_plugin.js | 1 + .../plugins/autolink/editor_plugin_src.js | 174 + .../plugins/autoresize/editor_plugin.js | 2 +- .../plugins/autoresize/editor_plugin_src.js | 72 +- .../plugins/autosave/editor_plugin.js | 2 +- .../plugins/autosave/editor_plugin_src.js | 23 +- .../tiny_mce/plugins/autosave/langs/en.js | 0 .../tiny_mce/plugins/bbcode/editor_plugin.js | 156 +- .../plugins/bbcode/editor_plugin_cmp.js | 1 - .../plugins/bbcode/editor_plugin_src.js | 0 .../plugins/contextmenu/editor_plugin.js | 2 +- .../plugins/contextmenu/editor_plugin_src.js | 56 +- .../plugins/directionality/editor_plugin.js | 0 .../directionality/editor_plugin_src.js | 0 .../plugins/emotions/editor_plugin.js | 0 .../plugins/emotions/editor_plugin_src.js | 0 .../tiny_mce/plugins/emotions/emotions.htm | 62 +- .../plugins/emotions/img/smiley-cool.gif | Bin .../plugins/emotions/img/smiley-cry.gif | Bin .../emotions/img/smiley-embarassed.gif | Bin .../emotions/img/smiley-foot-in-mouth.gif | Bin 344 -> 342 bytes .../plugins/emotions/img/smiley-frown.gif | Bin .../plugins/emotions/img/smiley-innocent.gif | Bin .../plugins/emotions/img/smiley-kiss.gif | Bin .../plugins/emotions/img/smiley-laughing.gif | Bin 344 -> 343 bytes .../emotions/img/smiley-money-mouth.gif | Bin .../plugins/emotions/img/smiley-sealed.gif | Bin 325 -> 323 bytes .../plugins/emotions/img/smiley-smile.gif | Bin 345 -> 344 bytes .../plugins/emotions/img/smiley-surprised.gif | Bin 342 -> 338 bytes .../emotions/img/smiley-tongue-out.gif | Bin .../plugins/emotions/img/smiley-undecided.gif | Bin .../plugins/emotions/img/smiley-wink.gif | Bin 351 -> 350 bytes .../plugins/emotions/img/smiley-yell.gif | Bin .../tiny_mce/plugins/emotions/js/emotions.js | 21 + .../tiny_mce/plugins/emotions/langs/en_dlg.js | 21 +- .../tiny_mce/plugins/example/dialog.htm | 0 .../tiny_mce/plugins/example/editor_plugin.js | 0 .../plugins/example/editor_plugin_src.js | 0 .../tiny_mce/plugins/example/img/example.gif | Bin .../tiny_mce/plugins/example/js/dialog.js | 0 .../tiny_mce/plugins/example/langs/en.js | 0 .../tiny_mce/plugins/example/langs/en_dlg.js | 0 .../example_dependency/editor_plugin.js | 1 + .../example_dependency/editor_plugin_src.js | 50 + .../plugins/fullpage/css/fullpage.css | 45 +- .../plugins/fullpage/editor_plugin.js | 2 +- .../plugins/fullpage/editor_plugin_src.js | 378 +- .../tiny_mce/plugins/fullpage/fullpage.htm | 348 +- .../tiny_mce/plugins/fullpage/js/fullpage.js | 637 +- .../tiny_mce/plugins/fullpage/langs/en_dlg.js | 86 +- .../plugins/fullscreen/editor_plugin.js | 2 +- .../plugins/fullscreen/editor_plugin_src.js | 16 +- .../plugins/fullscreen/fullscreen.htm | 3 +- .../tiny_mce/plugins/iespell/editor_plugin.js | 0 .../plugins/iespell/editor_plugin_src.js | 0 .../plugins/inlinepopups/editor_plugin.js | 2 +- .../plugins/inlinepopups/editor_plugin_src.js | 96 +- .../skins/clearlooks2/img/alert.gif | Bin 818 -> 810 bytes .../skins/clearlooks2/img/button.gif | Bin 280 -> 272 bytes .../skins/clearlooks2/img/buttons.gif | Bin .../skins/clearlooks2/img/confirm.gif | Bin 915 -> 907 bytes .../skins/clearlooks2/img/corners.gif | Bin 911 -> 909 bytes .../skins/clearlooks2/img/horizontal.gif | Bin .../skins/clearlooks2/img/vertical.gif | Bin 92 -> 84 bytes .../inlinepopups/skins/clearlooks2/window.css | 2 +- .../plugins/inlinepopups/template.htm | 0 .../plugins/insertdatetime/editor_plugin.js | 0 .../insertdatetime/editor_plugin_src.js | 0 .../tiny_mce/plugins/layer/editor_plugin.js | 2 +- .../plugins/layer/editor_plugin_src.js | 60 +- .../plugins/legacyoutput/editor_plugin.js | 2 +- .../plugins/legacyoutput/editor_plugin_src.js | 59 +- .../tiny_mce/plugins/lists/editor_plugin.js | 1 + .../plugins/lists/editor_plugin_src.js | 951 + .../tiny_mce/plugins/media/css/content.css | 6 - .../tiny_mce/plugins/media/css/media.css | 9 +- .../tiny_mce/plugins/media/editor_plugin.js | 2 +- .../plugins/media/editor_plugin_src.js | 1068 +- .../tiny_mce/plugins/media/img/flash.gif | Bin 241 -> 0 bytes .../tiny_mce/plugins/media/img/flv_player.swf | Bin 11668 -> 0 bytes .../tiny_mce/plugins/media/img/quicktime.gif | Bin 303 -> 0 bytes .../tiny_mce/plugins/media/img/shockwave.gif | Bin 387 -> 0 bytes .../tiny_mce/plugins/media/js/embed.js | 0 .../tiny_mce/plugins/media/js/media.js | 1006 +- .../tiny_mce/plugins/media/langs/en_dlg.js | 104 +- .../jscripts/tiny_mce/plugins/media/media.htm | 677 +- .../tiny_mce/plugins/media/moxieplayer.swf | Bin 0 -> 19980 bytes .../plugins/nonbreaking/editor_plugin.js | 2 +- .../plugins/nonbreaking/editor_plugin_src.js | 7 +- .../plugins/noneditable/editor_plugin.js | 2 +- .../plugins/noneditable/editor_plugin_src.js | 452 +- .../plugins/pagebreak/css/content.css | 1 - .../plugins/pagebreak/editor_plugin.js | 2 +- .../plugins/pagebreak/editor_plugin_src.js | 5 +- .../tiny_mce/plugins/pagebreak/img/trans.gif | Bin 43 -> 0 bytes .../tiny_mce/plugins/paste/editor_plugin.js | 2 +- .../plugins/paste/editor_plugin_src.js | 393 +- .../tiny_mce/plugins/paste/js/pastetext.js | 0 .../tiny_mce/plugins/paste/js/pasteword.js | 0 .../tiny_mce/plugins/paste/langs/en_dlg.js | 6 +- .../tiny_mce/plugins/paste/pastetext.htm | 0 .../tiny_mce/plugins/paste/pasteword.htm | 0 .../tiny_mce/plugins/preview/editor_plugin.js | 0 .../plugins/preview/editor_plugin_src.js | 0 .../tiny_mce/plugins/preview/example.html | 0 .../plugins/preview/jscripts/embed.js | 0 .../tiny_mce/plugins/preview/preview.html | 0 .../tiny_mce/plugins/print/editor_plugin.js | 0 .../plugins/print/editor_plugin_src.js | 0 .../tiny_mce/plugins/save/editor_plugin.js | 0 .../plugins/save/editor_plugin_src.js | 0 .../searchreplace/css/searchreplace.css | 0 .../plugins/searchreplace/editor_plugin.js | 2 +- .../searchreplace/editor_plugin_src.js | 4 + .../plugins/searchreplace/js/searchreplace.js | 24 +- .../plugins/searchreplace/langs/en_dlg.js | 17 +- .../plugins/searchreplace/searchreplace.htm | 33 +- .../plugins/spellchecker/css/content.css | 0 .../plugins/spellchecker/editor_plugin.js | 2 +- .../plugins/spellchecker/editor_plugin_src.js | 159 +- .../plugins/spellchecker/img/wline.gif | Bin .../tiny_mce/plugins/style/css/props.css | 1 + .../tiny_mce/plugins/style/editor_plugin.js | 2 +- .../plugins/style/editor_plugin_src.js | 22 +- .../tiny_mce/plugins/style/js/props.js | 90 +- .../tiny_mce/plugins/style/langs/en_dlg.js | 64 +- .../jscripts/tiny_mce/plugins/style/props.htm | 918 +- .../tiny_mce/plugins/style/readme.txt | 19 + .../plugins/tabfocus/editor_plugin.js | 2 +- .../plugins/tabfocus/editor_plugin_src.js | 234 +- .../jscripts/tiny_mce/plugins/table/cell.htm | 30 +- .../tiny_mce/plugins/table/css/cell.css | 0 .../tiny_mce/plugins/table/css/row.css | 0 .../tiny_mce/plugins/table/css/table.css | 0 .../tiny_mce/plugins/table/editor_plugin.js | 2 +- .../plugins/table/editor_plugin_src.js | 2553 +- .../tiny_mce/plugins/table/js/cell.js | 55 +- .../tiny_mce/plugins/table/js/merge_cells.js | 0 .../jscripts/tiny_mce/plugins/table/js/row.js | 36 +- .../tiny_mce/plugins/table/js/table.js | 90 +- .../tiny_mce/plugins/table/langs/en_dlg.js | 75 +- .../tiny_mce/plugins/table/merge_cells.htm | 22 +- .../jscripts/tiny_mce/plugins/table/row.htm | 21 +- .../jscripts/tiny_mce/plugins/table/table.htm | 107 +- .../tiny_mce/plugins/template/blank.htm | 0 .../plugins/template/css/template.css | 0 .../plugins/template/editor_plugin.js | 0 .../plugins/template/editor_plugin_src.js | 0 .../tiny_mce/plugins/template/js/template.js | 2 +- .../tiny_mce/plugins/template/langs/en_dlg.js | 16 +- .../tiny_mce/plugins/template/template.htm | 0 .../plugins/visualblocks/css/visualblocks.css | 19 + .../plugins/visualblocks/editor_plugin.js | 1 + .../plugins/visualblocks/editor_plugin_src.js | 63 + .../plugins/visualchars/editor_plugin.js | 2 +- .../plugins/visualchars/editor_plugin_src.js | 33 +- .../plugins/wordcount/editor_plugin.js | 2 +- .../plugins/wordcount/editor_plugin_src.js | 74 +- .../tiny_mce/plugins/xhtmlxtras/abbr.htm | 11 +- .../tiny_mce/plugins/xhtmlxtras/acronym.htm | 11 +- .../plugins/xhtmlxtras/attributes.htm | 11 +- .../tiny_mce/plugins/xhtmlxtras/cite.htm | 9 +- .../plugins/xhtmlxtras/css/attributes.css | 0 .../tiny_mce/plugins/xhtmlxtras/css/popup.css | 0 .../tiny_mce/plugins/xhtmlxtras/del.htm | 17 +- .../plugins/xhtmlxtras/editor_plugin.js | 2 +- .../plugins/xhtmlxtras/editor_plugin_src.js | 24 +- .../tiny_mce/plugins/xhtmlxtras/ins.htm | 21 +- .../tiny_mce/plugins/xhtmlxtras/js/abbr.js | 0 .../tiny_mce/plugins/xhtmlxtras/js/acronym.js | 0 .../plugins/xhtmlxtras/js/attributes.js | 17 +- .../tiny_mce/plugins/xhtmlxtras/js/cite.js | 0 .../tiny_mce/plugins/xhtmlxtras/js/del.js | 14 +- .../plugins/xhtmlxtras/js/element_common.js | 8 +- .../tiny_mce/plugins/xhtmlxtras/js/ins.js | 17 +- .../plugins/xhtmlxtras/langs/en_dlg.js | 33 +- .../tiny_mce/themes/advanced/about.htm | 8 +- .../tiny_mce/themes/advanced/anchor.htm | 10 +- .../tiny_mce/themes/advanced/charmap.htm | 85 +- .../tiny_mce/themes/advanced/color_picker.htm | 19 +- .../themes/advanced/editor_template.js | 2 +- .../themes/advanced/editor_template_src.js | 431 +- .../tiny_mce/themes/advanced/image.htm | 102 +- .../themes/advanced/img/colorpicker.jpg | Bin 3189 -> 2584 bytes .../tiny_mce/themes/advanced/img/flash.gif | Bin 0 -> 239 bytes .../tiny_mce/themes/advanced/img/icons.gif | Bin .../tiny_mce/themes/advanced/img/iframe.gif | Bin 0 -> 600 bytes .../advanced}/img/pagebreak.gif | Bin .../themes/advanced/img/quicktime.gif | Bin 0 -> 301 bytes .../advanced}/img/realmedia.gif | Bin .../themes/advanced/img/shockwave.gif | Bin 0 -> 384 bytes .../media => themes/advanced}/img/trans.gif | Bin .../tiny_mce/themes/advanced/img/video.gif | Bin 0 -> 597 bytes .../advanced}/img/windowsmedia.gif | Bin .../tiny_mce/themes/advanced/js/about.js | 1 + .../tiny_mce/themes/advanced/js/anchor.js | 13 +- .../tiny_mce/themes/advanced/js/charmap.js | 40 +- .../themes/advanced/js/color_picker.js | 598 +- .../tiny_mce/themes/advanced/js/image.js | 18 +- .../tiny_mce/themes/advanced/js/link.js | 11 +- .../themes/advanced/js/source_editor.js | 48 +- .../tiny_mce/themes/advanced/langs/en.js | 63 +- .../tiny_mce/themes/advanced/langs/en_dlg.js | 52 +- .../tiny_mce/themes/advanced/link.htm | 55 +- .../tiny_mce/themes/advanced/shortcuts.htm | 47 + .../themes/advanced/skins/default/content.css | 32 +- .../themes/advanced/skins/default/dialog.css | 0 .../advanced/skins/default/img/buttons.png | Bin 3274 -> 3133 bytes .../advanced/skins/default/img/items.gif | Bin 70 -> 64 bytes .../advanced/skins/default/img/menu_arrow.gif | Bin .../advanced/skins/default/img/menu_check.gif | Bin .../advanced/skins/default/img/progress.gif | Bin .../advanced/skins/default/img/tabs.gif | Bin 1326 -> 1322 bytes .../themes/advanced/skins/default/ui.css | 0 .../advanced/skins/highcontrast/content.css | 25 + .../advanced/skins/highcontrast/dialog.css | 105 + .../themes/advanced/skins/highcontrast/ui.css | 102 + .../themes/advanced/skins/o2k7/content.css | 16 +- .../themes/advanced/skins/o2k7/dialog.css | 1 + .../advanced/skins/o2k7/img/button_bg.png | Bin 5859 -> 2766 bytes .../skins/o2k7/img/button_bg_black.png | Bin 3736 -> 651 bytes .../skins/o2k7/img/button_bg_silver.png | Bin 5358 -> 2084 bytes .../themes/advanced/skins/o2k7/ui.css | 15 +- .../themes/advanced/skins/o2k7/ui_black.css | 2 +- .../themes/advanced/skins/o2k7/ui_silver.css | 2 +- .../themes/advanced/source_editor.htm | 6 +- .../tiny_mce/themes/simple/editor_template.js | 2 +- .../themes/simple/editor_template_src.js | 3 +- .../tiny_mce/themes/simple/img/icons.gif | Bin 1440 -> 806 bytes .../tiny_mce/themes/simple/langs/en.js | 12 +- .../themes/simple/skins/default/content.css | 0 .../themes/simple/skins/default/ui.css | 0 .../themes/simple/skins/o2k7/content.css | 0 .../simple/skins/o2k7/img/button_bg.png | Bin .../tiny_mce/themes/simple/skins/o2k7/ui.css | 0 library/tinymce/jscripts/tiny_mce/tiny_mce.js | 2 +- .../jscripts/tiny_mce/tiny_mce_popup.js | 2 +- .../tinymce/jscripts/tiny_mce/tiny_mce_src.js | 20360 +++++++++------- .../tiny_mce/utils/editable_selects.js | 2 +- .../jscripts/tiny_mce/utils/form_utils.js | 18 +- .../tinymce/jscripts/tiny_mce/utils/mctabs.js | 105 +- .../jscripts/tiny_mce/utils/validate.js | 38 +- 296 files changed, 21554 insertions(+), 14874 deletions(-) create mode 100755 library/mcefixes/plugins.bbcode.editor_plugin_src.js create mode 100755 library/mcefixes/themes.advanced.img.icons.gif create mode 100755 library/mcefixes/themes.advanced.skins.default.dialog.css create mode 100755 library/mcefixes/themes.advanced.skins.default.ui.css mode change 100755 => 100644 library/tinymce/changelog.txt create mode 100644 library/tinymce/examples/accessibility.html mode change 100755 => 100644 library/tinymce/examples/css/content.css mode change 100755 => 100644 library/tinymce/examples/css/word.css mode change 100755 => 100644 library/tinymce/examples/custom_formats.html mode change 100755 => 100644 library/tinymce/examples/full.html mode change 100755 => 100644 library/tinymce/examples/index.html mode change 100755 => 100644 library/tinymce/examples/lists/image_list.js mode change 100755 => 100644 library/tinymce/examples/lists/link_list.js mode change 100755 => 100644 library/tinymce/examples/lists/media_list.js mode change 100755 => 100644 library/tinymce/examples/lists/template_list.js mode change 100755 => 100644 library/tinymce/examples/media/logo.jpg mode change 100755 => 100644 library/tinymce/examples/media/logo_over.jpg mode change 100755 => 100644 library/tinymce/examples/media/sample.avi mode change 100755 => 100644 library/tinymce/examples/media/sample.dcr create mode 100644 library/tinymce/examples/media/sample.flv mode change 100755 => 100644 library/tinymce/examples/media/sample.mov mode change 100755 => 100644 library/tinymce/examples/media/sample.ram mode change 100755 => 100644 library/tinymce/examples/media/sample.rm mode change 100755 => 100644 library/tinymce/examples/media/sample.swf mode change 100755 => 100644 library/tinymce/examples/menu.html mode change 100755 => 100644 library/tinymce/examples/simple.html mode change 100755 => 100644 library/tinymce/examples/skins.html mode change 100755 => 100644 library/tinymce/examples/templates/layout1.htm mode change 100755 => 100644 library/tinymce/examples/templates/snippet1.htm delete mode 100755 library/tinymce/examples/translate.html mode change 100755 => 100644 library/tinymce/examples/word.html mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/langs/en.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/license.txt mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/advlist/editor_plugin_src.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/autosave/langs/en.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_cmp.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-yell.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/img/example.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/media/css/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/css/media.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/media/img/flash.gif delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/media/img/quicktime.gif delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/media/img/shockwave.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/js/media.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/media/media.htm create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js delete mode 100755 library/tinymce/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/preview/example.html mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/preview/preview.html mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/spellchecker/css/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/spellchecker/img/wline.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/style/css/props.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/style/js/props.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/style/props.htm create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/style/readme.txt mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/cell.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/css/row.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/css/table.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/js/merge_cells.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/js/row.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/js/table.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/row.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/table/table.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/blank.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/css/template.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/js/template.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/template/template.htm create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js create mode 100644 library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/about.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/image.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif rename library/tinymce/jscripts/tiny_mce/{plugins/pagebreak => themes/advanced}/img/pagebreak.gif (100%) mode change 100755 => 100644 create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif rename library/tinymce/jscripts/tiny_mce/{plugins/media => themes/advanced}/img/realmedia.gif (100%) mode change 100755 => 100644 create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif rename library/tinymce/jscripts/tiny_mce/{plugins/media => themes/advanced}/img/trans.gif (100%) mode change 100755 => 100644 create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif rename library/tinymce/jscripts/tiny_mce/{plugins/media => themes/advanced}/img/windowsmedia.gif (100%) mode change 100755 => 100644 mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/link.htm create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/items.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/progress.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css create mode 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/tiny_mce.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/tiny_mce_popup.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/tiny_mce_src.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/utils/editable_selects.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/utils/form_utils.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/utils/mctabs.js mode change 100755 => 100644 library/tinymce/jscripts/tiny_mce/utils/validate.js diff --git a/library/mcefixes/plugins.bbcode.editor_plugin_src.js b/library/mcefixes/plugins.bbcode.editor_plugin_src.js new file mode 100755 index 0000000000..183f2bc68d --- /dev/null +++ b/library/mcefixes/plugins.bbcode.editor_plugin_src.js @@ -0,0 +1,258 @@ +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */ + +(function() { + tinymce.create('tinymce.plugins.BBCodePlugin', { + init : function(ed, url) { + var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase(); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t['_' + dialect + '_bbcode2html'](o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t['_' + dialect + '_bbcode2html'](o.content); + + if (o.get) + o.content = t['_' + dialect + '_html2bbcode'](o.content); + }); + }, + + getInfo : function() { + return { + longname : 'BBCode Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + // HTML -> BBCode in DFRN dialect + _dfrn_html2bbcode : function(s) { + s = tinymce.trim(s); + + function rep(re, str) { + + //modify code to keep stuff intact within [code][/code] blocks + //Waitman Gobble NO WARRANTY + + + var o = new Array(); + var x = s.split("[code]"); + var i = 0; + + var si = ""; + si = x.shift(); + si = si.replace(re,str); + o.push(si); + + for (i = 0; i < x.length; i++) { + var no = new Array(); + var j = x.shift(); + var g = j.split("[/code]"); + no.push(g.shift()); + si = g.shift(); + si = si.replace(re,str); + no.push(si); + o.push(no.join("[/code]")); + } + + s = o.join("[code]"); + + }; + + + + + /* oembed */ + function _h2b_cb(match) { + /* + function s_h2b(data) { + match = data; + } + $.ajax({ + type:"POST", + url: 'oembed/h2b', + data: {text: match}, + async: false, + success: s_h2b, + dataType: 'html' + }); + */ + + var f, g, tof = [], tor = []; + var find_spanc = /]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:]*>(.*?)<\/span *>)*.*?)<\/span *>/ig; + while (f = find_spanc.exec(match)) { + var find_a = /]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig; + if (g = find_a.exec(f[1])) { + var find_href = /href=[\"']([^\"']*)[\"']/ig; + var m2 = find_href.exec(g[1]); + if (m2[1]) { + tof.push(f[0]); + tor.push("[EMBED]" + m2[1] + "[/EMBED]"); + } + } + } + for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]); + + return match; + } + if (s.indexOf('class="oembed')>=0){ + //alert("request oembed html2bbcode"); + s = _h2b_cb(s); + } + + /* /oembed */ + + + // example: to [b] + rep(/(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]"); + rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); + rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); + rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img=$1x$2]$3[/img]"); + rep(//gi,"[img=$2x$1]$3[/img]"); + rep(//gi,"[img=$3x$2]$1[/img]"); + rep(//gi,"[img=$2x$3]$1[/img]"); + rep(//gi,"[img]$1[/img]"); + + rep(/
    (.*?)<\/ul>/gi,"[list]$1[/list]"); + rep(/
      (.*?)<\/ul>/gi,"[list=]$1[/list]"); + rep(/
        (.*?)<\/ul>/gi,"[list=1]$1[/list]"); + rep(/
          (.*?)<\/ul>/gi,"[list=i]$1[/list]"); + rep(/
            (.*?)<\/ul>/gi,"[list=I]$1[/list]"); + rep(/
              (.*?)<\/ul>/gi,"[list=a]$1[/list]"); + rep(/
                (.*?)<\/ul>/gi,"[list=A]$1[/list]"); + rep(/
              • (.*?)<\/li>/gi,'[li]$1[/li]'); + + rep(/(.*?)<\/code>/gi,"[code]$1[/code]"); + rep(/<\/(strong|b)>/gi,"[/b]"); + rep(/<(strong|b)>/gi,"[b]"); + rep(/<\/(em|i)>/gi,"[/i]"); + rep(/<(em|i)>/gi,"[i]"); + rep(/<\/u>/gi,"[/u]"); + rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); + rep(//gi,"[u]"); + rep(/]*>/gi,"[quote]"); + rep(/<\/blockquote>/gi,"[/quote]"); + rep(/
                /gi,"[hr]"); + rep(/
                /gi,"\n\n"); + rep(//gi,"\n\n"); + rep(/
                /gi,"\n"); + rep(/

                /gi,""); + rep(/<\/p>/gi,"\n"); + rep(/ /gi," "); + rep(/"/gi,"\""); + rep(/</gi,"<"); + rep(/>/gi,">"); + rep(/&/gi,"&"); + + return s; + }, + + // BBCode -> HTML from DFRN dialect + _dfrn_bbcode2html : function(s) { + s = tinymce.trim(s); + + + function rep(re, str) { + + //modify code to keep stuff intact within [code][/code] blocks + //Waitman Gobble NO WARRANTY + + + var o = new Array(); + var x = s.split("[code]"); + var i = 0; + + var si = ""; + si = x.shift(); + si = si.replace(re,str); + o.push(si); + + for (i = 0; i < x.length; i++) { + var no = new Array(); + var j = x.shift(); + var g = j.split("[/code]"); + no.push(g.shift()); + si = g.shift(); + si = si.replace(re,str); + no.push(si); + o.push(no.join("[/code]")); + } + + s = o.join("[code]"); + + }; + + + + + + // example: [b] to + rep(/\n/gi,"
                "); + rep(/\[b\]/gi,""); + rep(/\[\/b\]/gi,""); + rep(/\[i\]/gi,""); + rep(/\[\/i\]/gi,""); + rep(/\[u\]/gi,""); + rep(/\[\/u\]/gi,""); + rep(/\[hr\]/gi,"


                "); + rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"$2"); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"
                $2"); + rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,""); + rep(/\[img\](.*?)\[\/img\]/gi,""); + + rep(/\[list\](.*?)\[\/list\]/gi, '
                  $1
                '); + rep(/\[list=\](.*?)\[\/list\]/gi, '
                  $1
                '); + rep(/\[list=1\](.*?)\[\/list\]/gi, '
                  $1
                '); + rep(/\[list=i\](.*?)\[\/list\]/gi,'
                  $1
                '); + rep(/\[list=I\](.*?)\[\/list\]/gi, '
                  $1
                '); + rep(/\[list=a\](.*?)\[\/list\]/gi, '
                  $1
                '); + rep(/\[list=A\](.*?)\[\/list\]/gi, '
                  $1
                '); + rep(/\[li\](.*?)\[\/li\]/gi, '
              • $1
              • '); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); + rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"$2"); + rep(/\[code\](.*?)\[\/code\]/gi,"$1"); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"
                $1
                "); + + /* oembed */ + function _b2h_cb(match, url) { + url = bin2hex(url); + function s_b2h(data) { + match = data; + } + $.ajax({ + url: 'oembed/b2h?url=' + url, + async: false, + success: s_b2h, + dataType: 'html' + }); + return match; + } + s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb); + + /* /oembed */ + + return s; + } + }); + + // Register plugin + tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); +})(); diff --git a/library/mcefixes/themes.advanced.img.icons.gif b/library/mcefixes/themes.advanced.img.icons.gif new file mode 100755 index 0000000000000000000000000000000000000000..efb356c417872141ac1ddce5916b92bc852dbd00 GIT binary patch literal 11776 zcmWlfi$Bwk_s8G6UtIQ{``uhZgekWV(%hHpkVv&Ha+gTyn4G znxu?UD%F%q(YFyInqR;3FP!syo!8@aj>}$W%m0GrU^c*49PnRoUscNx004_WqqmuQ z6pgLWbNYE}Q%)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themes.advanced.skins.default.dialog.css b/library/mcefixes/themes.advanced.skins.default.dialog.css new file mode 100755 index 0000000000..f01222650e --- /dev/null +++ b/library/mcefixes/themes.advanced.skins.default.dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/library/mcefixes/themes.advanced.skins.default.ui.css b/library/mcefixes/themes.advanced.skins.default.ui.css new file mode 100755 index 0000000000..5f1f96448c --- /dev/null +++ b/library/mcefixes/themes.advanced.skins.default.ui.css @@ -0,0 +1,213 @@ +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr; background:#FFF} +.defaultSkin iframe {display:block; background:#FFF} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;} +.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} diff --git a/library/tinymce/changelog.txt b/library/tinymce/changelog.txt old mode 100755 new mode 100644 index bcd3f294c4..ec712077a1 --- a/library/tinymce/changelog.txt +++ b/library/tinymce/changelog.txt @@ -1,3 +1,456 @@ +Version 3.5b2 (2012-03-15) + Rewrote the enter key logic to normalize browser behavior. + Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option. + Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node. + Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls. + Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection. + Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string. + Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default. +Version 3.5b1 (2012-03-08) + Added new event class that is faster and enables support for faking events. + Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema. + Added new schema option and support for the HTML5 schema. + Added new visualblocks plugin that shows html5 blocks with visual borders. + Added new types and selector options to make it easier to create editor instances with different configs. + Added new preview of formatting options in various listboxes. + Added new preview_styles option that enables control over what gets previewed. + Fixed bug where content css would be loaded twice into iframe. + Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed. + Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined. + Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting. + Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing. +Version 3.4.9.x (2012-02-xx) + Improved behaviour of backspacing into a table to be consistant across browsers and disable backspace when cursor immediately follows a table. + Improved edit CSS style plugin for single and multiple block selection and provide option to apply style to only selected text. + Fixed bug in Chrome where moving caret down in table and pasting throws errors. + Corrected reference to TinyMCE trim function. + Fixed bug where Ignore All in IE did not remove the underline from the selected word. + Fixed bug in html source editor word wrap option not wrapping text in Webkit browsers. + Fixed bug where it was possible to insert an invalid colour in the color pop-up dialog. + Fixed bug in Webkit where if anchor is on last line by itself caret can not be placed after it. +Version 3.4.9 (2012-02-23) + Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete. + Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents. + Fixed bug where pressing enter on end of list item with a heading would create a new item with heading. + Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled. + Fixed bug in Gecko where undo wasn't added when focus was lost. + Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line. + Fixed bug where right-click on formatted text in IE selected the entire line. + Fixed bug where text ending with space could not be unformatted in IE. + Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used. + Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts. + Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config. + Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser. + Fixed bug where content css files where loaded twice into the iframe. + Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse. +Version 3.4.8 (2012-02-02) + Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text. + Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked. + Fixed bug where wrong text align buttons are active when multiple block elements are selected. + Fixed bug where selected link not showing in target field of link dialog in some selection cases. + Use settings for remove_trailing_br so this can be turned off instead of hard coding the value. + Fixed bug in IE where the media plugin displayed null text when some values aren't filled in. + Added API method 'onSetAttrib' that fires when the attribute value on a node changes. + Fix font size dropdown value not being updated when text already has a font size in the advanced template. + Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times. + Fixed bug where caret cannot be placed after table if table is at end of document in IE. + Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur. + Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly. + Fixed bug where a stranded bullet point would get created in WebKit. + Fixed bug where selecting text in a blockquote and pressing backspace toggles the style. + Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property. + Fix white space in between spans from being deleted. + Fixed bug where scrollbars where visible in the character map dialog on Gecko. + Fixed issue with missing translation for one of the emoticons. + Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev. + Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout. + Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace. + Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber. + Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu. +Version 3.4.7 (2011-11-03) + Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office. + Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text. + Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row. + Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10. + Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph. + Fix new list items in IE8 not displayed on a new line when list contains nested list items. + Clear formatting in table cell breaks the cell. + Made media type list localisable. + Fix out of memory error when using prototype in media dialog. + Fixed bug where could not add a space in the middle of a th cell. + Fixed bug where adding a bullet between two existing bullets adds an extra one + Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in. + Fixed bug where pressing enter on an empty list item does not outdent properly in FF + Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell + Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox. + Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph. + Fixed bug where deleting part of the link text can cause a link with no destination to be saved. + Fixed bug where css style border widths wasn't handled correctly in table dialog. + Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop. + Fixed bug where scripts with custom script types wasn't properly passed though the editor. + Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled. + Made emoticons dialog use the keyboard naviation. + Added navigation instructions to the symbols dialog. + Added ability to set default values for the media plugin. + Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties. + Fixed bug where the symbols dialog was not accessible. + Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility. + Fixed bug where the advanced color picker wasn't working properly on FF 7. + Fixed issue where the advanced color picker was producing uppercase hex codes. + Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements. + Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit. + Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes. +Version 3.4.6 (2011-09-29) + Fixed bug where list items were being created for empty divs. + Added support in Media plugin for audio media using the embed tag + Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read. + Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers) + Fixed bug where classid attribute was not being checked from embed objects. + Fixed bug in jsrobot tests with intermittently failing. + Fixed bug where anchors wasn't updated properly if you edited them using IE 8. + Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor. + Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them. + Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin. + Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin. + Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin. + Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko. + Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly. + Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers. +Version 3.4.5 (2011-09-06) + Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes. + Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved. + Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats. + Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly. + Fixed bug in WebKit where console messages would be logged when deleting an empty document. + Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list + Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements. + Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases. + Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM. + Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized. + Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control. + Fixed bug where adjacent links would get merged on IE due to bugs in their link command. + Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe. + Fixed bug where floated images in WebKit wouldn't get properly linked. + Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode. + Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P. + Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit. + Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit. + Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7. + Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit. + Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents. + Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text. + Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled. + Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin. + Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped. +Version 3.4.4 (2011-08-04) + Added new html5 audio support. Patch contributed by Ronald M. Clifford. + Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin. + Fixed selection to match visual selection before applying formatting changes. + Fixed browser specific bugs in lists for WebKit and IE. + Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel. + Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser. + Fixed bug where formatting change would be lost after pressing enter. + Fixed bug in WebKit where deleting across blocks would add extra styles. + Fixed bug where moving cursor vertically in tables in WebKit wasn't working. + Fixed bug in IE where deleting would cause error in console. + Fixed bug where the formatter was not applying formats across list elements. + Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed. + Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden. + Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko. + Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements. + Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event. + Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them. + Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog. + Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location. +Version 3.4.3.2 (2011-06-30) + Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit. + Fixed bugs in tests in firefox5 and WebKit. + Fixed bug where selection of table cells would produce an exception on Gecko. + Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden. + Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup. + Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection. + Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes. + Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document. + Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them. + Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed. + Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element. + Fixed performance issue with the noneditable plugin where it would enable/disable controls to often. +Version 3.4.3.1 (2011-06-16) + Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin. + Fixed bug where custom buttons were not being rendered correctly when in high contrast mode. + Added support for iOS 5 that now supporting contentEditable in it's latest beta. + Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output. + Fixed bug where custom_elements option wasn't working properly on IE browsers. + Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements. + Fixed bug where attributes with wasn't properly encoded as XML entities. +Version 3.4.3 (2011-06-09) + Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location. + Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly. + Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8. + Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs. + Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied. + Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page. + Fixed bug where applying a heading style to a list item would cascade style to children list items. + Fixed bug where Editor loses focus when backspacing and changing styles in WebKit. + Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided. + Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari. + Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk. + Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded. + Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ). + Added possibility to change properties of all table cells in a column. + Added external_image_list option to get images list from user-defined variable or function. + Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome. + Fixed bug where table size inputs were to small for values with size units. + Fixed bug where table cell/row size input values were not validated. + Fixed bug where menu item line-height would be set to wrong value by external styles. + Fixed bug where hasUndo() would return wrong answer. + Fixed bug where page title would be set to undefined by fullpage plugin. + Fixed bug where HTML5 video properties were not updated in embedded media settings. + Fixed bug where HTML comment on the first line would cause an error. + Fixed bug where spellchecker menu was positioned incorrectly on IE. + Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list. + Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped. + Fixed bug where numeric entities with leading zeros would produce incorrect decoding. + Fixed bug where hexadecimal entities wasn't properly decoded. + Fixed bug where bookmarks wasn't properly stored/restored on undo/redo. + Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents. + Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements. + Fixed so contentEditable is used for the body of the editor if it's supported. + Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null. + Fixed performance issue with mceInsertCommand and inserting very simple contents. + Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic. + Fixed performance issue with table plugin where it checked for selected cells to often. + Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers. + Fixed bug where Gecko would remove single paragraphs if there where contents before/after it. + Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin. +Version 3.4.2 (2011-04-07) + Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text. + Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz. + Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers. + Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser. + Fixed bug where blocks containing a single anchor element would be treated as empty. + Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed. + Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed. + Fixed bug where image border color/style values were overwritten by advimage plugin. + Fixed bug where setting border in advimage plugin would throw error in IE. + Fixed bug where empty anchors list in link settings wasn't hidden. + Fixed bug where xhtmlextras popups were missing localized popup-size parameters. + Fixed bug where the context menu wouldn't select images on WebKit browsers. + Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior. + Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control. + Fixed bug where contextmenu wasn't disabled on noneditable elements. + Fixed bug where getStyle function would trigger error when called on element without style property. + Fixed bug where editor fail to load if Javascript Compressor was used. + Fixed bug where list-style-type=lower-greek would produce errors in IE<8. + Fixed bug where spellchecker plugin would produce errors on IE6-7. + Fixed bug where theme_advanced_containers configuration option causes error. + Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value. + Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size. + Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog. +Version 3.4.1 (2011-03-24) + Added significantly improved list handling via the new 'lists' plugin. + Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default. + Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color. + Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour. + Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled. + Fixed bug where selection locations on undo/redo didn't work correctly on specific contents. + Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe. + Fixed bug where some ascii numeric entities wasn't properly decoded. + Fixed bug where some non western language codes wasn't properly decoded/encoded. + Fixed bug where undo levels wasn't created when deleting contents on IE. + Fixed bug where the initial undo levels bookmark wasn't updated correctly. + Fixed bug where search/replace wouldn't be scoped to editor instances on IE8. + Fixed bug where IE9 would produce two br elements after block elements when pasting. + Fixed bug where IE would place the caret at an incorrect position after a paste operation. + Fixed bug where a paste operation using the keyboard would add an extra undo level. + Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted. + Fixed bug where the table plugin couldn't correctly handle invalid table structures. + Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin. + Fixed bug where toggle states on some of the list boxes didn't update correctly. + Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10. + Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin. + Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid. + Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme. + Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome. + Fixed bug with references to non-existing images in css of fullpage plugin. + Fixed bug where item could be unselected in spellchecker's language selector. + Fixed bug where some mispelled words could be not highlighted using spellchecker plugin. + Fixed bug where spellchecking would merge some words on IE. + Fixed bug where spellchecker context menu was not always positioned correctly. + Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled. + Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents. + Fixed bug where selecting the whole table would enable table tools for cells and rows. + Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin. + Fixed bug where setting text color in fullpage plugin doesn't work. + Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly. + Fixed bug where black spade suit character was not included in special character selector. + Fixed bug where setting invalid values for table cell size would throw an error in IE. + Fixed bug where spellchecking would remove whitespace characters from PRE block in IE. + Fixed bug where HR was inserted inside P elements instead of splitting them. + Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes. + Fixed bug where bullet lists weren't always detected correctly. + Fixed bug where deleting some paragraphs on IE would cause an exception. + Fixed bug where the json encoder logic wouldn't properly encode \ characters. + Fixed bug where the onChange event would be fired when the editor was first initialized. + Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class. + Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences. + Fixed issue where styles were not included when using the full page plugin. + Fixed issue where drag/drop operations wasn't properly added to the undo levels. + Fixed issue where colors wasn't correctly applied to elements with underline decoration. + Fixed issue where deleting some paragraphs on IE would cause an exception. +Version 3.4 (2011-03-10) + Added accessibility example with various accessibility options contributed by Ephox. + Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin. + Fixed bug where the image.htm had some strange td artifacts probably due to auto merging. + Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method. + Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent. + Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode. + Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode. + Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode. + Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox. + Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme. + Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x. + Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right. + Fixed bug where the formatter would align images when the selection range was collapsed. + Fixed bug where the image button would be active when the selection range was collapsed. + Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic. + Fixed bug where the table cell/row dialogs would produce empty attributes. + Fixed bug where the tfoot wouldn't be added to the top of the table. + Fixed bug where the formatter would merge siblings with white space between them. + Fixed bug where pasting headers and paragraphs would produce an extra paragraph. + Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color. + Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting. + Fixed bug where multiple BR elements at end of block elements where removed. + Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages. + Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode. + Fixed bug where the search/replace plugin wouldn't work correctly on IE 9. + Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox. + Fixed so the values entered in the color picker are forced to hex values. + Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade. + Removed obsolete calls in various plugins to the mceBeginUndoLevel command. +Version 3.4b3 (2011-02-10) + Added WAI-ARIA support for the main UI and dialogs this feature was contributed by Ephox. + Added iframe support to media plugin in order to handle the new YouTube HTML5 video formats. + Fixed bug where anchors would wrap the text contents after it due to a bug in the DomParser logic. + Fixed bug where the selected state wouldn't be removed on ListBox controls when a menu item was selected. + Fixed bug where IE could throw an unspecified error exception when the getBookmark logic was executed. + Fixed bug where IE would throw an invalid argument error when focus was applied to an empty editor instance. + Fixed bug where applying inline format wouldn't work if the start cell in the selection was empty. + Fixed bug where auto detection logic for YouTube and Google Video wouldn't work in the new media plugin. + Fixed bug where td elements would get a colspan/rowspan of 1 when created by the table plugin. + Fixed bug where removal/padding of empty elements wasn't handled correctly. + Fixed bug where internal elements would show up in element path. + Fixed bug where internal elements would get serialized as valid output. + Fixed bug where color wasn't correctly applied to anchor elements. + Fixed bug where float option in the style plugin dialog wouldn't be handled correctly on WebKit. + Fixed bug where the tinymce.dom.TreeWalker prev function wouldn't walk the DOM correctly. + Fixed bug where mceInsertContent command could produce empty block elements after the inserted content. + Fixed bug where mceInsertContent command wouldn't apply visual aids on tables and similar elements. + Fixed bug where empty block elements would get double br bogus elements in them. + Fixed bug where the color menu wouldn't apply the color correctly on IE when the viewport was to small. + Fixed bug where right clicking out side the body element of the editor iframe would prevent paste from working on IE. + Fixed bug where the onContextMenu event wouldn't fire correctly on IE if you clicked out side the body element. + Fixed bug where the onContextMenu event wouldn't fire correctly on modern Opera versions that now support it by default. + Fixed bug where legacy content wasn't converted correctly when inserted using mceInsertContent or through the source dialog. + Fixed bug where resizing images or tables wouldn't update the style attribute correctly or leave data-mce prefixed attributes. + Fixed bug where adding links wouldn't work correctly when using TinyMCE jQuery version with jQuery 1.5. + Fixed bug where single quotes inside param elements wasn't treated correctly by the media plugin. + Fixed bug where pasting plain text in WebKit wouldn't work correctly. It will now auto detect the WebKit bug and use plain text mode. + Fixed bug where the DomParser would fail to move out invalid elements within invalid elements on complex contents. + Fixed bug where paste as plain text would not decode html entities properly. + Fixed bug where large paragraphs would cause incorrect scrolling behavior if you would split them using enter. + Fixed bug where the SaxParser wouldn't properly parse some specific short ended elements. + Fixed so mceReplaceContent supports caret position and makes sure that the contents inserted gets validated. + Fixed so unnecessary traling br elements in blocks gets removed on Gecko/WebKit when using mceInsertContent command. + Moved some plugin css contents into the skin content css files to reduce the number of http requests. + Moved some plugin specific images into the theme img directory since they can then be shared. +Version 3.4b2 (2011-01-13) + Added new custom flash player, this player supports mp4 and flv and has skin support. + Fixed so mceInsertContent handles context correctly to enforce valid nesting of elements. + Fixed bug where scrolling would become jerky on IE on some contents. + Fixed bug where paste as plain text would throw exception of missing entities setting. + Fixed bug where anchor nodes where removed by the new serializer engine. + Fixed bug where IE would crash if when backspace where used on some specific contents. + Fixed bug where pasting of plain text in WebKit would result in merging of text lines. + Fixed bug where it wasn't possible to delete images or tables using backspace on IE9. + Fixed bug where urls in styles would generate a JS error due to incorrect scope. + Fixed bug where copy paste from Java applications would produce extra contents in FF on Mac. + Fixed bug where the verify_html option wouldn't allow all elements and attributes. +Version 3.4b1 (2010-12-20) + Added new serialization engine that increases performance and enforces valid output according to the specified schema settings. + Added new HTML parser logic used by the serialization engine and can handle malformed html contents. + Added new valid_children config option, enables more fine grain control of elements can be inside other elements. + Added new entities encoding logic boost performance and will only encode entities based on context i.e. attributes/text nodes. + Added new protect setting that enables users to protect template items from being removed by the serializer logic. + Added new {$caret} marker for the mceInsertContent command. Makes it possible to move the caret to a specific position when inserting contents. + Added new validation of anchor names. Only valid W3C names will be accepted. + Replaced the internal _mce_ prefixed attributes to the more standard HTML5 data-mce- prefix. This will also resolve future browser santiaztion issues. + Fixed bug where the paste plugin wouldn't convert Word lists with more than 9 items to real ol lists. Patch contributed by Mike (yogaboy). + Fixed bug where clicking on a format title would produce errors if the current selection didn't have any formats. + Fixed bug where paste of simple texts wouldn't work correctly in Gecko using the paste plugin since it keeps block formatting. + Fixed bug where confirm dialogs didn't display correctly due to resent IE9 fixes. + Fixed bug where spaces in URLs wouldn't be properly encoded to %20 if the user entered them in the link dialogs. Patch contributed by Ephox. + Fixed bug where the image alignment buttons wouldn't reposition the resize handles on FF due to a browser issue. Patch contributed by Ephox. + Fixed bug where the compareBoundaryPoints method of the IE Range class didn't work correctly. Patch contributed by Ephox. + Fixed bug where selection of elements using double click wouldn't select the clicked element but rather the parent node on FF. Patch contributed by Ephox. + Fixed bug where IE would scroll the user to the current selection causing parent document to scroll as well. Patch contributed by Ephox. + Fixed bug where style compression would incorrectly compress items with different values. It now only compresses if the values are the same. Patch contributed by Ephox. + Fixed bug where FF would add non breaking spaces outside TD elements if formatting was applied to table cells. Patch contributed by Ephox. + Fixed bug where the caret position would be lost on WebKit browsers if you pasted images multiple times. Patch contributed by Ephox. + Fixed bug where non word contents like * would be counted as words in the wordcount pluging. Patch contributed by David Balatero. + Fixed bug where the toggle absolute button in the layer plugin wouldn't remove the existing internal style attribute first. + Fixed bug where the autosave plugin would generate an exception on IE if the user had disabled userdata persistence. + Fixed bug where the paste plugin would remove dashed classes on IE since the regexps didn't include that character. + Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance. + Fixed bug where applying block formats to empty elements wouldn't render correctly on IE. + Fixed bug where the searchreplace plugin would add a f or r character when shortcuts where used on IE while using default dialogs. + Fixed bug where Opera wouldn't load scripts correctly since the onreadystate would fire even though the script wasn't loaded. + Fixed issue where   wouldn't be handled correctly in the bbcode plugin if entity_encoding was set to raw. + Fixed issue where contents would flicker since the content css files where asynchronously loaded. + Fixed bug where WebKit wouldn't create links on images with a float style. +Version 3.3.9.3 (2010-12-20) + Fixed issue where WebKit wouldn't correctly apply ins/del in xhtmlxtras plugin. + Fixed bug where paste as plaintext on WebKit wouldn't produce br and p elements correctly. + Fixed bug where the confirm dialog texts would be incorrectly placed due to recent IE 9 workarounds in the window.css. + Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance. +Version 3.3.9.2 (2010-09-29) + Fixed bug where placing the caret in IE 9 beta 1 would not work correctly if you clicked out side the document body element. + Fixed bug where IE 9 beta 1 wouldn't resize the editor correctly since the events didn't fire as previous versions did. + Fixed bug where FF would produce an error message when being rendered inside a hidden div element. + Fixed bug where resize logic could produce a cookie with a width/height less than the size of the container. + Fixed bug where content_css wouldn't populate the styles dropdown correctly. +Version 3.3.9.1 (2010-09-23) + Fixed bug where WebKit browsers wouldn't activate the image button when images where selected. + Fixed bug where Opera Presto 10.60 deletes elements when restoring bookmarks. + Fixed bug where IE9 beta1 doesn't handle regexp replacement values correctly. + Fixed bug where IE9 beta1 didn't render the inline dialogs correctly due to a bug with CSS clip. + Fixed bug where IE9 beta1 would produce error messages on load since they removed the document.recalc method. + Fixed bug where IE9 beta1 would produce since they haven't implemented document.implementation.createDocument correctly. + Fixed bug where IE9 beta1 would searchreplace doesn't work since their native DOM Range doesn't have a find method. + Fixed bug where IE9 beta1 would render the source view incorrectly due to incorrect viewport size measurements. + Fixed bug where IE9 beta1 would crash when running the basic functionality unit tests. + Fixed bug where IE9 beta1 would wrap elements in blocks correctly due to changes to the selection object. + Fixed bug where IE9 beta1 would fail to insert contents since they havn't implemented the createContextualFragment method in their DOM Range. + Fixed bug where IE9 beta1 would fail to handle image selection since they currently doesn't support control selections in their DOM Range. + Fixed bug where IE9 beta1 would fail to load scripts since they fire the onload event before the scripts are parsed and executed. +Version 3.3.9 (2010-09-08) + Fixed bug where inserting table rows into a table with subtable would produce an incorrect column count. + Fixed bug where the selection of cells in a table with subtables could produce invalid selections. + Fixed bug where the table plugin would produce a script error if you tried to move the caret before a first child table. + Fixed bug where the keep_styles feature on IE would move the caret to an incorrect location at the end of list blocks. + Fixed so attributes from legacy elements such as font gets retained when they get converted to spans. + Fixed minor issue where the select boxes wouldn't be set the not set by default in the table dialog. +Version 3.3.8 (2010-06-30) + On IE8+ and FireFox 3.5+, dragging an image now correctly adds an undo + event. + Fixed bug where WebKit would not move the caret to a correct position after a paste operation. + Fixed bug where WebKit would produce a div wrapper element when pasting some contents. + Fixed bug where the visual chars and nonbreaking plugin wouldn't show nbsp elements correctly. + Fixed bug where the format states would be enabled even after the format was removed. + Fixed bug where the delete key would move the caret to an incorrect position. + Fixed bug where it wasn't possible to toggle of the current font size/family/style by clicking the title item. + Fixed bug where the abbr element wouldn't get serialized correctly on IE6. + Fixed so that the examples checks if they are executed from the local file system since that might not work properly. Version 3.3.7 (2010-06-10) Fixed bug where context menu would produce an error on IE if you right clicked twice and left clicked once. Fixed bug where resizing of the window on WebKit browsers in fullscreen mode wouldn't position the statusbar correctly. diff --git a/library/tinymce/examples/accessibility.html b/library/tinymce/examples/accessibility.html new file mode 100644 index 0000000000..69059403cc --- /dev/null +++ b/library/tinymce/examples/accessibility.html @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
                +
                +

                Full featured example, with Accessibility settings enabled

                + +

                + This page has got the TinyMCE set up to work with configurations related to accessiblity enabled. + In particular +

                  +
                • the content_css is set to false, to ensure that all default browser styles are used,
                • +
                • the browser_preferred_colors dialog option is used to ensure that default css is used for dialogs,
                • +
                • and the detect_highcontrast option has been set to ensure that highcontrast mode in Windows browsers + is detected and the toolbars are displayed in a high contrast mode.
                • +
                +

                + + +
                + +
                + +
                + + +
                +
                + + + + diff --git a/library/tinymce/examples/css/content.css b/library/tinymce/examples/css/content.css old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/css/word.css b/library/tinymce/examples/css/word.css old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/custom_formats.html b/library/tinymce/examples/custom_formats.html old mode 100755 new mode 100644 index 7c475b19b1..ba9d1eb0c7 --- a/library/tinymce/examples/custom_formats.html +++ b/library/tinymce/examples/custom_formats.html @@ -10,7 +10,7 @@ // General options mode : "textareas", theme : "advanced", - plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave", + plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", @@ -102,6 +102,10 @@ - + diff --git a/library/tinymce/examples/full.html b/library/tinymce/examples/full.html old mode 100755 new mode 100644 index 0b24b6e48e..84b76ca7a1 --- a/library/tinymce/examples/full.html +++ b/library/tinymce/examples/full.html @@ -2,7 +2,7 @@ Full featured example - + diff --git a/library/tinymce/examples/index.html b/library/tinymce/examples/index.html old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/lists/image_list.js b/library/tinymce/examples/lists/image_list.js old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/lists/link_list.js b/library/tinymce/examples/lists/link_list.js old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/lists/media_list.js b/library/tinymce/examples/lists/media_list.js old mode 100755 new mode 100644 index 3a3836cc50..2e049587cb --- a/library/tinymce/examples/lists/media_list.js +++ b/library/tinymce/examples/lists/media_list.js @@ -6,5 +6,9 @@ var tinyMCEMediaList = [ // Name, URL ["Some Flash", "media/sample.swf"], ["Some Quicktime", "media/sample.mov"], - ["Some AVI", "media/sample.avi"] + ["Some AVI", "media/sample.avi"], + ["Some RealMedia", "media/sample.rm"], + ["Some Shockwave", "media/sample.dcr"], + ["Some Video", "media/sample.mp4"], + ["Some FLV", "media/sample.flv"] ]; \ No newline at end of file diff --git a/library/tinymce/examples/lists/template_list.js b/library/tinymce/examples/lists/template_list.js old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/logo.jpg b/library/tinymce/examples/media/logo.jpg old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/logo_over.jpg b/library/tinymce/examples/media/logo_over.jpg old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/sample.avi b/library/tinymce/examples/media/sample.avi old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/sample.dcr b/library/tinymce/examples/media/sample.dcr old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/sample.flv b/library/tinymce/examples/media/sample.flv new file mode 100644 index 0000000000000000000000000000000000000000..799d137e67b109d5919ef0dae8a9d13e3134eb38 GIT binary patch literal 88722 zcmeEP2|QKX_doZVuKAh?nWs!wnJRV7k;+(xl&doJWN45^mog+X8A_QNC>5om$u$=l zk|YUHQW_8$!ujuWbHn?+q103F{q6U8y2Dxbobx?vuf6u#`@5F@iZv)22!iOr{}4L_ zwIct5hK3m2-Bvnmx7W4bZjS*UFhH11JGR{Nb117(WzZ+Gy`)?%?p7g}a{H zCKT%P?RH@x)Z+0Y6yZ->O~|i}5H#po>9-_oU%%w@W^eqSEmy^H0eI{436x_+a>cd(NduXdAn22-L!?A%Li2( z&_UkJy+WPz@h@S%jS=^K2K(j)`1g?nz*RurPJxo~i#o1FX*LY-!eC!L+@!BWkmGLg% zRUq;bup%~{ULw~MiXlrF9uD>Q88fHICPP4&8e$!hy=!?=^^H-B_QQAvl&3#K>9PC( zHa`Owu`xxHwrs(85F%JoMBUv!B{GuI5fO4YnY(pi-}B zkaUt>6QYjj%5FMbwG$o#GB4S{A7&UvkfevW!y!l#oFC#Odh4_Eu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y}>NKe$+OZ>*`8lp|(~up0YQ zn^Xl@@A)#qDR~LREOWsy&WxI{3^50C`(Epslyb0F)j&6{EuF!C%kGR;+Y*c&mMF^^ xk|g!F9}S@Tj0?b!22lU=A6KpWkcTkjZ|vV@i2ke3|Nq6g|5tQA+!luNKLBO(df5N~ literal 0 HcmV?d00001 diff --git a/library/tinymce/examples/media/sample.mov b/library/tinymce/examples/media/sample.mov old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/sample.ram b/library/tinymce/examples/media/sample.ram old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/sample.rm b/library/tinymce/examples/media/sample.rm old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/media/sample.swf b/library/tinymce/examples/media/sample.swf old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/menu.html b/library/tinymce/examples/menu.html old mode 100755 new mode 100644 index a65c3104f7..e48650abd6 --- a/library/tinymce/examples/menu.html +++ b/library/tinymce/examples/menu.html @@ -13,5 +13,6 @@ a {display:block;} Skin support Word processor Custom formats +Accessibility Options - \ No newline at end of file + diff --git a/library/tinymce/examples/simple.html b/library/tinymce/examples/simple.html old mode 100755 new mode 100644 index c378398900..70720caa1c --- a/library/tinymce/examples/simple.html +++ b/library/tinymce/examples/simple.html @@ -38,6 +38,10 @@ - + diff --git a/library/tinymce/examples/skins.html b/library/tinymce/examples/skins.html old mode 100755 new mode 100644 index a39817221e..c150858858 --- a/library/tinymce/examples/skins.html +++ b/library/tinymce/examples/skins.html @@ -12,7 +12,7 @@ mode : "exact", elements : "elm1", theme : "advanced", - plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", + plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", @@ -47,7 +47,7 @@ elements : "elm2", theme : "advanced", skin : "o2k7", - plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", + plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", @@ -83,7 +83,7 @@ theme : "advanced", skin : "o2k7", skin_variant : "silver", - plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", + plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", @@ -119,7 +119,7 @@ theme : "advanced", skin : "o2k7", skin_variant : "black", - plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", + plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", @@ -207,6 +207,10 @@ - + diff --git a/library/tinymce/examples/templates/layout1.htm b/library/tinymce/examples/templates/layout1.htm old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/templates/snippet1.htm b/library/tinymce/examples/templates/snippet1.htm old mode 100755 new mode 100644 diff --git a/library/tinymce/examples/translate.html b/library/tinymce/examples/translate.html deleted file mode 100755 index bdd8ac54a4..0000000000 --- a/library/tinymce/examples/translate.html +++ /dev/null @@ -1,80 +0,0 @@ - - - -Full featured example - - - - - - - - - - -
                -

                Translation

                - -

                This page enables you to translate TinyMCE by using XML files.

                -

                Steps to translate:

                -
                  -
                1. Download one of the language XML files from the TinyMCE site.
                2. -
                3. Place it in /jscripts/tiny_mce/langs directory, for example /jscripts/tiny_mce/langs/sv.xml.
                4. -
                5. Change the language init option in this file to match the XML file code. For example: sv
                6. -
                7. TinyMCE will now use the XML file instead of the .js versions.
                8. -
                9. Modify the XML file until everything is translated
                10. -
                11. Modify the author information, this is optional.
                12. -
                13. Upload the XML file to the TinyMCE site to share it with others.
                14. -
                15. You can now download the .js versions of the language pack from the TinyMCE site.
                16. -
                - - -
                - - - diff --git a/library/tinymce/examples/word.html b/library/tinymce/examples/word.html old mode 100755 new mode 100644 index f778f983c8..d827b6fedb --- a/library/tinymce/examples/word.html +++ b/library/tinymce/examples/word.html @@ -2,7 +2,7 @@ Word processor example - + diff --git a/library/tinymce/jscripts/tiny_mce/langs/en.js b/library/tinymce/jscripts/tiny_mce/langs/en.js old mode 100755 new mode 100644 index ea4a1b0e14..19324f74cd --- a/library/tinymce/jscripts/tiny_mce/langs/en.js +++ b/library/tinymce/jscripts/tiny_mce/langs/en.js @@ -1,170 +1 @@ -tinyMCE.addI18n({en:{ -common:{ -edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", -apply:"Apply", -insert:"Insert", -update:"Update", -cancel:"Cancel", -close:"Close", -browse:"Browse", -class_name:"Class", -not_set:"-- Not set --", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", -clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", -popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", -invalid_data:"Error: Invalid values entered, these are marked in red.", -more_colors:"More colors" -}, -contextmenu:{ -align:"Alignment", -left:"Left", -center:"Center", -right:"Right", -full:"Full" -}, -insertdatetime:{ -date_fmt:"%Y-%m-%d", -time_fmt:"%H:%M:%S", -insertdate_desc:"Insert date", -inserttime_desc:"Insert time", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}, -print:{ -print_desc:"Print" -}, -preview:{ -preview_desc:"Preview" -}, -directionality:{ -ltr_desc:"Direction left to right", -rtl_desc:"Direction right to left" -}, -layer:{ -insertlayer_desc:"Insert new layer", -forward_desc:"Move forward", -backward_desc:"Move backward", -absolute_desc:"Toggle absolute positioning", -content:"New layer..." -}, -save:{ -save_desc:"Save", -cancel_desc:"Cancel all changes" -}, -nonbreaking:{ -nonbreaking_desc:"Insert non-breaking space character" -}, -iespell:{ -iespell_desc:"Run spell checking", -download:"ieSpell not detected. Do you want to install it now?" -}, -advhr:{ -advhr_desc:"Horizontal rule" -}, -emotions:{ -emotions_desc:"Emotions" -}, -searchreplace:{ -search_desc:"Find", -replace_desc:"Find/Replace" -}, -advimage:{ -image_desc:"Insert/edit image" -}, -advlink:{ -link_desc:"Insert/edit link" -}, -xhtmlxtras:{ -cite_desc:"Citation", -abbr_desc:"Abbreviation", -acronym_desc:"Acronym", -del_desc:"Deletion", -ins_desc:"Insertion", -attribs_desc:"Insert/Edit Attributes" -}, -style:{ -desc:"Edit CSS Style" -}, -paste:{ -paste_text_desc:"Paste as Plain Text", -paste_word_desc:"Paste from Word", -selectall_desc:"Select All", -plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", -plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." -}, -paste_dlg:{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}, -table:{ -desc:"Inserts a new table", -row_before_desc:"Insert row before", -row_after_desc:"Insert row after", -delete_row_desc:"Delete row", -col_before_desc:"Insert column before", -col_after_desc:"Insert column after", -delete_col_desc:"Remove column", -split_cells_desc:"Split merged table cells", -merge_cells_desc:"Merge table cells", -row_desc:"Table row properties", -cell_desc:"Table cell properties", -props_desc:"Table properties", -paste_row_before_desc:"Paste table row before", -paste_row_after_desc:"Paste table row after", -cut_row_desc:"Cut table row", -copy_row_desc:"Copy table row", -del:"Delete table", -row:"Row", -col:"Column", -cell:"Cell" -}, -autosave:{ -unload_msg:"The changes you made will be lost if you navigate away from this page.", -restore_content:"Restore auto-saved content.", -warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." -}, -fullscreen:{ -desc:"Toggle fullscreen mode" -}, -media:{ -desc:"Insert / edit embedded media", -edit:"Edit embedded media" -}, -fullpage:{ -desc:"Document properties" -}, -template:{ -desc:"Insert predefined template content" -}, -visualchars:{ -desc:"Visual control characters on/off." -}, -spellchecker:{ -desc:"Toggle spellchecker", -menu:"Spellchecker settings", -ignore_word:"Ignore word", -ignore_words:"Ignore all", -langs:"Languages", -wait:"Please wait...", -sug:"Suggestions", -no_sug:"No suggestions", -no_mpell:"No misspellings found." -}, -pagebreak:{ -desc:"Insert page break." -}, -advlist:{ -types:"Types", -def:"Default", -lower_alpha:"Lower alpha", -lower_greek:"Lower greek", -lower_roman:"Lower roman", -upper_alpha:"Upper alpha", -upper_roman:"Upper roman", -circle:"Circle", -disc:"Disc", -square:"Square" -}}}); \ No newline at end of file +tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/license.txt b/library/tinymce/jscripts/tiny_mce/license.txt old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css b/library/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js b/library/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js old mode 100755 new mode 100644 index 873bfd8d38..0c3bf15e6f --- a/library/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js @@ -1,5 +1 @@ -tinyMCE.addI18n('en.advhr_dlg',{ -width:"Width", -size:"Height", -noshade:"No shadow" -}); \ No newline at end of file +tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm b/library/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm old mode 100755 new mode 100644 index fc37b2aecd..843e1f8f0b --- a/library/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm @@ -8,43 +8,44 @@ - +
                - - - - - - - - - - - - - -
                - - -
                + + + + + + + + + + + + + +
                + + + +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css b/library/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js old mode 100755 new mode 100644 index 4c7a9c3a88..d613a61393 --- a/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js old mode 100755 new mode 100644 index 2625dd2131..d2678cbcf2 --- a/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js @@ -14,7 +14,7 @@ // Register commands ed.addCommand('mceAdvImage', function() { // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) return; ed.windowManager.open({ diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm b/library/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm old mode 100755 new mode 100644 index 79cff3f19f..ed16b3d4a9 --- a/library/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm @@ -10,13 +10,14 @@ - - + + + @@ -25,15 +26,15 @@
                {#advimage_dlg.general} - +
                - @@ -60,7 +61,7 @@
                {#advimage_dlg.tab_appearance} -
                +
                - + - - - -
                - x - px + + x + + px
                  + - + @@ -109,7 +108,7 @@ @@ -118,7 +117,7 @@ @@ -129,7 +128,7 @@ - -
                @@ -142,18 +145,18 @@
                {#advimage_dlg.swap_image} - + -
                +
                - @@ -161,12 +164,12 @@ - @@ -178,7 +181,7 @@
                {#advimage_dlg.misc} -
                + +
                - - + + -
                  
                + +
                - - + + -
                  
                +
                @@ -211,12 +214,12 @@ -
                + +
                - - + + -
                  
                @@ -227,6 +230,6 @@ - + diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif b/library/tinymce/jscripts/tiny_mce/plugins/advimage/img/sample.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js b/library/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js old mode 100755 new mode 100644 index 3bda86a2d3..546b69c0de --- a/library/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js @@ -9,13 +9,13 @@ var ImageDialog = { }, init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); tinyMCEPopup.resizeToInnerSize(); this.fillClassList('class_list'); - this.fillFileList('src_list', 'tinyMCEImageList'); - this.fillFileList('over_list', 'tinyMCEImageList'); - this.fillFileList('out_list', 'tinyMCEImageList'); + this.fillFileList('src_list', fl); + this.fillFileList('over_list', fl); + this.fillFileList('out_list', fl); TinyMCE_EditableSelects.init(); if (n.nodeName == 'IMG') { @@ -142,7 +142,7 @@ var ImageDialog = { } tinymce.extend(args, { - src : nl.src.value, + src : nl.src.value.replace(/ /g, '%20'), width : nl.width.value, height : nl.height.value, alt : nl.alt.value, @@ -171,12 +171,18 @@ var ImageDialog = { if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); ed.undoManager.add(); } + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); tinyMCEPopup.close(); }, @@ -285,7 +291,7 @@ var ImageDialog = { fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - l = window[l]; + l = typeof(l) === 'function' ? l() : window[l]; lst.options.length = 0; if (l && l.length > 0) { @@ -359,7 +365,7 @@ var ImageDialog = { }, updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); if (tinyMCEPopup.editor.settings.inline_styles) { // Handle align @@ -378,14 +384,27 @@ var ImageDialog = { // Handle border if (ty == 'border') { + b = img.style.border ? img.style.border.split(' ') : []; + bStyle = dom.getStyle(img, 'border-style'); + bColor = dom.getStyle(img, 'border-color'); + dom.setStyle(img, 'border', ''); v = f.border.value; if (v || v == '0') { if (v == '0') - img.style.border = '0'; - else - img.style.border = v + 'px solid black'; + img.style.border = isIE ? '0' : '0 none none'; + else { + if (b.length == 3 && b[isIE ? 2 : 1]) + bStyle = b[isIE ? 2 : 1]; + else if (!bStyle || bStyle == 'none') + bStyle = 'solid'; + if (b.length == 3 && b[isIE ? 0 : 2]) + bColor = b[isIE ? 0 : 2]; + else if (!bColor || bColor == 'none') + bColor = 'black'; + img.style.border = v + 'px ' + bStyle + ' ' + bColor; + } } } diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js old mode 100755 new mode 100644 index f493d196fa..5f122e2cd3 --- a/library/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js @@ -1,43 +1 @@ -tinyMCE.addI18n('en.advimage_dlg',{ -tab_general:"General", -tab_appearance:"Appearance", -tab_advanced:"Advanced", -general:"General", -title:"Title", -preview:"Preview", -constrain_proportions:"Constrain proportions", -langdir:"Language direction", -langcode:"Language code", -long_desc:"Long description link", -style:"Style", -classes:"Classes", -ltr:"Left to right", -rtl:"Right to left", -id:"Id", -map:"Image map", -swap_image:"Swap image", -alt_image:"Alternative image", -mouseover:"for mouse over", -mouseout:"for mouse out", -misc:"Miscellaneous", -example_img:"Appearance preview image", -missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", -dialog_title:"Insert/edit image", -src:"Image URL", -alt:"Image description", -list:"Image list", -border:"Border", -dimensions:"Dimensions", -vspace:"Vertical space", -hspace:"Horizontal space", -align:"Alignment", -align_baseline:"Baseline", -align_top:"Top", -align_middle:"Middle", -align_bottom:"Bottom", -align_texttop:"Text top", -align_textbottom:"Text bottom", -align_left:"Left", -align_right:"Right", -image_list:"Image list" -}); \ No newline at end of file +tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css b/library/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js b/library/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js old mode 100755 new mode 100644 index b78e82f76b..9ca955c928 --- a/library/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js @@ -30,8 +30,6 @@ function init() { document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); - document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); // Link list @@ -41,6 +39,13 @@ function init() { else document.getElementById("linklisthrefcontainer").innerHTML = html; + // Anchor list + html = getAnchorListHTML('anchorlist','href'); + if (html == "") + document.getElementById("anchorlistrow").style.display = 'none'; + else + document.getElementById("anchorlistcontainer").innerHTML = html; + // Resize some elements if (isVisible('hrefbrowser')) document.getElementById('href').style.width = '260px'; @@ -49,6 +54,13 @@ function init() { document.getElementById('popupurl').style.width = '180px'; elm = inst.dom.getParent(elm, "A"); + if (elm == null) { + var prospect = inst.dom.create("p", null, inst.selection.getContent()); + if (prospect.childNodes.length === 1) { + elm = prospect.firstChild; + } + } + if (elm != null && elm.nodeName == "A") action = "update"; @@ -360,20 +372,22 @@ function setAttrib(elm, attrib, value) { } function getAnchorListHTML(id, target) { - var inst = tinyMCEPopup.editor; - var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i; - var html = ""; - - html += ''; + if (html == "") + return ""; + + html = ''; return html; } @@ -389,7 +403,6 @@ function insertAction() { // Remove element if there is no href if (!document.forms[0].href.value) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); i = inst.selection.getBookmark(); inst.dom.remove(elm, 1); inst.selection.moveToBookmark(i); @@ -398,12 +411,10 @@ function insertAction() { return; } - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - // Create new anchor elements if (elm == null) { inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); for (i=0; i'; html += ''; html += ''; diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js old mode 100755 new mode 100644 index c71ffbd0f1..3169a56580 --- a/library/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js @@ -1,52 +1 @@ -tinyMCE.addI18n('en.advlink_dlg',{ -title:"Insert/edit link", -url:"Link URL", -target:"Target", -titlefield:"Title", -is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -list:"Link list", -general_tab:"General", -popup_tab:"Popup", -events_tab:"Events", -advanced_tab:"Advanced", -general_props:"General properties", -popup_props:"Popup properties", -event_props:"Events", -advanced_props:"Advanced properties", -popup_opts:"Options", -anchor_names:"Anchors", -target_same:"Open in this window / frame", -target_parent:"Open in parent window / frame", -target_top:"Open in top frame (replaces all frames)", -target_blank:"Open in new window", -popup:"Javascript popup", -popup_url:"Popup URL", -popup_name:"Window name", -popup_return:"Insert 'return false'", -popup_scrollbars:"Show scrollbars", -popup_statusbar:"Show status bar", -popup_toolbar:"Show toolbars", -popup_menubar:"Show menu bar", -popup_location:"Show location bar", -popup_resizable:"Make window resizable", -popup_dependent:"Dependent (Mozilla/Firefox only)", -popup_size:"Size", -popup_position:"Position (X/Y)", -id:"Id", -style:"Style", -classes:"Classes", -target_name:"Target name", -langdir:"Language direction", -target_langcode:"Target language", -langcode:"Language code", -encoding:"Target character encoding", -mime:"Target MIME type", -rel:"Relationship page to target", -rev:"Relationship target to page", -tabindex:"Tabindex", -accesskey:"Accesskey", -ltr:"Left to right", -rtl:"Right to left", -link_list:"Link list" -}); \ No newline at end of file +tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm b/library/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm old mode 100755 new mode 100644 index 876669c6b3..8ab7c2a95c --- a/library/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm @@ -9,37 +9,38 @@ - -
                -
                + + + + -
                + diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cool.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif old mode 100755 new mode 100644 index 16f68cc1e91a9b8ec6cfa0ba4e0c86f94b177f1a..c7cf1011dad0e7500e29a278b0d395b253871109 GIT binary patch delta 268 zcmV+n0rURY0@eZ$M@dFFIbjk25&-lc0J)nSkq}gWCJF-k?l%Ac03rDV1poja04x9i z000sI5&%F2)8HqHP-&K zLM9f)qQm8C1c`;hGBJ_}h73g_p=1mM^9RXLyb^bpf>AvH6dpB#1`P%p2?GxRIXezw z7zGP+3jz%k3l2poa}fvt8yf%!5pp93KMDvH92^x0V-7i+EDszR8Bewx4-y8WehLpR z33wR8E)NQeD=m2M7#-8v+{*T!alCd#3 z1p^Ir4Fi-428xUrkd&O950`xk9-RXQ4F(zs0}qJ@2n?ee0ving0HzHddj}8`MGLmU z8UhImO%o-q#)2Cf00I^Q4_>?<5El-{nhOg84HOFw7eOBf7YG&%hkqFs2p3Q(*Aoat UP6!j@HP+?<{sHjFeFy;nJK@hu1^@s6 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-frown.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif old mode 100755 new mode 100644 index 1606c119e75678c4031f384e0d50849906e8f533..82c5b182e61d32bd394acae551eff180f1eebd26 GIT binary patch delta 269 zcmV+o0rLLX0@nf%M@dFFIbjk25&-lc0K%p+kq}gWQaug+`&s}103rDV1poja04x9i z000sI5&%F2)ZizIQ)!l?Xh>A$7VskoPwh#@I9<*GEDONFahaqh2L%Pf;kcR*isE3L zI2Im3A3bNpK_?^9QN%xH_GCzT(kPR|yLU7KDX_2pAAJa~A*# z2^9-;8v_d!2?_v3DRU7A5(5Jg2N7~31{ezo9uTY$9)TD+oGcI(4STm0Q4*wpwG|r; zF2ODk2{(g0w~m91nJ)p)P~b0v=TXuJkV0)pK%`hRH&5(aq`SQQ0|4*~)Y zj~;||h6NmskCzV%0uYjV3kVjWqM-;FoP`G(WCRQW7Z(8x1b=r16AlX=0u2`oB@7o0 z3LXm%B?eNu8w9Vj0v=tq9}^cH3JDbp8v_d!2?`w-K_3Pe2MZcXM;Z$U7f&hF4hJ0z U3mpdz;x*Id4FABSjR*k%I|lSgp8x;= diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif old mode 100755 new mode 100644 index b33d3cca1e7b8e62dc689880074d5c61f619520d..fe66220c24b4da4526818a5d68f75a06d9985a29 GIT binary patch delta 249 zcmVc6jM@dFFIbjk25&-lc0Klpjkq}gWQauaR#xDQ>03rDV1poja04x9i z000sI5&%F2z~Co}Q)!l?s2E!2QdA zP6EM+V$0o5egPxNVelL@nuEvS5Py&l$*VJWNgmaeBy#Fc3>i3Y6%ZGOhlmgrZX^W= z8v_Gi8wdrADnAk!5DyO!7!pA_ZyYQc4;~&as7@LN99jl)E**3kv`;r%EDsR|k-xtS zxe5rp69ipb1YdXxI|zjY71PuN7Z3uIlM@dFFIbjk25&+Z_08%{*kq}gWz^WJ3#xDQ>03rDV0RR9W04x9i z000sI5&!@N!r&*0Q)!lCN*2gA3>#8RD(M*Bp=pO_IJA@^(ve^wj|T)J=|mKx31Xqy zL>`%J1fp3WXcLY>lX-YN*)vvS;FJ&#NtObb*E5pGS7DH60e65|cm@i5WOEb=0u&Si zj}nDqhYt}3FPE1Kk%oN{C!Z4r8Io|G1cs;z1QS;X3KIcN6RD}J9RVd52oM(p6~Dj) z7Z3;+U=_R<%FD|T6+s^g3=I$w7#0>7TMZ0QDH9g~2t-Z@0md~SvlqY>7q2NH06S3N BNLv5^ diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif old mode 100755 new mode 100644 index e6a9e60d5ddd1243fbbf2197b4dc6cd9c1b58b93..fd27edfaaa29a70a8c4563c0eab9f18c74d374fd GIT binary patch delta 270 zcmV+p0rCFX0@wl&M@dFFIbjk25&-lc0C`{zkq}gWCJF+oiUI%t03rDV1poja04x9i z000sI5&%F2)!-+JP-&K7%&eE7zha(Mk#X<1{oe683qw@BL@`@2pbbn6B`H)6*`?PtqlrLxC~PZrGN+% zE&vU~#TXL^jVmoMhlVv1IR^#>3>*Rg2{s7;0vrr}2N2W=TMrHb0uEwT<0=*g4h65Q U1r7!lv`7aQ0sjH?nF;{_JD=x5hyVZp delta 271 zcmV+q0r39V0@(r(M@dFFIbjk25&+Z?0453okq}gWd0-BziUI%t03rDV0RR9W04x9i z000sI5&!@N*5D_KP-&K9N=8QJd6^MGDoHFCB1y=#5VX{x;y`RB48~-Ga8wQ>h#?`F zTrSD$M3OMjAdy9t(NHAIO37j-Eo?9tg#s>zZwlT+1~Gwm8h(Hn69^dx2V!s-3=a<+ z0|Oj(k{b($iHwq&l93aYdI$^y9-5LK0}m612L=TU90DB)k_jCG91M5|5EKp@jU52N z03D4R4iqJ;3BC^w0s;=jUAi9-78(f%i;WBz2niY%K_3Se1`Y*FM+FWB7EmeH6b2d& V4jKj&;x*Of0sjHsjr$M+06RN6NSOct diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif old mode 100755 new mode 100644 index cb99cdd9136fa30462a9f57aa6a0adeb7e4124e7..0cc9bb71cca4cdeafbb248ce7e07c3708c1cbd64 GIT binary patch delta 264 zcmV+j0r&pa0@4ByM@dFFIbjk25&-lc0Q=+`kq}gWC=3F`xI_Q|03rDV1poja04x9i z000sI5&%F2&)_GDP-&KpRzaw7*n2_6C!6#^a!K{=W%7!?bX615c=6B?o`2^cO2 zcoM=c7zsElEfNF+&d-7v$p#C7H3(h^g0}_-5C=(GGudGrRNg8V1`i7u92^)64+a;o OM+X-H`T_N$Apkpuj7YZt delta 268 zcmV+n0rURS0@eZ$M@dFFIbjk25&+Z?04NLskq}gW`{WwLxI_Q|03rDV0RR9W04x9i z000sI5&!@N)8HqHP-&K9N=AmpFq#oTDp_dDHci{26|~f$@kn?Cm5RWVcr*?ph(R$C zG%6BFr6HIo3^YhYGr?3AiY&T{^|8V7w7SrQHo z1RaiZ6q6i?idh5$nwygp7?wp6oeuy28l4>&4~Yf~qLT=v2%Qpp2M`ty9FQFur2rir z1RM_*B?nWxk+Q-ZU$-9+7Yzyt5(*g^X$cAq7eOBf7X}Xt7#tiJ3l9btP$|+D21HH< S7T-0|;sN{t?%*Fn0028#VNAdP diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/library/tinymce/jscripts/tiny_mce/plugins/emotions/img/smiley-wink.gif old mode 100755 new mode 100644 index 9faf1aff8f4b28e02f4f414975fe1859c43b6b54..0631c7616ec8624ddeee02b633326f697ee72f80 GIT binary patch delta 276 zcmV+v0qg$X0^R};M@dFFIbjk25&-lc0MWuJkq}gWC=CMr@j3ti03rDV1poja04x9i z000sI5&%F2+u$dPQfZc>h%k}mS_`xd!)9v?GD=uwG!#n1P{Bx25L@HjmHz$20{ z93>Ts1_E((z8wcwL#Z4|1qR^|i5v)w!ugXVXaI_D!lF>PGz3-%90v;n3^s`y30029B7)0Cv delta 277 zcmV+w0qXwV0^b4/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);h.head=f.substring(0,a+1);j=f.indexOf("\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n\n"+d.getParam("fullpage_default_title","Untitled document")+"\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n\n";h.foot="\n\n"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file +(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype=""}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js old mode 100755 new mode 100644 index a2c9df8987..23de7c5a1a --- a/library/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js @@ -9,6 +9,8 @@ */ (function() { + var each = tinymce.each, Node = tinymce.html.Node; + tinymce.create('tinymce.plugins.FullPagePlugin', { init : function(ed, url) { var t = this; @@ -24,7 +26,7 @@ inline : 1 }, { plugin_url : url, - head_html : t.head + data : t._htmlToData() }); }); @@ -32,7 +34,6 @@ ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); ed.onBeforeSetContent.add(t._setContent, t); - ed.onSetContent.add(t._setBodyAttribs, t); ed.onGetContent.add(t._getContent, t); }, @@ -48,106 +49,357 @@ // Private plugin internal methods - _setBodyAttribs : function(ed, o) { - var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); + _htmlToData : function() { + var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; - if (attr && attr[1]) { - bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); + function getAttr(elm, name) { + var value = elm.attr(name); - if (bdattr) { - for(i = 0, len = bdattr.length; i < len; i++) { - kv = bdattr[i].split('='); - k = kv[0].replace(/\s/,''); - v = kv[1]; + return value || ''; + }; - if (v) { - v = v.replace(/^\s+/,'').replace(/\s+$/,''); - t = v.match(/^["'](.*)["']$/); + // Default some values + data.fontface = editor.getParam("fullpage_default_fontface", ""); + data.fontsize = editor.getParam("fullpage_default_fontsize", ""); + + // Parse XML PI + elm = headerFragment.firstChild; + if (elm.type == 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) + data.docencoding = matches[1]; + } - if (t) - v = t[1]; - } else - v = k; + // Parse doctype + elm = headerFragment.getAll('#doctype')[0]; + if (elm) + data.doctype = '"; - ed.dom.setAttrib(ed.getBody(), 'style', v); - } + // Parse title element + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.metatitle = elm.firstChild.value; + } + + // Parse meta elements + each(headerFragment.getAll('meta'), function(meta) { + var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; + + if (name) + data['meta' + name.toLowerCase()] = meta.attr('content'); + else if (httpEquiv == "Content-Type") { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + + if (matches) + data.docencoding = matches[1]; } + }); + + // Parse html attribs + elm = headerFragment.getAll('html')[0]; + if (elm) + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + + // Parse stylesheet + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') + data.stylesheet = elm.attr('href'); + + // Parse body parts + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); } + + return data; }, - _createSerializer : function() { - return new tinymce.dom.Serializer({ - dom : this.editor.dom, - apply_source_formatting : true + _dataToHtml : function(data) { + var headerFragment, headElement, html, elm, value, dom = this.editor.dom; + + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + }; + + function addHeadNode(node) { + if (headElement.firstChild) + headElement.insert(node, headElement.firstChild); + else + headElement.append(node); + }; + + headerFragment = this._parseHeader(); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new Node('head', 1); + + if (elm.firstChild) + elm.insert(headElement, elm.firstChild, true); + else + elm.append(headElement); + } + + // Add/update/remove XML-PI + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + + if (data.docencoding) + value += ' encoding="' + data.docencoding + '"'; + + if (elm.type != 7) { + elm = new Node('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + + elm.value = value; + } else if (elm && elm.type == 7) + elm.remove(); + + // Add/update/remove doctype + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new Node('#doctype', 10); + + if (data.xml_pi) + headerFragment.insert(elm, headerFragment.firstChild); + else + addHeadNode(elm); + } + + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) + elm.remove(); + + // Add/update/remove title + elm = headerFragment.getAll('title')[0]; + if (data.metatitle) { + if (!elm) { + elm = new Node('title', 1); + elm.append(new Node('#text', 3)).value = data.metatitle; + addHeadNode(elm); + } + } + + // Add meta encoding + if (data.docencoding) { + elm = null; + each(headerFragment.getAll('meta'), function(meta) { + if (meta.attr('http-equiv') == 'Content-Type') + elm = meta; + }); + + if (!elm) { + elm = new Node('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + + elm.attr('content', 'text/html; charset=' + data.docencoding); + } + + // Add/update/remove meta + each('keywords,description,author,copyright,robots'.split(','), function(name) { + var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; + + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + + if (meta.attr('name') == name) { + if (value) + meta.attr('content', value); + else + meta.remove(); + + return; + } + } + + if (value) { + elm = new Node('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + + addHeadNode(elm); + } }); + + // Add/update/delete link + elm = headerFragment.getAll('link')[0]; + if (elm && elm.attr('rel') == 'stylesheet') { + if (data.stylesheet) + elm.attr('href', data.stylesheet); + else + elm.remove(); + } else if (data.stylesheet) { + elm = new Node('link', 1); + elm.attr({ + rel : 'stylesheet', + text : 'text/css', + href : data.stylesheet + }); + elm.shortEnded = true; + + addHeadNode(elm); + } + + // Update body attributes + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + + // Update iframe body as well + dom.setAttribs(this.editor.getBody(), { + style : data.style, + dir : data.dir, + vLink : data.visited_color, + link : data.link_color, + aLink : data.active_color + }); + } + + // Set html attributes + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + + // Serialize header fragment and crop away body part + html = new tinymce.html.Serializer({ + validate: false, + indent: true, + apply_source_formatting : true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + + this.head = html.substring(0, html.indexOf('')); + }, + + _parseHeader : function() { + // Parse the contents with a DOM parser + return new tinymce.html.DomParser({ + validate: false, + root_name: '#document' + }).parse(this.head); }, _setContent : function(ed, o) { - var t = this, sp, ep, c = o.content, v, st = ''; + var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; + + function low(s) { + return s.replace(/<\/?[A-Z]+/g, function(a) { + return a.toLowerCase(); + }) + }; // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (o.format == 'raw' && t.head) + if (o.format == 'raw' && self.head) return; if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) return; // Parse out head, body and footer - c = c.replace(/<(\/?)BODY/gi, '<$1body'); - sp = c.indexOf('', sp); - t.head = c.substring(0, sp + 1); + if (startPos != -1) { + startPos = content.indexOf('>', startPos); + self.head = low(content.substring(0, startPos + 1)); - ep = c.indexOf('\n'; + elm = headerFragment.getAll('body')[0]; + if (elm) { + dom.setAttribs(self.editor.getBody(), { + style : elm.attr('style') || '', + dir : elm.attr('dir') || '', + vLink : elm.attr('vlink') || '', + link : elm.attr('link') || '', + aLink : elm.attr('alink') || '' + }); + } - t.head += ed.getParam('fullpage_default_doctype', ''); - t.head += '\n\n\n' + ed.getParam('fullpage_default_title', 'Untitled document') + '\n'; + dom.remove('fullpage_styles'); - if (v = ed.getParam('fullpage_default_encoding')) - t.head += '\n'; + if (styles) { + dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles); - if (v = ed.getParam('fullpage_default_font_family')) - st += 'font-family: ' + v + ';'; + // Needed for IE 6/7 + elm = dom.get('fullpage_styles'); + if (elm.styleSheet) + elm.styleSheet.cssText = styles; + } + }, - if (v = ed.getParam('fullpage_default_font_size')) - st += 'font-size: ' + v + ';'; + _getDefaultHeader : function() { + var header = '', editor = this.editor, value, styles = ''; - if (v = ed.getParam('fullpage_default_text_color')) - st += 'color: ' + v + ';'; + if (editor.getParam('fullpage_default_xml_pi')) + header += '\n'; - t.head += '\n\n'; - t.foot = '\n\n'; - } + header += editor.getParam('fullpage_default_doctype', ''); + header += '\n\n\n'; + + if (value = editor.getParam('fullpage_default_title')) + header += '' + value + '\n'; + + if (value = editor.getParam('fullpage_default_encoding')) + header += '\n'; + + if (value = editor.getParam('fullpage_default_font_family')) + styles += 'font-family: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_font_size')) + styles += 'font-size: ' + value + ';'; + + if (value = editor.getParam('fullpage_default_text_color')) + styles += 'color: ' + value + ';'; + + header += '\n\n'; + + return header; }, _getContent : function(ed, o) { - var t = this; + var self = this; if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) - o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); + o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); } }); // Register plugin tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); -})(); \ No newline at end of file +})(); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm b/library/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm old mode 100755 new mode 100644 index c32afaf2d9..14ab8652ea --- a/library/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm @@ -8,13 +8,12 @@ - -
                + + @@ -72,9 +71,9 @@
                   -
                -
                - - +
                 
                @@ -147,7 +146,7 @@
                - +
                 
                @@ -158,7 +157,7 @@
                - +
                 
                @@ -173,15 +172,15 @@ - + - + - + - +
                @@ -195,7 +194,7 @@
                - +
                @@ -205,7 +204,7 @@
                - +
                 
                @@ -217,7 +216,7 @@
                - +
                 
                @@ -225,16 +224,6 @@
                   
                @@ -254,310 +243,9 @@
                -
                - - -
                - - -
                - {#fullpage_dlg.head_elements} - -
                -
                -
                - - -
                -
                - - -
                -
                -
                - -
                -
                - -
                - {#fullpage_dlg.meta_element} - - - - - - - - - - - - - - -
                - - -
                - -
                - {#fullpage_dlg.title_element} - - - - - - -
                - - -
                - -
                - {#fullpage_dlg.script_element} - - - -
                - -
                -
                - - - - - - - - - - - - - - - - - -
                - - - - -
                 
                -
                - -
                - -
                -
                - - -
                - -
                - {#fullpage_dlg.style_element} - - - -
                - -
                -
                - - - - - - - - - -
                -
                - -
                - -
                -
                - - -
                - -
                - {#fullpage_dlg.base_element} - - - - - - - - - +
                - - -
                - - - -
                - {#fullpage_dlg.comment_element} - - - -
                @@ -566,6 +254,6 @@ - + diff --git a/library/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js b/library/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js old mode 100755 new mode 100644 index a1bb719a38..3f672ad3ba --- a/library/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js @@ -8,464 +8,225 @@ * Contributing: http://tinymce.moxiecode.com/contributing */ -tinyMCEPopup.requireLangPack(); - -var doc; - -var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - -var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - -var defaultMediaTypes = - 'all=all,' + - 'screen=screen,' + - 'print=print,' + - 'tty=tty,' + - 'tv=tv,' + - 'projection=projection,' + - 'handheld=handheld,' + - 'braille=braille,' + - 'aural=aural'; - -var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; -var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - -function init() { - var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; - - // Setup doctype select box - doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i=0; i 1) - addSelectValue(f, 'doctypes', p[0], p[1]); - } - - // Setup fonts select box - fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i=0; i 1) - addSelectValue(f, 'fontface', p[0], p[1]); - } - - // Setup fontsize select box - fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i=0; i 1) { - addSelectValue(f, 'element_style_media', p[0], p[1]); - addSelectValue(f, 'element_link_media', p[0], p[1]); - } - } - - // Setup encodings select box - encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i=0; i 1) { - addSelectValue(f, 'docencoding', p[0], p[1]); - addSelectValue(f, 'element_script_charset', p[0], p[1]); - addSelectValue(f, 'element_link_charset', p[0], p[1]); - } - } - - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); - document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Add iframe - dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); - doc = dom.get('documentIframe').contentWindow.document; - h = tinyMCEPopup.getWindowArg('head_html'); - - // Preprocess the HTML disable scripts and urls - h = h.replace(/ '; - } + if (!url) + return url; - return im; - }); - } - }); + if (force_absolute) + return editor.documentBaseURI.toAbsolute(url); + + return urlConverter.call(urlConverterScope, url, 'src', 'object'); }, getInfo : function() { @@ -202,213 +226,665 @@ }; }, - // Private methods - _objectsToSpans : function(ed, o) { - var t = this, h = o.content; + /** + * Converts the JSON data object to an img node. + */ + dataToImg : function(data, force_absolute) { + var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i; - h = h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { - var o = t._parse(c); + data.params.src = self.convertUrl(data.params.src, force_absolute); - return '' + attrs = data.video.attrs; + if (attrs) + attrs.src = self.convertUrl(attrs.src, force_absolute); + + if (attrs) + attrs.poster = self.convertUrl(attrs.poster, force_absolute); + + sources = toArray(data.video.sources); + if (sources) { + for (i = 0; i < sources.length; i++) + sources[i].src = self.convertUrl(sources[i].src, force_absolute); + } + + img = self.editor.dom.create('img', { + id : data.id, + style : data.style, + align : data.align, + hspace : data.hspace, + vspace : data.vspace, + src : self.editor.theme.url + '/img/trans.gif', + 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name, + 'data-mce-json' : JSON.serialize(data, "'") }); - h = h.replace(/]*)>/gi, ''); - h = h.replace(/]*)\/?>/gi, ''); - h = h.replace(/]*)>/gi, ''); - h = h.replace(/<\/(object)([^>]*)>/gi, ''); - h = h.replace(/<\/embed>/gi, ''); - h = h.replace(/]*)>/gi, function(a, b) {return ''}); - h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam">'); + img.width = data.width || (data.type == 'audio' ? "300" : "320"); + img.height = data.height || (data.type == 'audio' ? "32" : "240"); + + return img; + }, + + /** + * Converts the JSON data object to a HTML string. + */ + dataToHtml : function(data, force_absolute) { + return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute}); + }, + + /** + * Converts the JSON data object to a HTML string. + */ + htmlToData : function(html) { + var fragment, img, data; + + data = { + type : 'flash', + video: {sources:[]}, + params: {} + }; + + fragment = this.editor.parser.parse(html); + img = fragment.getAll('img')[0]; + + if (img) { + data = JSON.parse(img.attr('data-mce-json')); + data.type = this.getType(img.attr('class')).name.toLowerCase(); + + // Add some extra properties to the data object + tinymce.each(rootAttributes, function(name) { + var value = img.attr(name); - o.content = h; + if (value) + data[name] = value; + }); + } + + return data; + }, + + /** + * Get type item by extension, class, clsid or mime type. + * + * @method getType + * @param {String} value Value to get type item by. + * @return {Object} Type item object or undefined. + */ + getType : function(value) { + var i, values, typeItem; + + // Find type by checking the classes + values = tinymce.explode(value, ' '); + for (i = 0; i < values.length; i++) { + typeItem = this.lookup[values[i]]; + + if (typeItem) + return typeItem; + } }, - _buildObj : function(o, n) { - var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; - - stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; - - p.width = o.width = dom.getAttrib(n, 'width') || 100; - p.height = o.height = dom.getAttrib(n, 'height') || 100; - - if (p.src) - p.src = ed.convertURL(p.src, 'src', n); - - if (stc) { - ob = dom.create('span', { - id : p.id, - _mce_name : 'object', - type : 'application/x-shockwave-flash', - data : p.src, - style : dom.getAttrib(n, 'style'), - width : o.width, - height : o.height + /** + * Converts a tinymce.html.Node image element to video/object/embed. + */ + imgToObject : function(node, args) { + var self = this, editor = self.editor, video, object, embed, iframe, name, value, data, + source, sources, params, param, typeItem, i, item, mp4Source, replacement, + posterSrc, style, audio; + + // Adds the flash player + function addPlayer(video_src, poster_src) { + var baseUri, flashVars, flashVarsOutput, params, flashPlayer; + + flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf')); + if (flashPlayer) { + baseUri = editor.documentBaseURI; + data.params.src = flashPlayer; + + // Convert the movie url to absolute urls + if (editor.getParam('flash_video_player_absvideourl', true)) { + video_src = baseUri.toAbsolute(video_src || '', true); + poster_src = baseUri.toAbsolute(poster_src || '', true); + } + + // Generate flash vars + flashVarsOutput = ''; + flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}); + tinymce.each(flashVars, function(value, name) { + // Replace $url and $poster variables in flashvars value + value = value.replace(/\$url/, video_src || ''); + value = value.replace(/\$poster/, poster_src || ''); + + if (value.length > 0) + flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); + }); + + if (flashVarsOutput.length) + data.params.flashvars = flashVarsOutput; + + params = editor.getParam('flash_video_player_params', { + allowfullscreen: true, + allowscriptaccess: true + }); + + tinymce.each(params, function(value, name) { + data.params[name] = "" + value; + }); + } + }; + + data = node.attr('data-mce-json'); + if (!data) + return; + + data = JSON.parse(data); + typeItem = this.getType(node.attr('class')); + + style = node.attr('data-mce-style') + if (!style) { + style = node.attr('style'); + + if (style) + style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); + } + + // Handle iframe + if (typeItem.name === 'Iframe') { + replacement = new Node('iframe', 1); + + tinymce.each(rootAttributes, function(name) { + var value = node.attr(name); + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && value.length > 0) + replacement.attr(name, value); }); - } else { - ob = dom.create('span', { - id : p.id, - _mce_name : 'object', - classid : "clsid:" + o.classid, - style : dom.getAttrib(n, 'style'), - codebase : o.codebase, - width : o.width, - height : o.height + + for (name in data.params) + replacement.attr(name, data.params[name]); + + replacement.attr({ + style: style, + src: data.params.src }); + + node.replace(replacement); + + return; } - each (p, function(v, k) { - if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { - // Use url instead of src in IE for Windows media - if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) - k = 'url'; + // Handle scripts + if (this.editor.settings.media_use_script) { + replacement = new Node('script', 1).attr('type', 'text/javascript'); + + value = new Node('#text', 3); + value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { + width: node.attr('width'), + height: node.attr('height') + })) + ');'; + + replacement.append(value); + node.replace(replacement); - if (v) - dom.add(ob, 'span', {_mce_name : 'param', name : k, '_mce_value' : v}); + return; + } + + // Add HTML5 video element + if (typeItem.name === 'Video' && data.video.sources[0]) { + // Create new object element + video = new Node('video', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + for (i = 0; i < sources.length; i++) { + if (/\.mp4$/.test(sources[i].src)) + mp4Source = sources[i].src; } - }); - if (!stc) - dom.add(ob, 'span', tinymce.extend({_mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); + if (!sources[0].type) { + video.attr('src', sources[0].src); + sources.splice(0, 1); + } - return ob; - }, + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + video.append(source); + } - _spansToImgs : function(p) { - var t = this, dom = t.editor.dom, im, ci; + // Create flash fallback for video if we have a mp4 source + if (mp4Source) { + addPlayer(mp4Source, posterSrc); + typeItem = self.getType('flash'); + } else + data.params.src = ''; + } - each(dom.select('span', p), function(n) { - // Convert object into image - if (dom.getAttrib(n, 'class') == 'mceItemObject') { - ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); + // Add HTML5 audio element + if (typeItem.name === 'Audio' && data.video.sources[0]) { + // Create new object element + audio = new Node('audio', 1).attr(tinymce.extend({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }, data.video.attrs)); + + // Get poster source and use that for flash fallback + if (data.video.attrs) + posterSrc = data.video.attrs.poster; + + sources = data.video.sources = toArray(data.video.sources); + if (!sources[0].type) { + audio.attr('src', sources[0].src); + sources.splice(0, 1); + } - switch (ci) { - case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': - dom.replace(t._createImg('mceItemFlash', n), n); - break; + for (i = 0; i < sources.length; i++) { + source = new Node('source', 1).attr(sources[i]); + source.shortEnded = true; + audio.append(source); + } - case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; + data.params.src = ''; + } - case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': - case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': - case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; + if (typeItem.name === 'EmbeddedAudio') { + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: node.attr('type') + }); - case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; + for (name in data.params) + embed.attr(name, data.params[name]); - case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - - return; + data.params.src = ''; + } + + // Do we have a params src then we can generate object + if (data.params.src) { + // Is flv movie add player for it + if (/\.flv$/i.test(data.params.src)) + addPlayer(data.params.src, ''); + + if (args && args.force_absolute) + data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); + + // Create new object element + object = new Node('object', 1).attr({ + id : node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style + }); + + tinymce.each(rootAttributes, function(name) { + var value = data[name]; + + if (name == 'class' && value) + value = value.replace(/mceItem.+ ?/g, ''); + + if (value && name != 'type') + object.attr(name, value); + }); + + // Add params + for (name in data.params) { + param = new Node('param', 1); + param.shortEnded = true; + value = data.params[name]; + + // Windows media needs to use url instead of src for the media URL + if (name === 'src' && typeItem.name === 'WindowsMedia') + name = 'url'; + + param.attr({name: name, value: value}); + object.append(param); } - // Convert embed into image - if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { - switch (dom.getAttrib(n, 'type')) { - case 'application/x-shockwave-flash': - dom.replace(t._createImg('mceItemFlash', n), n); - break; + // Setup add type and classid if strict is disabled + if (this.editor.getParam('media_strict', true)) { + object.attr({ + data: data.params.src, + type: typeItem.mimes[0] + }); + } else { + object.attr({ + classid: "clsid:" + typeItem.clsids[0], + codebase: typeItem.codebase + }); - case 'application/x-director': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; + embed = new Node('embed', 1); + embed.shortEnded = true; + embed.attr({ + id: node.attr('id'), + width: node.attr('width'), + height: node.attr('height'), + style : style, + type: typeItem.mimes[0] + }); - case 'application/x-mplayer2': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; + for (name in data.params) + embed.attr(name, data.params[name]); - case 'video/quicktime': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; + tinymce.each(rootAttributes, function(name) { + if (data[name] && name != 'type') + embed.attr(name, data[name]); + }); - case 'audio/x-pn-realaudio-plugin': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; + object.append(embed); + } - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - } - }); + // Insert raw HTML + if (data.object_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.object_html; + object.append(value); + } + + // Append object to video element if it exists + if (video) + video.append(object); + } + + if (video) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + video.append(value); + } + } + + if (audio) { + // Insert raw HTML + if (data.video_html) { + value = new Node('#text', 3); + value.raw = true; + value.value = data.video_html; + audio.append(value); + } + } + + var n = video || audio || object || embed; + if (n) + node.replace(n); + else + node.remove(); }, - _createImg : function(cl, n) { - var im, dom = this.editor.dom, pa = {}, ti = '', args; + /** + * Converts a tinymce.html.Node video/object/embed to an img element. + * + * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: + * + * + * The JSON structure will be like this: + * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} + */ + objectToImg : function(node) { + var object, embed, video, iframe, img, name, id, width, height, style, i, html, + param, params, source, sources, data, type, lookup = this.lookup, + matches, attrs, urlConverter = this.editor.settings.url_converter, + urlConverterScope = this.editor.settings.url_converter_scope, + hspace, vspace, align, bgcolor; + + function getInnerHTML(node) { + return new tinymce.html.Serializer({ + inner: true, + validate: false + }).serialize(node); + }; - args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; + function lookupAttribute(o, attr) { + return lookup[(o.attr(attr) || '').toLowerCase()]; + } - // Create image - im = dom.create('img', { - src : this.url + '/img/trans.gif', - width : dom.getAttrib(n, 'width') || 100, - height : dom.getAttrib(n, 'height') || 100, - style : dom.getAttrib(n, 'style'), - 'class' : cl - }); + function lookupExtension(src) { + var ext = src.replace(/^.*\.([^.]+)$/, '$1'); + return lookup[ext.toLowerCase() || '']; + } - // Setup base parameters - each(args, function(na) { - var v = dom.getAttrib(n, na); + // If node isn't in document + if (!node.parent) + return; - if (v) - pa[na] = v; - }); + // Handle media scripts + if (node.name === 'script') { + if (node.firstChild) + matches = scriptRegExp.exec(node.firstChild.value); + + if (!matches) + return; + + type = matches[1]; + data = {video : {}, params : JSON.parse(matches[2])}; + width = data.params.width; + height = data.params.height; + } - // Add optional parameters - each(dom.select('span', n), function(n) { - if (dom.hasClass(n, 'mceItemParam')) - pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); + // Setup data objects + data = data || { + video : {}, + params : {} + }; + + // Setup new image object + img = new Node('img', 1); + img.attr({ + src : this.editor.theme.url + '/img/trans.gif' }); - // Use src not movie - if (pa.movie) { - pa.src = pa.movie; - delete pa.movie; + // Video element + name = node.name; + if (name === 'video' || name == 'audio') { + video = node; + object = node.getAll('object')[0]; + embed = node.getAll('embed')[0]; + width = video.attr('width'); + height = video.attr('height'); + id = video.attr('id'); + data.video = {attrs : {}, sources : []}; + + // Get all video attributes + attrs = data.video.attrs; + for (name in video.attributes.map) + attrs[name] = video.attributes.map[name]; + + source = node.attr('src'); + if (source) + data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)}); + + // Get all sources + sources = video.getAll("source"); + for (i = 0; i < sources.length; i++) { + source = sources[i].remove(); + + data.video.sources.push({ + src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), + type: source.attr('type'), + media: source.attr('media') + }); + } + + // Convert the poster URL + if (attrs.poster) + attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name); + } + + // Object element + if (node.name === 'object') { + object = node; + embed = node.getAll('embed')[0]; + } + + // Embed element + if (node.name === 'embed') + embed = node; + + // Iframe element + if (node.name === 'iframe') { + iframe = node; + type = 'Iframe'; } - // No src try data - if (!pa.src) { - pa.src = pa.data; - delete pa.data; + if (object) { + // Get width/height + width = width || object.attr('width'); + height = height || object.attr('height'); + style = style || object.attr('style'); + id = id || object.attr('id'); + hspace = hspace || object.attr('hspace'); + vspace = vspace || object.attr('vspace'); + align = align || object.attr('align'); + bgcolor = bgcolor || object.attr('bgcolor'); + data.name = object.attr('name'); + + // Get all object params + params = object.getAll("param"); + for (i = 0; i < params.length; i++) { + param = params[i]; + name = param.remove().attr('name'); + + if (!excludedAttrs[name]) + data.params[name] = param.attr('value'); + } + + data.params.src = data.params.src || object.attr('data'); } - // Merge with embed args - n = dom.select('.mceItemEmbed', n)[0]; - if (n) { - each(args, function(na) { - var v = dom.getAttrib(n, na); + if (embed) { + // Get width/height + width = width || embed.attr('width'); + height = height || embed.attr('height'); + style = style || embed.attr('style'); + id = id || embed.attr('id'); + hspace = hspace || embed.attr('hspace'); + vspace = vspace || embed.attr('vspace'); + align = align || embed.attr('align'); + bgcolor = bgcolor || embed.attr('bgcolor'); + + // Get all embed attributes + for (name in embed.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = embed.attributes.map[name]; + } + } - if (v && !pa[na]) - pa[na] = v; + if (iframe) { + // Get width/height + width = iframe.attr('width'); + height = iframe.attr('height'); + style = style || iframe.attr('style'); + id = iframe.attr('id'); + hspace = iframe.attr('hspace'); + vspace = iframe.attr('vspace'); + align = iframe.attr('align'); + bgcolor = iframe.attr('bgcolor'); + + tinymce.each(rootAttributes, function(name) { + img.attr(name, iframe.attr(name)); }); + + // Get all iframe attributes + for (name in iframe.attributes.map) { + if (!excludedAttrs[name] && !data.params[name]) + data.params[name] = iframe.attributes.map[name]; + } } - delete pa.width; - delete pa.height; + // Use src not movie + if (data.params.movie) { + data.params.src = data.params.src || data.params.movie; + delete data.params.movie; + } - im.title = this._serialize(pa); + // Convert the URL to relative/absolute depending on configuration + if (data.params.src) + data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); - return im; - }, + if (video) { + if (node.name === 'video') + type = lookup.video.name; + else if (node.name === 'audio') + type = lookup.audio.name; + } - _parse : function(s) { - return tinymce.util.JSON.parse('{' + s + '}'); - }, + if (object && !type) + type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name; + + if (embed && !type) + type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name; - _serialize : function(o) { - return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); + // for embedded audio we preserve the original specified type + if (embed && type == 'EmbeddedAudio') { + data.params.type = embed.attr('type'); + } + + // Replace the video/object/embed element with a placeholder image containing the data + node.replace(img); + + // Remove embed + if (embed) + embed.remove(); + + // Serialize the inner HTML of the object element + if (object) { + html = getInnerHTML(object.remove()); + + if (html) + data.object_html = html; + } + + // Serialize the inner HTML of the video element + if (video) { + html = getInnerHTML(video.remove()); + + if (html) + data.video_html = html; + } + + data.hspace = hspace; + data.vspace = vspace; + data.align = align; + data.bgcolor = bgcolor; + + // Set width/height of placeholder + img.attr({ + id : id, + 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), + style : style, + width : width || (node.name == 'audio' ? "300" : "320"), + height : height || (node.name == 'audio' ? "32" : "240"), + hspace : hspace, + vspace : vspace, + align : align, + bgcolor : bgcolor, + "data-mce-json" : JSON.serialize(data, "'") + }); } }); // Register plugin tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); \ No newline at end of file +})(); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/img/flash.gif b/library/tinymce/jscripts/tiny_mce/plugins/media/img/flash.gif deleted file mode 100755 index cb192e6ceda8d19ad8e7d08dd1cfde0aa72ead2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 241 zcmVOzlLa+Za}7>m0&NpCfJ0FQc3~F7DE)S%o1)Qi1n@vxX46qnD4hRS-NE*Pw!4UvE=#^N( diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf b/library/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf deleted file mode 100755 index 042c2ab969e98a6fdbe08848c4a73bd2c41de906..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11668 zcmV;FEo;(4S5pYUVE_PloV|PrTvNvr@V+F3a36As0Rb-#MGjBSfQpD35b>z>Admpj zkkAkitwp@*Rqv`rs-o69lDZ&@y{HKo3{JcK8Rt^ z72Hab0Fi(9n@~bYkV2y_)Fy`HtF#7{J|rojb4e1a7ekY%Jpqu!GtXQ6#>m0qvY zqk05XkPr<=DTomvJ9PBuQB+V+fX0s>j}|Rjgg*T6Llosb@Z|f-K0(8m{He?6zo^!s zgW%o|yBiCa{N=g3_eV+xKc?-B?2)mXBGanczVGz$;(Jq8W!}yB$#d7jwz;Cki@c`f zWnSDHobzK#aT@9u=8^8x_Ib_e#Xl4Y`Zer+8u>-bA6`uVXi-Ep^6uWh%d8KaJS&g= z)KA}qY1=qz((;kczfDdZmcI1pls2gC!tgBV;pBqfKiK7u7MDbR)&C>$gyc05A7uO} zTU6zl(L392O7^D-J^u?tL2G}Nl|dGb6UZS!lq5p+9>gp}0$|zy zkSG#qbPAfg3zp?lIyJ5j#n!UMW{%nE-W&j!ZI})Q-KC5ph&MP(<)Js zTB%fN`{MEmC|{-4pi+ZEZQoGP^zA& zLSxF+rRqEl+hmTqSfx>GRVc3zjiF2!xFY<5N}=@HB8fb_IYAXlu?mZ7o| zrNW>xk}{1xtqwkmRR+Z{LK(lMQ+^9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}3 ze|_=3Wb&TU`%SO6(2ZQZqf&|yfMthy(G*fa6>Yl^Hx8=GtqqH9}^n3 z?n|l4A|t<=x|*Yb?<6<<7TA&>f9U>1dpj5?ep3Zerh8l2F(?MB_nTf-LE=C)bwEc0 zd=pU2pqcEdMpN>MhiCy_w@5%qF4s?{o$NOgP4-e7%Us?WKuxEPeDVi{|B8v^R zB>cGn?UUW+E~#=aaYWFkwhoKc;CAT!w6v!!;h98w>O^~*NS!XbLWOrSlF@Laq(1%H zwQI=TMN<`1aa?+*WrOkuCFk2^oD7pW8IFQy3V04~Lb8bZ?L&=BI^DTJ=v^#E8S4m$fXGF-bTg^FJ?Eia`h^T diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/img/quicktime.gif b/library/tinymce/jscripts/tiny_mce/plugins/media/img/quicktime.gif deleted file mode 100755 index 3b0499145b16138249f653a1a3f2c80230fb292c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 303 zcmV+~0nq+ONk%w1VGsZi0K^{vH>m7Qv+~s9^fsC5ZpZP=*zu3F=Jxpf8k_5u%JNv6 z=md-84VLU4w)kSE=yI&-yw>b=v+SqE?+kq47pC+YrR?bJ^yu>Zyvpn;hTp*6^mM!O zu+8$^=JX7bb<~J01ZTA{q@86#&8&6~H`Ss{{?p%K!-p%L6P2TpFYz90?pD06UU# BbnE~C diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/img/shockwave.gif b/library/tinymce/jscripts/tiny_mce/plugins/media/img/shockwave.gif deleted file mode 100755 index 5f235dfc7363bd4957b5fe352e16a7eee9a38574..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 387 zcmZ?wbhEHb6lD-#xXJ(m|AF9|(f@B(e|&xQ_v6XWFR%Td$?$)n^p7RFzqSScKhyN< z>ipLaF8n=^^LJP4|1^gGRdo_Rl+a*grZQ1hw@Zo1ikN$oB{QbRq&z?QIckdq1aE3;Fq_(WV>Kc7gjQtQh+9OrtFhn-)LUqD<|MOIl_!(Ed#pPRE;S)g;ew3>pd zn`Wa(lc2DGa)peFw3f88dp-|`@*)AXj;@(8hwDr|7Sxsp;&YxjN*Y{PBB!TIU|!b7Zgv0OaG5)&Kwi diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js b/library/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/js/media.js b/library/tinymce/jscripts/tiny_mce/plugins/media/js/media.js old mode 100755 new mode 100644 index 86cfa98563..733c5f6c28 --- a/library/tinymce/jscripts/tiny_mce/plugins/media/js/media.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/media/js/media.js @@ -1,630 +1,470 @@ -tinyMCEPopup.requireLangPack(); +(function() { + var url; -var oldWidth, oldHeight, ed, url; + if (url = tinyMCEPopup.getParam("media_external_list_url")) + document.write(''); -if (url = tinyMCEPopup.getParam("media_external_list_url")) - document.write(''); - -function init() { - var pl = "", f, val; - var type = "flash", fe, i; - - ed = tinyMCEPopup.editor; - - tinyMCEPopup.resizeToInnerSize(); - f = document.forms[0] - - fe = ed.selection.getNode(); - if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - pl = fe.title; - - switch (ed.dom.getAttrib(fe, 'class')) { - case 'mceItemFlash': - type = 'flash'; - break; - - case 'mceItemFlashVideo': - type = 'flv'; - break; - - case 'mceItemShockWave': - type = 'shockwave'; - break; - - case 'mceItemWindowsMedia': - type = 'wmp'; - break; - - case 'mceItemQuickTime': - type = 'qt'; - break; - - case 'mceItemRealMedia': - type = 'rmp'; - break; - } - - document.forms[0].insert.value = ed.getLang('update', 'Insert', true); - } - - document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var html = getMediaListHTML('medialist','src','media','media'); - if (html == "") - document.getElementById("linklistrow").style.display = 'none'; - else - document.getElementById("linklistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('filebrowser')) - document.getElementById('src').style.width = '230px'; - - // Setup form - if (pl != "") { - pl = tinyMCEPopup.editor.plugins.media._parse(pl); - - switch (type) { - case "flash": - setBool(pl, 'flash', 'play'); - setBool(pl, 'flash', 'loop'); - setBool(pl, 'flash', 'menu'); - setBool(pl, 'flash', 'swliveconnect'); - setStr(pl, 'flash', 'quality'); - setStr(pl, 'flash', 'scale'); - setStr(pl, 'flash', 'salign'); - setStr(pl, 'flash', 'wmode'); - setStr(pl, 'flash', 'base'); - setStr(pl, 'flash', 'flashvars'); - break; - - case "qt": - setBool(pl, 'qt', 'loop'); - setBool(pl, 'qt', 'autoplay'); - setBool(pl, 'qt', 'cache'); - setBool(pl, 'qt', 'controller'); - setBool(pl, 'qt', 'correction'); - setBool(pl, 'qt', 'enablejavascript'); - setBool(pl, 'qt', 'kioskmode'); - setBool(pl, 'qt', 'autohref'); - setBool(pl, 'qt', 'playeveryframe'); - setBool(pl, 'qt', 'tarsetcache'); - setStr(pl, 'qt', 'scale'); - setStr(pl, 'qt', 'starttime'); - setStr(pl, 'qt', 'endtime'); - setStr(pl, 'qt', 'tarset'); - setStr(pl, 'qt', 'qtsrcchokespeed'); - setStr(pl, 'qt', 'volume'); - setStr(pl, 'qt', 'qtsrc'); - break; - - case "shockwave": - setBool(pl, 'shockwave', 'sound'); - setBool(pl, 'shockwave', 'progress'); - setBool(pl, 'shockwave', 'autostart'); - setBool(pl, 'shockwave', 'swliveconnect'); - setStr(pl, 'shockwave', 'swvolume'); - setStr(pl, 'shockwave', 'swstretchstyle'); - setStr(pl, 'shockwave', 'swstretchhalign'); - setStr(pl, 'shockwave', 'swstretchvalign'); - break; - - case "wmp": - setBool(pl, 'wmp', 'autostart'); - setBool(pl, 'wmp', 'enabled'); - setBool(pl, 'wmp', 'enablecontextmenu'); - setBool(pl, 'wmp', 'fullscreen'); - setBool(pl, 'wmp', 'invokeurls'); - setBool(pl, 'wmp', 'mute'); - setBool(pl, 'wmp', 'stretchtofit'); - setBool(pl, 'wmp', 'windowlessvideo'); - setStr(pl, 'wmp', 'balance'); - setStr(pl, 'wmp', 'baseurl'); - setStr(pl, 'wmp', 'captioningid'); - setStr(pl, 'wmp', 'currentmarker'); - setStr(pl, 'wmp', 'currentposition'); - setStr(pl, 'wmp', 'defaultframe'); - setStr(pl, 'wmp', 'playcount'); - setStr(pl, 'wmp', 'rate'); - setStr(pl, 'wmp', 'uimode'); - setStr(pl, 'wmp', 'volume'); - break; - - case "rmp": - setBool(pl, 'rmp', 'autostart'); - setBool(pl, 'rmp', 'loop'); - setBool(pl, 'rmp', 'autogotourl'); - setBool(pl, 'rmp', 'center'); - setBool(pl, 'rmp', 'imagestatus'); - setBool(pl, 'rmp', 'maintainaspect'); - setBool(pl, 'rmp', 'nojava'); - setBool(pl, 'rmp', 'prefetch'); - setBool(pl, 'rmp', 'shuffle'); - setStr(pl, 'rmp', 'console'); - setStr(pl, 'rmp', 'controls'); - setStr(pl, 'rmp', 'numloop'); - setStr(pl, 'rmp', 'scriptcallbacks'); - break; - } - - setStr(pl, null, 'src'); - setStr(pl, null, 'id'); - setStr(pl, null, 'name'); - setStr(pl, null, 'vspace'); - setStr(pl, null, 'hspace'); - setStr(pl, null, 'bgcolor'); - setStr(pl, null, 'align'); - setStr(pl, null, 'width'); - setStr(pl, null, 'height'); - - if ((val = ed.dom.getAttrib(fe, "width")) != "") - pl.width = f.width.value = val; - - if ((val = ed.dom.getAttrib(fe, "height")) != "") - pl.height = f.height.value = val; - - oldWidth = pl.width ? parseInt(pl.width) : 0; - oldHeight = pl.height ? parseInt(pl.height) : 0; - } else - oldWidth = oldHeight = 0; - - selectByValue(f, 'media_type', type); - changedType(type); - updateColor('bgcolor_pick', 'bgcolor'); - - TinyMCE_EditableSelects.init(); - generatePreview(); -} - -function insertMedia() { - var fe, f = document.forms[0], h; - - tinyMCEPopup.restoreSelection(); - - if (!AutoValidator.validate(f)) { - tinyMCEPopup.alert(ed.getLang('invalid_data')); - return false; + function get(id) { + return document.getElementById(id); } - f.width.value = f.width.value == "" ? 100 : f.width.value; - f.height.value = f.height.value == "" ? 100 : f.height.value; + function clone(obj) { + var i, len, copy, attr; - fe = ed.selection.getNode(); - if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - fe.className = "mceItemFlash"; - break; + if (null == obj || "object" != typeof obj) + return obj; - case "flv": - fe.className = "mceItemFlashVideo"; - break; + // Handle Array + if ('length' in obj) { + copy = []; - case "shockwave": - fe.className = "mceItemShockWave"; - break; - - case "qt": - fe.className = "mceItemQuickTime"; - break; - - case "wmp": - fe.className = "mceItemWindowsMedia"; - break; + for (i = 0, len = obj.length; i < len; ++i) { + copy[i] = clone(obj[i]); + } - case "rmp": - fe.className = "mceItemRealMedia"; - break; + return copy; } - if (fe.width != f.width.value || fe.height != f.height.value) - ed.execCommand('mceRepaint'); - - fe.title = serializeParameters(); - fe.width = f.width.value; - fe.height = f.height.value; - fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); - fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); - fe.align = f.align.options[f.align.selectedIndex].value; - } else { - h = ' 0) { - var html = ""; - - html += ''; - - return html; + return elm.value; } - return ""; -} - -function getType(v) { - var fo, i, c, el, x, f = document.forms[0]; - - fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); - - // YouTube - if (v.match(/watch\?v=(.+)(.*)/)) { - f.width.value = '425'; - f.height.value = '350'; - f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; - return 'flash'; - } - - // Google video - if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { - f.width.value = '425'; - f.height.value = '326'; - f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; - return 'flash'; - } - - for (i=0; i 0 ? s.substring(0, s.length - 1) : s; - - return s; -} - -function setBool(pl, p, n) { - if (typeof(pl[n]) == "undefined") - return; - - document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; -} - -function setStr(pl, p, n) { - var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; - - if (typeof(pl[n]) == "undefined") - return; + window.Media = { + init : function() { + var html, editor, self = this; - if (e.type == "text") - e.value = pl[n]; - else - selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); -} + self.editor = editor = tinyMCEPopup.editor; -function getBool(p, n, d, tv, fv) { - var v = document.forms[0].elements[p + "_" + n].checked; + // Setup file browsers and color pickers + get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); + get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media'); + get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media'); + get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media'); + get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media'); + get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); - tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; - fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; + html = self.getMediaListHTML('medialist', 'src', 'media', 'media'); + if (html == "") + get("linklistrow").style.display = 'none'; + else + get("linklistcontainer").innerHTML = html; - return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); -} + if (isVisible('filebrowser')) + get('src').style.width = '230px'; + + if (isVisible('video_filebrowser_altsource1')) + get('video_altsource1').style.width = '220px'; + + if (isVisible('video_filebrowser_altsource2')) + get('video_altsource2').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource1')) + get('audio_altsource1').style.width = '220px'; + + if (isVisible('audio_filebrowser_altsource2')) + get('audio_altsource2').style.width = '220px'; + + if (isVisible('filebrowser_poster')) + get('video_poster').style.width = '220px'; + + editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor)); + + self.setDefaultDialogSettings(editor); + self.data = clone(tinyMCEPopup.getWindowArg('data')); + self.dataToForm(); + self.preview(); + + updateColor('bgcolor_pick', 'bgcolor'); + }, + + insert : function() { + var editor = tinyMCEPopup.editor; + + this.formToData(); + editor.execCommand('mceRepaint'); + tinyMCEPopup.restoreSelection(); + editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); + tinyMCEPopup.close(); + }, + + preview : function() { + get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); + }, + + moveStates : function(to_form, field) { + var data = this.data, editor = this.editor, + mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; + + defaultStates = { + // QuickTime + quicktime_autoplay : true, + quicktime_controller : true, + + // Flash + flash_play : true, + flash_loop : true, + flash_menu : true, + + // WindowsMedia + windowsmedia_autostart : true, + windowsmedia_enablecontextmenu : true, + windowsmedia_invokeurls : true, + + // RealMedia + realmedia_autogotourl : true, + realmedia_imagestatus : true + }; + + function parseQueryParams(str) { + var out = {}; + + if (str) { + tinymce.each(str.split('&'), function(item) { + var parts = item.split('='); + + out[unescape(parts[0])] = unescape(parts[1]); + }); + } + + return out; + }; + + function setOptions(type, names) { + var i, name, formItemName, value, list; + + if (type == data.type || type == 'global') { + names = tinymce.explode(names); + for (i = 0; i < names.length; i++) { + name = names[i]; + formItemName = type == 'global' ? name : type + '_' + name; + + if (type == 'global') + list = data; + else if (type == 'video' || type == 'audio') { + list = data.video.attrs; + + if (!list && !to_form) + data.video.attrs = list = {}; + } else + list = data.params; + + if (list) { + if (to_form) { + setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : ''); + } else { + delete list[name]; + + value = getVal(formItemName); + if ((type == 'video' || type == 'audio') && value === true) + value = name; + + if (defaultStates[formItemName]) { + if (value !== defaultStates[formItemName]) { + value = "" + value; + list[name] = value; + } + } else if (value) { + value = "" + value; + list[name] = value; + } + } + } + } + } + } -function getStr(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + if (!to_form) { + data.type = get('media_type').options[get('media_type').selectedIndex].value; + data.width = getVal('width'); + data.height = getVal('height'); - if (n == 'src') - v = tinyMCEPopup.editor.convertURL(v, 'src', null); + // Switch type based on extension + src = getVal('src'); + if (field == 'src') { + ext = src.replace(/^.*\.([^.]+)$/, '$1'); + if (typeInfo = mediaPlugin.getType(ext)) + data.type = typeInfo.name.toLowerCase(); - return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); -} + setVal('media_type', data.type); + } -function getInt(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + if (data.type == "video" || data.type == "audio") { + if (!data.video.sources) + data.video.sources = []; - return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); -} + data.video.sources[0] = {src: getVal('src')}; + } + } -function jsEncode(s) { - s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); - s = s.replace(new RegExp('"', 'g'), '\\"'); - s = s.replace(new RegExp("'", 'g'), "\\'"); + // Hide all fieldsets and show the one active + get('video_options').style.display = 'none'; + get('audio_options').style.display = 'none'; + get('flash_options').style.display = 'none'; + get('quicktime_options').style.display = 'none'; + get('shockwave_options').style.display = 'none'; + get('windowsmedia_options').style.display = 'none'; + get('realmedia_options').style.display = 'none'; + get('embeddedaudio_options').style.display = 'none'; + + if (get(data.type + '_options')) + get(data.type + '_options').style.display = 'block'; + + setVal('media_type', data.type); + + setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); + setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); + setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); + setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); + setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); + setOptions('video', 'poster,autoplay,loop,muted,preload,controls'); + setOptions('audio', 'autoplay,loop,preload,controls'); + setOptions('embeddedaudio', 'autoplay,loop,controls'); + setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); + + if (to_form) { + if (data.type == 'video') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('video_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('video_altsource2', src.src); + } else if (data.type == 'audio') { + if (data.video.sources[0]) + setVal('src', data.video.sources[0].src); + + src = data.video.sources[1]; + if (src) + setVal('audio_altsource1', src.src); + + src = data.video.sources[2]; + if (src) + setVal('audio_altsource2', src.src); + } else { + // Check flash vars + if (data.type == 'flash') { + tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { + if (value == '$url') + data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || ''; + }); + } + + setVal('src', data.params.src); + } + } else { + src = getVal("src"); + + // YouTube *NEW* + if (src.match(/youtu.be\/[a-z1-9.-_]+/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // YouTube + if (src.match(/youtube.com(.+)v=([^&]+)/)) { + data.width = 425; + data.height = 350; + data.params.frameborder = '0'; + data.type = 'iframe'; + src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; + setVal('src', src); + setVal('media_type', data.type); + } + + // Google video + if (src.match(/video.google.com(.+)docid=([^&]+)/)) { + data.width = 425; + data.height = 326; + data.type = 'flash'; + src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; + setVal('src', src); + setVal('media_type', data.type); + } + + if (data.type == 'video') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("video_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("video_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else if (data.type == 'audio') { + if (!data.video.sources) + data.video.sources = []; + + data.video.sources[0] = {src : src}; + + src = getVal("audio_altsource1"); + if (src) + data.video.sources[1] = {src : src}; + + src = getVal("audio_altsource2"); + if (src) + data.video.sources[2] = {src : src}; + } else + data.params.src = src; + + // Set default size + setVal('width', data.width || (data.type == 'audio' ? 300 : 320)); + setVal('height', data.height || (data.type == 'audio' ? 32 : 240)); + } + }, + + dataToForm : function() { + this.moveStates(true); + }, + + formToData : function(field) { + if (field == "width" || field == "height") + this.changeSize(field); + + if (field == 'source') { + this.moveStates(false, field); + setVal('source', this.editor.plugins.media.dataToHtml(this.data)); + this.panel = 'source'; + } else { + if (this.panel == 'source') { + this.data = clone(this.editor.plugins.media.htmlToData(getVal('source'))); + this.dataToForm(); + this.panel = ''; + } + + this.moveStates(false, field); + this.preview(); + } + }, + + beforeResize : function() { + this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + }, + + changeSize : function(type) { + var width, height, scale, size; + + if (get('constrain').checked) { + width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10); + height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10); + + if (type == 'width') { + this.height = Math.round((width / this.width) * height); + setVal('height', this.height); + } else { + this.width = Math.round((height / this.height) * width); + setVal('width', this.width); + } + } + }, - return s; -} + getMediaListHTML : function() { + if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { + var html = ""; -function generatePreview(c) { - var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; + html += ''; - if (f.width.value != "" && f.height.value != "") { - if (f.constrain.checked) { - if (c == 'width' && oldWidth != 0) { - wp = nw / oldWidth; - nh = Math.round(wp * nh); - f.height.value = nh; - } else if (c == 'height' && oldHeight != 0) { - hp = nh / oldHeight; - nw = Math.round(hp * nw); - f.width.value = nw; + return html; } - } - } - if (f.width.value != "") - oldWidth = nw; - - if (f.height.value != "") - oldHeight = nh; - - // After constrain - pl = serializeParameters(); - - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - type = 'application/x-shockwave-flash'; - break; - - case "shockwave": - cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - type = 'application/x-director'; - break; - - case "qt": - cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; - codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - type = 'video/quicktime'; - break; - - case "wmp": - cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'application/x-mplayer2'; - break; - - case "rmp": - cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'audio/x-pn-realaudio-plugin'; - break; - } + return ""; + }, - if (pl == '') { - p.innerHTML = ''; - return; - } + getMediaTypeHTML : function(editor) { + function option(media_type, element) { + if (!editor.schema.getElementRule(element || media_type)) { + return ''; + } - pl = tinyMCEPopup.editor.plugins.media._parse(pl); + return '' + } - if (!pl.src) { - p.innerHTML = ''; - return; - } + var html = ""; - pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); - pl.width = !pl.width ? 100 : pl.width; - pl.height = !pl.height ? 100 : pl.height; - pl.id = !pl.id ? 'obj' : pl.id; - pl.name = !pl.name ? 'eobj' : pl.name; - pl.align = !pl.align ? '' : pl.align; + html += ''; + return html; + }, - // Add extra url parameter if it's an absolute URL - if (n == 'src' && pl[n].indexOf('://') != -1) - h += ''; + setDefaultDialogSettings : function(editor) { + var defaultDialogSettings = editor.getParam("media_dialog_defaults", {}); + tinymce.each(defaultDialogSettings, function(v, k) { + setVal(k, v); + }); } - } - - h += ' - -
                -
                + + + @@ -24,28 +25,21 @@
                {#media_dlg.general} - +
                -
                - +
                - - - + @@ -56,10 +50,10 @@
                + + + - +
                 
                - +
                - - + +
                x    x   
                @@ -78,18 +72,18 @@
                {#media_dlg.advanced} - +
                - + - + - + - +
                - @@ -100,9 +94,9 @@ - +
                - +
                 
                @@ -111,192 +105,284 @@
                -
                - {#media_dlg.flash_options} +
                + {#media_dlg.html5_video_options} - +
                - + + - + + - + + - + + +
                - + + + + + +
                 
                - + + + + + +
                 
                - + + + + + +
                 
                - + + +
                + -
                - + -
                + - - + +
                - + + + + + +
                + - - + + + +
                +
                + + + + + +
                +
                + + + +
                + + +
                + {#media_dlg.embedded_audio_options} + -
                - + -
                + - - + +
                - + - -
                + - - + +
                - - - - - - - - - +
                + + + + + +
                +
                -
                - {#media_dlg.flv_options} +
                + {#media_dlg.html5_audio_options} - +
                - + - - - - - - - - + + - - - - + + +
                - + + + + + +
                 
                + + + + + +
                 
                +
                + +
                + -
                - + -
                + - - + +
                - + + + +
                + + + + + +
                +
                + - - + +
                + + +
                + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + @@ -304,45 +390,57 @@
                + + + +
                + + + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                + + + + + + + + + + + +
                -
                +
                {#media_dlg.qt_options} - +
                @@ -350,19 +448,19 @@ @@ -370,19 +468,19 @@ @@ -390,19 +488,19 @@ @@ -410,27 +508,27 @@ - - + - - + + - - + + - - + + - - + + - - + + - - + + - +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - - - - - -
                 
                + + + + + +
                 
                -
                +
                {#media_dlg.wmp_options} - +
                @@ -504,19 +602,19 @@ @@ -524,19 +622,19 @@ @@ -544,86 +642,86 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                -
                +
                {#media_dlg.rmp_options} - +
                @@ -631,19 +729,19 @@ @@ -651,19 +749,19 @@ @@ -671,19 +769,19 @@ @@ -691,10 +789,10 @@ @@ -705,19 +803,19 @@ - - + + - - + + - - + + - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                - +
                - - + +
                @@ -725,11 +823,11 @@
                {#media_dlg.shockwave_options} - +
                - +
                - @@ -738,13 +836,13 @@
                - @@ -754,7 +852,7 @@ - @@ -765,18 +863,18 @@
                - +
                - +
                - +
                - +
                @@ -786,18 +884,18 @@
                - +
                - +
                - +
                - +
                @@ -806,6 +904,13 @@
                + +
                +
                + {#media_dlg.source} + +
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf b/library/tinymce/jscripts/tiny_mce/plugins/media/moxieplayer.swf new file mode 100644 index 0000000000000000000000000000000000000000..585d772d6d3c23626fddfa58c4220b056783e148 GIT binary patch literal 19980 zcmV)FK)=63S5pccivR$4+TFbgSX0N>I6O1=CN~KI0x05+ilP_+ai@wRfyT`lc5tI?Yn|XIMxcY?Oy z*i4q}Kw8#jSn_Obf`c7YGj%SaIeEEeMlw?urZ?-e^w~CRSmV&fKqyleX|UvGX>C#3 zoE)=Br={e=1~;-AExG}NwE6l*2D8>`Y#mmLNc-4KHnTn|I@6M&4~#SG2M0C{j4tiZ zutgM#oLS0fl-o45w0Ee^k`U0Iu}%y`t=^if?c`GHN;ff3=28;e}f%GP1; zEw-Zu_Ad%`P~GBMqZm?BQu3*SgAJAf@c4KXVn2Q@=bDc{ZCRyLR9pQ>M+>rgjAMHR?_Mj5f$Os~u>w`bz$#y z%KZF}f*Gqu^;+JRQn zP(AEfX4)w?Pw&`z3W}vMT`d$kpe-IdHOK)*Eb0Br+@@Ia#a^ zWdVi~Whs!&xKy&7LsOA)c5fW+=p%0p%sD!^%T$=N*#dI?uLyL*{}sV#vf1=j+rQwn z4ikC(&!#~|*=-(y`6jE$Z9~eLm%H$nKe2K#%FL`>jQ6Kj4pP~9k7gT(Z$9qM4gIXjN7;>V&f&hitYiU6E$4B`A;ndqkYV9#&qTj68!upZi{q81~~f z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old mode 100755 new mode 100644 index f2dbbff2bb..687f548669 --- a/library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'·':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js old mode 100755 new mode 100644 index e3b078bfae..d492fbefe4 --- a/library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js @@ -17,7 +17,7 @@ // Register commands ed.addCommand('mceNonBreaking', function() { - ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '·' : ' '); + ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); }); // Register buttons @@ -25,11 +25,12 @@ if (ed.getParam('nonbreaking_force_tab')) { ed.onKeyDown.add(function(ed, e) { - if (tinymce.isIE && e.keyCode == 9) { + if (e.keyCode == 9) { + e.preventDefault(); + ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking'); - tinymce.dom.Event.cancel(e); } }); } diff --git a/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js old mode 100755 new mode 100644 index 9945cd8580..e7f301dbc7 --- a/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js @@ -1 +1 @@ -(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file +(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret";r=tinymce.isGecko?"\u200B":"\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(y,A){var E=A.keyCode,w,B,C,u;function t(G,F){while(G=G[F?"previousSibling":"nextSibling"]){if(G.nodeType!==3||G.nodeValue.length>0){return G}}}function x(F,G){p.select(F);p.collapse(G)}C=p.getStart();u=p.getEnd();w=g(C)||g(u);if(w&&(E<112||E>124)&&E!=e.DELETE&&E!=e.BACKSPACE){A.preventDefault();if(E==e.LEFT||E==e.RIGHT){var v=E==e.LEFT;if(y.dom.isBlock(w)){var z=v?w.previousSibling:w.nextSibling;var s=new c(z,z);var D=v?s.prev():s.next();x(D,!v)}else{x(w,v)}}}else{if(E==e.LEFT||E==e.RIGHT||E==e.BACKSPACE||E==e.DELETE){B=l(C);if(B){if(E==e.LEFT||E==e.BACKSPACE){w=t(B,true);if(w&&m(w)==="false"){A.preventDefault();if(E==e.LEFT){x(w,true)}else{j.remove(w)}}else{i(B)}}if(E==e.RIGHT||E==e.DELETE){w=t(B);if(w&&m(w)==="false"){A.preventDefault();if(E==e.RIGHT){x(w,false)}else{j.remove(w)}}else{i(B)}}}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){u.preventDefault()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(h,j){var g,f,i;g=" "+tinymce.trim(h.getParam("noneditable_editable_class","mceEditable"))+" ";f=" "+tinymce.trim(h.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";i=h.getParam("noneditable_regexp");if(i&&!i.length){i=[i]}h.onPreInit.add(function(){b(h);if(i){h.onBeforeSetContent.add(function(l,m){var n=i.length,o=m.content,k=tinymce.trim(f);if(m.format=="raw"){return}while(n--){o=o.replace(i[n],function(){var p=arguments;return''+l.dom.encode(typeof(p[1])==="string"?p[1]:p[0])+""})}m.content=o})}h.parser.addAttributeFilter("class",function(k){var l=k.length,m,n;while(l--){n=k[l];m=" "+n.attr("class")+" ";if(m.indexOf(g)!==-1){n.attr(d,"true")}else{if(m.indexOf(f)!==-1){n.attr(d,"false")}}}});h.serializer.addAttributeFilter(d,function(k,l){var m=k.length,n;while(m--){n=k[m];if(i&&n.attr("data-mce-content")){n.name="#text";n.type=3;n.raw=true;n.value=n.attr("data-mce-content")}else{n.attr(a,null);n.attr(d,null)}}});h.parser.addAttributeFilter(a,function(k,l){var m=k.length,n;while(m--){n=k[m];n.attr(d,n.attr(a));n.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js old mode 100755 new mode 100644 index 656c971b8c..c87d241bd4 --- a/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js @@ -9,34 +9,416 @@ */ (function() { - var Event = tinymce.dom.Event; + var TreeWalker = tinymce.dom.TreeWalker; + var externalName = 'contenteditable', internalName = 'data-mce-' + externalName; + var VK = tinymce.VK; + + function handleContentEditableSelection(ed) { + var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret'; + + // Setup invisible character use zero width space on Gecko since it doesn't change the height of the container + invisibleChar = tinymce.isGecko ? '\u200B' : '\uFEFF'; + + // Returns the content editable state of a node "true/false" or null + function getContentEditable(node) { + var contentEditable; + + // Ignore non elements + if (node.nodeType === 1) { + // Check for fake content editable + contentEditable = node.getAttribute(internalName); + if (contentEditable && contentEditable !== "inherit") { + return contentEditable; + } + + // Check for real content editable + contentEditable = node.contentEditable; + if (contentEditable !== "inherit") { + return contentEditable; + } + } + + return null; + }; + + // Returns the noneditable parent or null if there is a editable before it or if it wasn't found + function getNonEditableParent(node) { + var state; + + while (node) { + state = getContentEditable(node); + if (state) { + return state === "false" ? node : null; + } + + node = node.parentNode; + } + }; + + // Get caret container parent for the specified node + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Insert caret container before/after target or expand selection to include block + function insertCaretContainerOrExpandToBlock(target, before) { + var caretContainer, rng; + + // Select block + if (getContentEditable(target) === "false") { + if (dom.isBlock(target)) { + selection.select(target); + return; + } + } + + rng = dom.createRng(); + + if (getContentEditable(target) === "true") { + if (!target.firstChild) { + target.appendChild(ed.getDoc().createTextNode('\u00a0')); + } + + target = target.firstChild; + before = true; + } + + //caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar); + caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar); + + if (before) { + target.parentNode.insertBefore(caretContainer, target); + } else { + dom.insertAfter(caretContainer, target); + } + + rng.setStart(caretContainer.firstChild, 1); + rng.collapse(true); + selection.setRng(rng); + + return caretContainer; + }; + + // Removes any caret container except the one we might be in + function removeCaretContainer(caretContainer) { + var child, currentCaretContainer, lastContainer; + + if (caretContainer) { + rng = selection.getRng(true); + rng.setStartBefore(caretContainer); + rng.setEndBefore(caretContainer); + + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + + selection.setRng(rng); + } else { + currentCaretContainer = getParentCaretContainer(selection.getStart()); + while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) { + if (currentCaretContainer !== caretContainer) { + child = findFirstTextNode(caretContainer); + if (child && child.nodeValue.charAt(0) == invisibleChar) { + child = child.deleteData(0, 1); + } + + dom.remove(caretContainer, true); + } + + lastContainer = caretContainer; + } + } + }; + + // Modifies the selection to include contentEditable false elements or insert caret containers + function moveSelection() { + var nonEditableStart, nonEditableEnd, isCollapsed, rng, element; + + // Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside + function hasSideContent(element, left) { + var container, offset, walker, node, len; + + container = rng.startContainer; + offset = rng.startOffset; + + // If endpoint is in middle of text node then expand to beginning/end of element + if (container.nodeType == 3) { + len = container.nodeValue.length; + if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) { + return; + } + } else { + // Can we resolve the node by index + if (offset < container.childNodes.length) { + // Browser represents caret position as the offset at the start of an element. When moving right + // this is the element we are moving into so we consider our container to be child node at offset-1 + var pos = !left && offset > 0 ? offset-1 : offset; + container = container.childNodes[pos]; + if (container.hasChildNodes()) { + container = container.firstChild; + } + } else { + // If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element + return !left ? element : null; + } + } + + // Walk left/right to look for contents + walker = new TreeWalker(container, element); + while (node = walker[left ? 'prev' : 'next']()) { + if (node.nodeType === 3 && node.nodeValue.length > 0) { + return; + } else if (getContentEditable(node) === "true") { + // Found contentEditable=true element return this one to we can move the caret inside it + return node; + } + } + + return element; + }; + + // Remove any existing caret containers + removeCaretContainer(); + + // Get noneditable start/end elements + isCollapsed = selection.isCollapsed(); + nonEditableStart = getNonEditableParent(selection.getStart()); + nonEditableEnd = getNonEditableParent(selection.getEnd()); + + // Is any fo the range endpoints noneditable + if (nonEditableStart || nonEditableEnd) { + rng = selection.getRng(true); + + // If it's a caret selection then look left/right to see if we need to move the caret out side or expand + if (isCollapsed) { + nonEditableStart = nonEditableStart || nonEditableEnd; + var start = selection.getStart(); + if (element = hasSideContent(nonEditableStart, true)) { + // We have no contents to the left of the caret then insert a caret container before the noneditable element + insertCaretContainerOrExpandToBlock(element, true); + } else if (element = hasSideContent(nonEditableStart, false)) { + // We have no contents to the right of the caret then insert a caret container after the noneditable element + insertCaretContainerOrExpandToBlock(element, false); + } else { + // We are in the middle of a noneditable so expand to select it + selection.select(nonEditableStart); + } + } else { + rng = selection.getRng(true); + + // Expand selection to include start non editable element + if (nonEditableStart) { + rng.setStartBefore(nonEditableStart); + } + + // Expand selection to include end non editable element + if (nonEditableEnd) { + rng.setEndAfter(nonEditableEnd); + } + + selection.setRng(rng); + } + } + }; + + function handleKey(ed, e) { + var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement; + + function getNonEmptyTextNodeSibling(node, prev) { + while (node = node[prev ? 'previousSibling' : 'nextSibling']) { + if (node.nodeType !== 3 || node.nodeValue.length > 0) { + return node; + } + } + }; + + function positionCaretOnElement(element, start) { + selection.select(element); + selection.collapse(start); + } + + startElement = selection.getStart() + endElement = selection.getEnd(); + + // Disable all key presses in contentEditable=false except delete or backspace + nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement); + if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) { + e.preventDefault(); + + // Arrow left/right select the element and collapse left/right + if (keyCode == VK.LEFT || keyCode == VK.RIGHT) { + var left = keyCode == VK.LEFT; + // If a block element find previous or next element to position the caret + if (ed.dom.isBlock(nonEditableParent)) { + var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling; + var walker = new TreeWalker(targetElement, targetElement); + var caretElement = left ? walker.prev() : walker.next(); + positionCaretOnElement(caretElement, !left); + } else { + positionCaretOnElement(nonEditableParent, left); + } + } + } else { + // Is arrow left/right, backspace or delete + if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) { + caretContainer = getParentCaretContainer(startElement); + if (caretContainer) { + // Arrow left or backspace + if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.LEFT) { + positionCaretOnElement(nonEditableParent, true); + } else { + dom.remove(nonEditableParent); + } + } else { + removeCaretContainer(caretContainer); + } + } + + // Arrow right or delete + if (keyCode == VK.RIGHT || keyCode == VK.DELETE) { + nonEditableParent = getNonEmptyTextNodeSibling(caretContainer); + + if (nonEditableParent && getContentEditable(nonEditableParent) === "false") { + e.preventDefault(); + + if (keyCode == VK.RIGHT) { + positionCaretOnElement(nonEditableParent, false); + } else { + dom.remove(nonEditableParent); + } + } else { + removeCaretContainer(caretContainer); + } + } + } + } + } + }; + + ed.onMouseDown.addToTop(function(ed, e){ + // prevent collapsing selection to caret when clicking in a non-editable section + var node = ed.selection.getNode(); + if (getContentEditable(node) === "false" && node == e.target) { + e.preventDefault(); + } + }); + ed.onMouseUp.addToTop(moveSelection); + ed.onKeyDown.addToTop(handleKey); + ed.onKeyUp.addToTop(moveSelection); + }; tinymce.create('tinymce.plugins.NonEditablePlugin', { init : function(ed, url) { - var t = this, editClass, nonEditClass; + var editClass, nonEditClass, nonEditableRegExps; + + editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " "; + nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " "; + + // Setup noneditable regexps array + nonEditableRegExps = ed.getParam("noneditable_regexp"); + if (nonEditableRegExps && !nonEditableRegExps.length) { + nonEditableRegExps = [nonEditableRegExps]; + } + + ed.onPreInit.add(function() { + handleContentEditableSelection(ed); + + if (nonEditableRegExps) { + ed.onBeforeSetContent.add(function(ed, args) { + var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass); + + // Don't replace the variables when raw is used for example on undo/redo + if (args.format == "raw") { + return; + } - t.editor = ed; - editClass = ed.getParam("noneditable_editable_class", "mceEditable"); - nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); + while (i--) { + content = content.replace(nonEditableRegExps[i], function() { + var args = arguments; - ed.onNodeChange.addToTop(function(ed, cm, n) { - var sc, ec; + return '' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + ''; + }); + } - // Block if start or end is inside a non editable element - sc = ed.dom.getParent(ed.selection.getStart(), function(n) { - return ed.dom.hasClass(n, nonEditClass); + args.content = content; + }); + } + + // Apply contentEditable true/false on elements with the noneditable/editable classes + ed.parser.addAttributeFilter('class', function(nodes) { + var i = nodes.length, className, node; + + while (i--) { + node = nodes[i]; + className = " " + node.attr("class") + " "; + + if (className.indexOf(editClass) !== -1) { + node.attr(internalName, "true"); + } else if (className.indexOf(nonEditClass) !== -1) { + node.attr(internalName, "false"); + } + } }); - ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { - return ed.dom.hasClass(n, nonEditClass); + // Remove internal name + ed.serializer.addAttributeFilter(internalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (nonEditableRegExps && node.attr('data-mce-content')) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = node.attr('data-mce-content'); + } else { + node.attr(externalName, null); + node.attr(internalName, null); + } + } }); - // Block or unblock - if (sc || ec) { - t._setDisabled(1); - return false; - } else - t._setDisabled(0); + // Convert external name into internal name + ed.parser.addAttributeFilter(externalName, function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr(internalName, node.attr(externalName)); + node.attr(externalName, null); + } + }); }); }, @@ -48,40 +430,6 @@ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', version : tinymce.majorVersion + "." + tinymce.minorVersion }; - }, - - _block : function(ed, e) { - var k = e.keyCode; - - // Don't block arrow keys, pg up/down, and F1-F12 - if ((k > 32 && k < 41) || (k > 111 && k < 124)) - return; - - return Event.cancel(e); - }, - - _setDisabled : function(s) { - var t = this, ed = t.editor; - - tinymce.each(ed.controlManager.controls, function(c) { - c.setDisabled(s); - }); - - if (s !== t.disabled) { - if (s) { - ed.onKeyDown.addToTop(t._block); - ed.onKeyPress.addToTop(t._block); - ed.onKeyUp.addToTop(t._block); - ed.onPaste.addToTop(t._block); - } else { - ed.onKeyDown.remove(t._block); - ed.onKeyPress.remove(t._block); - ed.onKeyUp.remove(t._block); - ed.onPaste.remove(t._block); - } - - t.disabled = s; - } } }); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css b/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css deleted file mode 100755 index c949d58cc4..0000000000 --- a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} diff --git a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js old mode 100755 new mode 100644 index a212f69633..35085e8adc --- a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js old mode 100755 new mode 100644 index 4e1eb0a7aa..a094c19162 --- a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js @@ -11,7 +11,7 @@ (function() { tinymce.create('tinymce.plugins.PageBreakPlugin', { init : function(ed, url) { - var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; + var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); @@ -24,9 +24,6 @@ ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); ed.onInit.add(function() { - if (ed.settings.content_css !== false) - ed.dom.loadCSS(url + "/css/content.css"); - if (ed.theme.onResolveName) { ed.theme.onResolveName.add(function(th, o) { if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) diff --git a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif b/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/img/trans.gif deleted file mode 100755 index 388486517fa8da13ebd150e8f65d5096c3e10c3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 ncmZ?wbhEHbWMp7un7{x9ia%KxMSyG_5FaGNz{KRj$Y2csb)f_x diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js old mode 100755 new mode 100644 index 3e7b2504f1..e47a5c630a --- a/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js @@ -1 +1 @@ -(function(){var c=tinymce.each,d=null,a={paste_auto_cleanup_on_paste:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(e,f){return e.getParam(f,a[f])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(e,f){var g=this;g.editor=e;g.url=f;g.onPreProcess=new tinymce.util.Dispatcher(g);g.onPostProcess=new tinymce.util.Dispatcher(g);g.onPreProcess.add(g._preProcess);g.onPostProcess.add(g._postProcess);g.onPreProcess.add(function(j,k){e.execCallback("paste_preprocess",j,k)});g.onPostProcess.add(function(j,k){e.execCallback("paste_postprocess",j,k)});e.pasteAsPlainText=false;function i(l,j){var k=e.dom;g.onPreProcess.dispatch(g,l);l.node=k.create("div",0,l.content);g.onPostProcess.dispatch(g,l);l.content=e.serializer.serialize(l.node,{getInner:1});if((!j)&&(e.pasteAsPlainText)){g._insertPlainText(e,k,l.content);if(!b(e,"paste_text_sticky")){e.pasteAsPlainText=false;e.controlManager.setActive("pastetext",false)}}else{if(/<(p|h[1-6]|ul|ol)/.test(l.content)){g._insertBlockContent(e,k,l.content)}else{g._insert(l.content)}}}e.addCommand("mceInsertClipboardContent",function(j,k){i(k,true)});if(!b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(k,j){var l=tinymce.util.Cookie;e.pasteAsPlainText=!e.pasteAsPlainText;e.controlManager.setActive("pastetext",e.pasteAsPlainText);if((e.pasteAsPlainText)&&(!l.get("tinymcePasteText"))){if(b(e,"paste_text_sticky")){e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}else{e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}if(!b(e,"paste_text_notifyalways")){l.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}e.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});e.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function h(s){var m,q,k,l=e.selection,p=e.dom,r=e.getBody(),j;if(e.pasteAsPlainText&&(s.clipboardData||p.doc.dataTransfer)){s.preventDefault();i({content:(s.clipboardData||p.doc.dataTransfer).getData("Text")},true);return}if(p.get("_mcePaste")){return}m=p.add(r,"div",{id:"_mcePaste","class":"mcePaste"},"\uFEFF");if(r!=e.getDoc().body){j=p.getPos(e.selection.getStart(),r).y}else{j=r.scrollTop}p.setStyles(m,{position:"absolute",left:-10000,top:j,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){k=p.doc.body.createTextRange();k.moveToElementText(m);k.execCommand("Paste");p.remove(m);if(m.innerHTML==="\uFEFF"){e.execCommand("mcePasteWord");s.preventDefault();return}i({content:m.innerHTML});return tinymce.dom.Event.cancel(s)}else{function o(n){n.preventDefault()}p.bind(e.getDoc(),"mousedown",o);p.bind(e.getDoc(),"keydown",o);q=e.selection.getRng();m=m.firstChild;k=e.getDoc().createRange();k.setStart(m,0);k.setEnd(m,1);l.setRng(k);window.setTimeout(function(){var t="",n=p.select("div.mcePaste");c(n,function(u){c(p.select("div.mcePaste",u),function(v){p.remove(v,1)});c(p.select("span.Apple-style-span",u),function(v){p.remove(v,1)});t+=u.innerHTML});c(n,function(u){p.remove(u)});if(q){l.setRng(q)}i({content:t});p.unbind(e.getDoc(),"mousedown",o);p.unbind(e.getDoc(),"keydown",o)},0)}}if(b(e,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){e.onKeyDown.add(function(j,k){if(((tinymce.isMac?k.metaKey:k.ctrlKey)&&k.keyCode==86)||(k.shiftKey&&k.keyCode==45)){h(k)}})}else{e.onPaste.addToTop(function(j,k){return h(k)})}}if(b(e,"paste_block_drop")){e.onInit.add(function(){e.dom.bind(e.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(j){j.preventDefault();j.stopPropagation();return false})})}g._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(i,f){var l=this.editor,k=f.content,q=tinymce.grep,p=tinymce.explode,g=tinymce.trim,m,j;function e(h){c(h,function(o){if(o.constructor==RegExp){k=k.replace(o,"")}else{k=k.replace(o[0],o[1])}})}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(k)||f.wordContent){f.wordContent=true;e([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(l,"paste_convert_headers_to_strong")){k=k.replace(/

                ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

                $1

                ")}if(b(l,"paste_convert_middot_lists")){e([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"]])}e([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{m=k.length;k=k.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(m!=k.length);if(b(l,"paste_retain_style_properties").replace(/^none$/i,"").length==0){k=k.replace(/<\/?span[^>]*>/gi,"")}else{e([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(u,h,t){var v=[],o=0,r=p(g(t).replace(/"/gi,"'"),";");c(r,function(s){var w,y,z=p(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":v[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":v[o++]="text-align:"+y;return;case"vert-align":v[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":v[o++]="color:"+y;return;case"mso-background":case"mso-highlight":v[o++]="background:"+y;return;case"mso-default-height":v[o++]="min-height:"+x(y);return;case"mso-default-width":v[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":v[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){v[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){v[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}v[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+v.join(";")+'"'}else{return h}}]])}}if(b(l,"paste_convert_headers_to_strong")){e([[/]*>/gi,"

                "],[/<\/h[1-6][^>]*>/gi,"

                "]])}j=b(l,"paste_strip_class_attributes");if(j!=="none"){function n(r,o){if(j==="all"){return""}var h=q(p(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(s){return(/^(?!mso)/i.test(s))});return h.length?' class="'+h.join(" ")+'"':""}k=k.replace(/ class="([^"]+)"/gi,n);k=k.replace(/ class=(\w+)/gi,n)}if(b(l,"paste_remove_spans")){k=k.replace(/<\/?span[^>]*>/gi,"")}f.content=k},_postProcess:function(h,j){var g=this,f=g.editor,i=f.dom,e;if(j.wordContent){c(i.select("a",j.node),function(k){if(!k.href||k.href.indexOf("#_Toc")!=-1){i.remove(k,1)}});if(b(f,"paste_convert_middot_lists")){g._convertLists(h,j)}e=b(f,"paste_retain_style_properties");if((tinymce.is(e,"string"))&&(e!=="all")&&(e!=="*")){e=tinymce.explode(e.replace(/^none$/i,""));c(i.select("*",j.node),function(n){var o={},l=0,m,p,k;if(e){for(m=0;m0){i.setStyles(n,o)}else{if(n.nodeName=="SPAN"&&!n.className){i.remove(n,true)}}})}}if(b(f,"paste_remove_styles")||(b(f,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(i.select("*[style]",j.node),function(k){k.removeAttribute("style");k.removeAttribute("_mce_style")})}else{if(tinymce.isWebKit){c(i.select("*",j.node),function(k){k.removeAttribute("_mce_style")})}}},_convertLists:function(h,f){var j=h.editor.dom,i,m,e=-1,g,n=[],l,k;c(j.select("p",f.node),function(u){var r,v="",t,s,o,q;for(r=u.firstChild;r&&r.nodeType==3;r=r.nextSibling){v+=r.nodeValue}v=u.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(v)){t="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(v)){t="ol"}if(t){g=parseFloat(u.style.marginLeft||0);if(g>e){n.push(g)}if(!i||t!=l){i=j.create(t);j.insertAfter(i,u)}else{if(g>e){i=m.appendChild(j.create(t))}else{if(g]*>/gi,"");if(t=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){j.remove(w)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){j.remove(w)}}});s=u.innerHTML;if(t=="ul"){s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}m=i.appendChild(j.create("li",0,s));j.remove(u);e=g;l=t}else{i=e=0}});k=f.node.innerHTML;if(k.indexOf("__MCE_ITEM__")!=-1){f.node.innerHTML=k.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(l,h,m){var f,j,g=l.selection,q,n,e,o,i,k="mce_marker";function p(t){var s;if(tinymce.isIE){s=l.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(false);s.select()}else{g.select(t,1);g.collapse(false)}}this._insert(' ',1);j=h.get(k);f=h.getParent(j,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(f&&!/TD|TH/.test(f.nodeName)){j=h.split(f,j);c(h.create("div",0,m).childNodes,function(r){q=j.parentNode.insertBefore(r.cloneNode(true),j)});p(q)}else{h.setOuterHTML(j,m);g.select(l.getBody(),1);g.collapse(0)}while(n=h.get(k)){h.remove(n)}n=g.getStart();e=h.getViewPort(l.getWin());o=l.dom.getPos(n).y;i=n.clientHeight;if(oe.y+e.h){l.getDoc().body.scrollTop=o0)){if(!d){d=("34,quot,38,amp,39,apos,60,lt,62,gt,"+j.serializer.settings.entities).split(",")}if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/&(#\d+|[a-z0-9]{1,10});/gi,function(i,h){if(h.charAt(0)==="#"){return String.fromCharCode(h.slice(1))}else{return((i=y(d,h))>0)?String.fromCharCode(d[i-1]):" "}}],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.encode(v);if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"
                "]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"

                "],[/\n/g,"
                "]])}}if((l=v.indexOf("

                "))!=-1){k=v.lastIndexOf("

                ");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+' ');window.setTimeout(function(){var h=x.get("_plain_text_marker"),B,i,A,w;s.select(h,false);z.execCommand("Delete",false,null);h=null;B=s.getStart();i=x.getViewPort(n);A=x.getPos(B).y;w=B.clientHeight;if((Ai.y+i.h)){z.body.scrollTop=A")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

                "+o.encode(r).replace(/\r?\n\r?\n/g,"

                ").replace(/\r?\n/g,"
                ")+"

                "}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
                 [\s\r\n]+|
                )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
                 [\s\r\n]+|
                )*/g,"$1"]]);d([[/

                /g,"

                "],[/
                /g," "],[/

                /g,"
                "]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

                ]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

                $1

                ")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

                "],[/<\/h[1-6][^>]*>/gi,"

                "]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"
                "]])}else{if(e=="p"){h([[/\n+/g,"

                "],[/^(.*<\/p>)(

                )$/,"

                $1"]])}else{h([[/\n\n/g,"

                "],[/^(.*<\/p>)(

                )$/,"

                $1"],[/\n/g,"
                "]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js old mode 100755 new mode 100644 index 4c3bf6542e..73fe7fe9a4 --- a/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js @@ -10,9 +10,9 @@ (function() { var each = tinymce.each, - entities = null, defs = { paste_auto_cleanup_on_paste : true, + paste_enable_default_filters : true, paste_block_drop : false, paste_retain_style_properties : "none", paste_strip_class_attributes : "mso", @@ -25,8 +25,9 @@ paste_dialog_height : "400", paste_text_use_dialog : false, paste_text_sticky : false, + paste_text_sticky_default : false, paste_text_notifyalways : false, - paste_text_linebreaktype : "p", + paste_text_linebreaktype : "combined", paste_text_replacements : [ [/\u2026/g, "..."], [/[\x93\x94\u201c\u201d]/g, '"'], @@ -63,13 +64,19 @@ ed.execCallback('paste_postprocess', pl, o); }); + ed.onKeyDown.addToTop(function(ed, e) { + // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that + if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) + return false; // Stop other listeners + }); + // Initialize plain text flag - ed.pasteAsPlainText = false; + ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default'); // This function executes the process handlers and inserts the contents // force_rich overrides plain text mode set by user, important for pasting with execCommand function process(o, force_rich) { - var dom = ed.dom; + var dom = ed.dom, rng; // Execute pre process handlers t.onPreProcess.dispatch(t, o); @@ -77,23 +84,31 @@ // Create DOM structure o.node = dom.create('div', 0, o.content); + // If pasting inside the same element and the contents is only one block + // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element + if (tinymce.isGecko) { + rng = ed.selection.getRng(true); + if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { + // Is only one block node and it doesn't contain word stuff + if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1) + dom.remove(o.node.firstChild, true); + } + } + // Execute post process handlers t.onPostProcess.dispatch(t, o); // Serialize content - o.content = ed.serializer.serialize(o.node, {getInner : 1}); + o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''}); // Plain text option active? if ((!force_rich) && (ed.pasteAsPlainText)) { - t._insertPlainText(ed, dom, o.content); + t._insertPlainText(o.content); if (!getParam(ed, "paste_text_sticky")) { ed.pasteAsPlainText = false; ed.controlManager.setActive("pastetext", false); } - } else if (/<(p|h[1-6]|ul|ol)/.test(o.content)) { - // Handle insertion of contents containing block elements separately - t._insertBlockContent(ed, dom, o.content); } else { t._insert(o.content); } @@ -115,7 +130,7 @@ if (getParam(ed, "paste_text_sticky")) { ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); } else { - ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); + ed.windowManager.alert(ed.translate('paste.plaintext_mode')); } if (!getParam(ed, "paste_text_notifyalways")) { @@ -132,38 +147,46 @@ // hidden div and placing the caret inside it and after the browser paste // is done it grabs that contents and processes that function grabContent(e) { - var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY; + var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent; // Check if browser supports direct plaintext access - if (ed.pasteAsPlainText && (e.clipboardData || dom.doc.dataTransfer)) { - e.preventDefault(); - process({content : (e.clipboardData || dom.doc.dataTransfer).getData('Text')}, true); - return; + if (e.clipboardData || dom.doc.dataTransfer) { + textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text'); + + if (ed.pasteAsPlainText) { + e.preventDefault(); + process({content : dom.encode(textContent).replace(/\r?\n/g, '
                ')}); + return; + } } if (dom.get('_mcePaste')) return; // Create container to paste into - n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste'}, '\uFEFF'); + n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF'); // If contentEditable mode we need to find out the position of the closest element if (body != ed.getDoc().body) posY = dom.getPos(ed.selection.getStart(), body).y; else - posY = body.scrollTop; + posY = body.scrollTop + dom.getViewPort(ed.getWin()).y; // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles + // If also needs to be in view on IE or the paste would fail dom.setStyles(n, { position : 'absolute', - left : -10000, - top : posY, + left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div + top : posY - 25, width : 1, height : 1, overflow : 'hidden' }); if (tinymce.isIE) { + // Store away the old range + oldRng = sel.getRng(); + // Select the container rng = dom.doc.body.createTextRange(); rng.moveToElementText(n); @@ -174,14 +197,23 @@ // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due // to IE security settings so we pass the junk though better than nothing right - if (n.innerHTML === '\uFEFF') { + if (n.innerHTML === '\uFEFF\uFEFF') { ed.execCommand('mcePasteWord'); e.preventDefault(); return; } - // Process contents - process({content : n.innerHTML}); + // Restore the old range and clear the contents before pasting + sel.setRng(oldRng); + sel.setContent(''); + + // For some odd reason we need to detach the the mceInsertContent call from the paste event + // It's like IE has a reference to the parent element that you paste in and the selection gets messed up + // when it tries to restore the selection + setTimeout(function() { + // Process contents + process({content : n.innerHTML}); + }, 0); // Block the real paste event return tinymce.dom.Event.cancel(e); @@ -196,34 +228,52 @@ or = ed.selection.getRng(); - // Move caret into hidden div + // Move select contents inside DIV n = n.firstChild; rng = ed.getDoc().createRange(); rng.setStart(n, 0); - rng.setEnd(n, 1); + rng.setEnd(n, 2); sel.setRng(rng); // Wait a while and grab the pasted contents window.setTimeout(function() { - var h = '', nl = dom.select('div.mcePaste'); + var h = '', nl; - // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string - each(nl, function(n) { - // WebKit duplicates the divs so we need to remove them - each(dom.select('div.mcePaste', n), function(n) { - dom.remove(n, 1); - }); + // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit + if (!dom.select('div.mcePaste > div.mcePaste').length) { + nl = dom.select('div.mcePaste'); - // Remove apply style spans - each(dom.select('span.Apple-style-span', n), function(n) { - dom.remove(n, 1); - }); + // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string + each(nl, function(n) { + var child = n.firstChild; - h += n.innerHTML; - }); + // WebKit inserts a DIV container with lots of odd styles + if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) { + dom.remove(child, 1); + } + + // Remove apply style spans + each(dom.select('span.Apple-style-span', n), function(n) { + dom.remove(n, 1); + }); + + // Remove bogus br elements + each(dom.select('br[data-mce-bogus]', n), function(n) { + dom.remove(n); + }); + + // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV + if (n.parentNode.className != 'mcePaste') + h += n.innerHTML; + }); + } else { + // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc + // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same + h = '

                ' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

                ').replace(/\r?\n/g, '
                ') + '

                '; + } // Remove the nodes - each(nl, function(n) { + each(dom.select('div.mcePaste'), function(n) { dom.remove(n); }); @@ -244,7 +294,7 @@ if (getParam(ed, "paste_auto_cleanup_on_paste")) { // Is it's Opera or older FF use key handler if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { - ed.onKeyDown.add(function(ed, e) { + ed.onKeyDown.addToTop(function(ed, e) { if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) grabContent(e); }); @@ -256,17 +306,19 @@ } } - // Block all drag/drop events - if (getParam(ed, "paste_block_drop")) { - ed.onInit.add(function() { + ed.onInit.add(function() { + ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); + + // Block all drag/drop events + if (getParam(ed, "paste_block_drop")) { ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { e.preventDefault(); e.stopPropagation(); return false; }); - }); - } + } + }); // Add legacy support t._legacySupport(); @@ -283,8 +335,6 @@ }, _preProcess : function(pl, o) { - //console.log('Before preprocess:' + o.content); - var ed = this.editor, h = o.content, grep = tinymce.grep, @@ -292,6 +342,8 @@ trim = tinymce.trim, len, stripClass; + //console.log('Before preprocess:' + o.content); + function process(items) { each(items, function(v) { // Remove or replace @@ -301,6 +353,23 @@ h = h.replace(v[0], v[1]); }); } + + if (ed.settings.paste_enable_default_filters == false) { + return; + } + + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + if (tinymce.isIE && document.documentMode >= 9) { + // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser + process([[/(?:
                 [\s\r\n]+|
                )*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
                 [\s\r\n]+|
                )*/g, '$1']]); + + // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break + process([ + [/

                /g, '

                '], // Replace multiple BR elements with uppercase BR to keep them intact + [/
                /g, ' '], // Replace single br elements with space since they are word wrap BR:s + [/

                /g, '
                '] // Replace back the double brs but into a single BR + ]); + } // Detect Word content and process it more aggressive if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { @@ -320,7 +389,8 @@ if (getParam(ed, "paste_convert_middot_lists")) { process([ [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker - [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol spans to item markers + [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers + [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) ]); } @@ -472,6 +542,11 @@ ]); } + process([ + // Copy paste from Java like Open Office will produce this junk on FF + [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] + ]); + // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. stripClass = getParam(ed, "paste_strip_class_attributes"); @@ -491,7 +566,7 @@ }; h = h.replace(/ class="([^"]+)"/gi, removeClasses); - h = h.replace(/ class=(\w+)/gi, removeClasses); + h = h.replace(/ class=([\-\w]+)/gi, removeClasses); } // Remove spans option @@ -510,6 +585,10 @@ _postProcess : function(pl, o) { var t = this, ed = t.editor, dom = ed.dom, styleProps; + if (ed.settings.paste_enable_default_filters == false) { + return; + } + if (o.wordContent) { // Remove named anchors or TOC links each(dom.select('a', o.node), function(a) { @@ -561,14 +640,14 @@ if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { each(dom.select('*[style]', o.node), function(el) { el.removeAttribute('style'); - el.removeAttribute('_mce_style'); + el.removeAttribute('data-mce-style'); }); } else { if (tinymce.isWebKit) { // We need to compress the styles on WebKit since if you paste it will become // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles each(dom.select('*', o.node), function(el) { - el.removeAttribute('_mce_style'); + el.removeAttribute('data-mce-style'); }); } } @@ -591,11 +670,11 @@ val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); // Detect unordered lists look for bullets - if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val)) + if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) type = 'ul'; // Detect ordered lists 1., a. or ixv. - if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(val)) + if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) type = 'ol'; // Check if node value matches the list pattern: o   @@ -625,9 +704,9 @@ var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); // Remove span with the middot or the number - if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html)) + if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) dom.remove(span); - else if (/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) + else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) dom.remove(span); }); @@ -635,7 +714,7 @@ // Remove middot/list items if (type == 'ul') - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/, ''); + html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); else html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); @@ -655,65 +734,6 @@ o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); }, - /** - * This method will split the current block parent and insert the contents inside the split position. - * This logic can be improved so text nodes at the start/end remain in the start/end block elements - */ - _insertBlockContent : function(ed, dom, content) { - var parentBlock, marker, sel = ed.selection, last, elm, vp, y, elmHeight, markerId = 'mce_marker'; - - function select(n) { - var r; - - if (tinymce.isIE) { - r = ed.getDoc().body.createTextRange(); - r.moveToElementText(n); - r.collapse(false); - r.select(); - } else { - sel.select(n, 1); - sel.collapse(false); - } - } - - // Insert a marker for the caret position - this._insert(' ', 1); - marker = dom.get(markerId); - parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td'); - - // If it's a parent block but not a table cell - if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) { - // Split parent block - marker = dom.split(parentBlock, marker); - - // Insert nodes before the marker - each(dom.create('div', 0, content).childNodes, function(n) { - last = marker.parentNode.insertBefore(n.cloneNode(true), marker); - }); - - // Move caret after marker - select(last); - } else { - dom.setOuterHTML(marker, content); - sel.select(ed.getBody(), 1); - sel.collapse(0); - } - - // Remove marker if it's left - while (elm = dom.get(markerId)) - dom.remove(elm); - - // Get element, position and height - elm = sel.getStart(); - vp = dom.getViewPort(ed.getWin()); - y = ed.dom.getPos(elm).y; - elmHeight = elm.clientHeight; - - // Is element within viewport if not then scroll it into view - if (y < vp.y || y + elmHeight > vp.y + vp.h) - ed.getDoc().body.scrollTop = y < vp.y ? y : y - vp.h + 25; - }, - /** * Inserts the specified contents at the caret position. */ @@ -724,8 +744,7 @@ if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) ed.getDoc().execCommand('Delete', false, null); - // It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents - ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, h, {skip_undo : skip_undo}); + ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); }, /** @@ -737,31 +756,24 @@ * plugin, and requires minimal changes to add the new functionality. * Speednet - June 2009 */ - _insertPlainText : function(ed, dom, h) { - var i, len, pos, rpos, node, breakElms, before, after, - w = ed.getWin(), - d = ed.getDoc(), - sel = ed.selection, - is = tinymce.is, - inArray = tinymce.inArray, + _insertPlainText : function(content) { + var ed = this.editor, linebr = getParam(ed, "paste_text_linebreaktype"), - rl = getParam(ed, "paste_text_replacements"); + rl = getParam(ed, "paste_text_replacements"), + is = tinymce.is; function process(items) { each(items, function(v) { if (v.constructor == RegExp) - h = h.replace(v, ""); + content = content.replace(v, ""); else - h = h.replace(v[0], v[1]); + content = content.replace(v[0], v[1]); }); }; - if ((typeof(h) === "string") && (h.length > 0)) { - if (!entities) - entities = ("34,quot,38,amp,39,apos,60,lt,62,gt," + ed.serializer.settings.entities).split(","); - + if ((typeof(content) === "string") && (content.length > 0)) { // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line - if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) { + if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) { process([ /[\n\r]+/g ]); @@ -778,128 +790,47 @@ [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) - [ - // HTML entity - /&(#\d+|[a-z0-9]{1,10});/gi, - - // Replace with actual character - function(e, s) { - if (s.charAt(0) === "#") { - return String.fromCharCode(s.slice(1)); - } - else { - return ((e = inArray(entities, s)) > 0)? String.fromCharCode(entities[e-1]) : " "; - } - } - ], - [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars. - [/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks - /^\s+|\s+$/g // Trim the front & back + [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars. + [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks ]); - h = dom.encode(h); - - // Delete any highlighted text before pasting - if (!sel.isCollapsed()) { - d.execCommand("Delete", false, null); - } + content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content)); // Perform default or custom replacements - if (is(rl, "array") || (is(rl, "array"))) { + if (is(rl, "array")) { process(rl); - } - else if (is(rl, "string")) { + } else if (is(rl, "string")) { process(new RegExp(rl, "gi")); } // Treat paragraphs as specified in the config if (linebr == "none") { + // Convert all line breaks to space process([ [/\n+/g, " "] ]); - } - else if (linebr == "br") { + } else if (linebr == "br") { + // Convert all line breaks to
                process([ [/\n/g, "
                "] ]); - } - else { + } else if (linebr == "p") { + // Convert all line breaks to

                ...

                + process([ + [/\n+/g, "

                "], + [/^(.*<\/p>)(

                )$/, '

                $1'] + ]); + } else { + // defaults to "combined" + // Convert single line breaks to
                and double line breaks to

                ...

                process([ - /^\s+|\s+$/g, [/\n\n/g, "

                "], + [/^(.*<\/p>)(

                )$/, '

                $1'], [/\n/g, "
                "] ]); } - // This next piece of code handles the situation where we're pasting more than one paragraph of plain - // text, and we are pasting the content into the middle of a block node in the editor. The block - // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining). - // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the - // pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between - // "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and - // now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the - // plain text take the same style as the existing paragraph.) - if ((pos = h.indexOf("

                ")) != -1) { - rpos = h.lastIndexOf("

                "); - node = sel.getNode(); - breakElms = []; // Get list of elements to break - - do { - if (node.nodeType == 1) { - // Don't break tables and break at body - if (node.nodeName == "TD" || node.nodeName == "BODY") { - break; - } - - breakElms[breakElms.length] = node; - } - } while (node = node.parentNode); - - // Are we in the middle of a block node? - if (breakElms.length > 0) { - before = h.substring(0, pos); - after = ""; - - for (i=0, len=breakElms.length; i"; - after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">"; - } - - if (pos == rpos) { - h = before + after + h.substring(pos+7); - } - else { - h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7); - } - } - } - - // Insert content at the caret, plus add a marker for repositioning the caret - ed.execCommand("mceInsertRawHTML", false, h + ' '); - - // Reposition the caret to the marker, which was placed immediately after the inserted content. - // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers. - // The second part of the code scrolls the content up if the caret is positioned off-screen. - // This is only necessary for WebKit browsers, but it doesn't hurt to use for all. - window.setTimeout(function() { - var marker = dom.get('_plain_text_marker'), - elm, vp, y, elmHeight; - - sel.select(marker, false); - d.execCommand("Delete", false, null); - marker = null; - - // Get element, position and height - elm = sel.getStart(); - vp = dom.getViewPort(w); - y = dom.getPos(elm).y; - elmHeight = elm.clientHeight; - - // Is element within viewport if not then scroll it into view - if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) { - d.body.scrollTop = y < vp.y ? y : y - vp.h + 25; - } - }, 0); + ed.execCommand('mceInsertContent', false, content); } }, diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js b/library/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js b/library/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js old mode 100755 new mode 100644 index eeac778960..bc74daf85c --- a/library/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js @@ -1,5 +1 @@ -tinyMCE.addI18n('en.paste_dlg',{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}); \ No newline at end of file +tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm b/library/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm b/library/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/preview/example.html b/library/tinymce/jscripts/tiny_mce/plugins/preview/example.html old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js b/library/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/preview/preview.html b/library/tinymce/jscripts/tiny_mce/plugins/preview/preview.html old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js old mode 100755 new mode 100644 index cd9c985b7a..165bc12df5 --- a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js old mode 100755 new mode 100644 index 1433a06a4a..4c87e8fa79 --- a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -12,6 +12,10 @@ tinymce.create('tinymce.plugins.SearchReplacePlugin', { init : function(ed, url) { function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + ed.windowManager.open({ file : url + '/searchreplace.htm', width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js old mode 100755 new mode 100644 index c0a6243297..80284b9f3f --- a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -2,14 +2,18 @@ tinyMCEPopup.requireLangPack(); var SearchReplaceDialog = { init : function(ed) { - var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - this.switchMode(m); + t.switchMode(m); f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); // Focus input field f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); }, switchMode : function(m) { @@ -42,21 +46,23 @@ var SearchReplaceDialog = { ca = f[m + '_panel_casesensitivebox'].checked; rs = f['replace_panel_replacestring'].value; + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + if (s == '') return; function fix() { // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? r = se.getRng().cloneRange(); ed.getDoc().execCommand('SelectAll', false, null); se.setRng(r); }; function replace() { - if (tinymce.isIE) - ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE - else - ed.getDoc().execCommand('InsertHTML', false, rs); + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE }; // IE flags @@ -70,6 +76,9 @@ var SearchReplaceDialog = { ed.selection.collapse(true); if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + while (r.findText(s, b ? -1 : 1, fl)) { r.scrollIntoView(); r.select(); @@ -111,6 +120,9 @@ var SearchReplaceDialog = { return; if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + if (r.findText(s, b ? -1 : 1, fl)) { r.scrollIntoView(); r.select(); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js old mode 100755 new mode 100644 index 370959afa3..8a65900977 --- a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -1,16 +1 @@ -tinyMCE.addI18n('en.searchreplace_dlg',{ -searchnext_desc:"Find again", -notfound:"The search has been completed. The search string could not be found.", -search_title:"Find", -replace_title:"Find/Replace", -allreplaced:"All occurrences of the search string were replaced.", -findwhat:"Find what", -replacewith:"Replace with", -direction:"Direction", -up:"Up", -down:"Down", -mcase:"Match case", -findnext:"Find next", -replace:"Replace", -replaceall:"Replace all" -}); \ No newline at end of file +tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm old mode 100755 new mode 100644 index d0424cfc9b..5a22d8aa4d --- a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -8,27 +8,28 @@ - + +

                - +
                - +
                - - - +
                + + @@ -39,7 +40,7 @@ - - - - - -
                {#style_dlg.padding} - +
                @@ -288,11 +330,14 @@ @@ -300,11 +345,14 @@ @@ -312,11 +360,14 @@ @@ -324,11 +375,14 @@ @@ -341,7 +395,7 @@
                {#style_dlg.margin} -
                 
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                +
                @@ -349,11 +403,14 @@ @@ -361,11 +418,14 @@ @@ -373,11 +433,14 @@ @@ -385,11 +448,14 @@ @@ -401,131 +467,148 @@
                -
                 
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
                      
                {#style_dlg.top}   - - - - - - -
                 
                -
                  - - - - - -
                 
                -
                {#style_dlg.right}   - - - - - - -
                 
                -
                  - - - - - -
                 
                -
                {#style_dlg.bottom}   - - - - - - -
                 
                -
                  - - - - - -
                 
                -
                {#style_dlg.left}   - - - - - - -
                 
                -
                  - - - - - +
                + {#style_dlg.border} +
                 
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
                      
                {#style_dlg.top}   + + + + + + +
                  + + +
                +
                  + + + + + +
                 
                +
                {#style_dlg.right}   + + + + + + +
                  + + +
                +
                  + + + + + +
                 
                +
                {#style_dlg.bottom}   + + + + + + +
                  + + +
                +
                  + + + + + +
                 
                +
                {#style_dlg.left}   + + + + + + +
                  + + +
                +
                  + + + + + +
                 
                +
                -
                +
                - +
                + {#style_dlg.list} +
                @@ -541,10 +624,13 @@
                +
                - +
                + {#style_dlg.position} +
                @@ -555,11 +641,14 @@ @@ -570,11 +659,14 @@ @@ -582,12 +674,13 @@
                - +
                - +
                  + + +
                - +
                - +
                  + + +
                +
                {#style_dlg.placement} - +
                @@ -595,11 +688,14 @@ @@ -607,11 +703,14 @@ @@ -619,11 +718,14 @@ @@ -631,11 +733,14 @@ @@ -648,7 +753,7 @@
                {#style_dlg.clip} -
                 
                {#style_dlg.top} - +
                - +
                  + + +
                {#style_dlg.right} - +
                - +
                  + + +
                {#style_dlg.bottom} - +
                - +
                  + + +
                {#style_dlg.left} - +
                - +
                  + + +
                +
                @@ -656,11 +761,14 @@ @@ -668,11 +776,14 @@ @@ -680,11 +791,14 @@ @@ -692,11 +806,14 @@ @@ -708,6 +825,11 @@ +
                + + +
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/style/readme.txt b/library/tinymce/jscripts/tiny_mce/plugins/style/readme.txt new file mode 100644 index 0000000000..5bac30202e --- /dev/null +++ b/library/tinymce/jscripts/tiny_mce/plugins/style/readme.txt @@ -0,0 +1,19 @@ +Edit CSS Style plug-in notes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Unlike WYSIWYG editor functionality that operates only on the selected text, +typically by inserting new HTML elements with the specified styles. +This plug-in operates on the HTML blocks surrounding the selected text. +No new HTML elements are created. + +This plug-in only operates on the surrounding blocks and not the nearest +parent node. This means that if a block encapsulates a node, +e.g

                text

                , then only the styles in the block are +recognized, not those in the span. + +When selecting text that includes multiple blocks at the same level (peers), +this plug-in accumulates the specified styles in all of the surrounding blocks +and populates the dialogue checkboxes accordingly. There is no differentiation +between styles set in all the blocks versus styles set in some of the blocks. + +When the [Update] or [Apply] buttons are pressed, the styles selected in the +checkboxes are applied to all blocks that surround the selected text. diff --git a/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js old mode 100755 new mode 100644 index 27d2440222..42a82d112c --- a/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin.js @@ -1 +1 @@ -(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file +(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js old mode 100755 new mode 100644 index c2be2f40a6..a1579c85f2 --- a/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js @@ -1,112 +1,122 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; - - tinymce.create('tinymce.plugins.TabFocusPlugin', { - init : function(ed, url) { - function tabCancel(ed, e) { - if (e.keyCode === 9) - return Event.cancel(e); - }; - - function tabHandler(ed, e) { - var x, i, f, el, v; - - function find(d) { - f = DOM.getParent(ed.id, 'form'); - el = f.elements; - - if (f) { - each(el, function(e, i) { - if (e.id == ed.id) { - x = i; - return false; - } - }); - - if (d > 0) { - for (i = x + 1; i < el.length; i++) { - if (el[i].type != 'hidden') - return el[i]; - } - } else { - for (i = x - 1; i >= 0; i--) { - if (el[i].type != 'hidden') - return el[i]; - } - } - } - - return null; - }; - - if (e.keyCode === 9) { - v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') - el = find(-1); - else - el = DOM.get(v[0]); - } else { - if (v[1] == ':next') - el = find(1); - else - el = DOM.get(v[1]); - } - - if (el) { - if (ed = tinymce.get(el.id || el.name)) - ed.focus(); - else - window.setTimeout(function() {window.focus();el.focus();}, 10); - - return Event.cancel(e); - } - } - }; - - ed.onKeyUp.add(tabCancel); - - if (tinymce.isGecko) { - ed.onKeyPress.add(tabHandler); - ed.onKeyDown.add(tabCancel); - } else - ed.onKeyDown.add(tabHandler); - - ed.onInit.add(function() { - each(DOM.select('a:first,a:last', ed.getContainer()), function(n) { - Event.add(n, 'focus', function() {ed.focus();}); - }); - }); - }, - - getInfo : function() { - return { - longname : 'Tabfocus', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); -})(); \ No newline at end of file +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; + + tinymce.create('tinymce.plugins.TabFocusPlugin', { + init : function(ed, url) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + } + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + el = DOM.select(':input:enabled,*[tabindex]'); + + function canSelectRecursive(e) { + return e.nodeName==="BODY" || (e.type != 'hidden' && + !(e.style.display == "none") && + !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode)); + } + function canSelectInOldIe(el) { + return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA"; + } + function isOldIe() { + return tinymce.isIE6 || tinymce.isIE7; + } + function canSelect(el) { + return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el); + } + + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) + return el[i]; + } + } + + return null; + } + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (el.id && (ed = tinymce.get(el.id || el.name))) + ed.focus(); + else + window.setTimeout(function() { + if (!tinymce.isWebKit) + window.focus(); + el.focus(); + }, 10); + + return Event.cancel(e); + } + } + } + + ed.onKeyUp.add(tabCancel); + + if (tinymce.isGecko) { + ed.onKeyPress.add(tabHandler); + ed.onKeyDown.add(tabCancel); + } else + ed.onKeyDown.add(tabHandler); + + }, + + getInfo : function() { + return { + longname : 'Tabfocus', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); +})(); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/cell.htm b/library/tinymce/jscripts/tiny_mce/plugins/table/cell.htm old mode 100755 new mode 100644 index d243e1d833..a72a8d6973 --- a/library/tinymce/jscripts/tiny_mce/plugins/table/cell.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/table/cell.htm @@ -5,16 +5,17 @@ + - + @@ -23,7 +24,7 @@
                {#table_dlg.general_props} -
                 
                {#style_dlg.top} - +
                - +
                  + + +
                {#style_dlg.right} - +
                - +
                  + + +
                {#style_dlg.bottom} - +
                - +
                  + + +
                {#style_dlg.left} - +
                - +
                  + + +
                +
                - + - + @@ -92,7 +93,7 @@
                {#table_dlg.advanced_props} -
                @@ -70,10 +71,10 @@
                +
                @@ -124,7 +125,7 @@
                - +
                @@ -133,10 +134,10 @@ - - + +
                 
                - +
                @@ -145,10 +146,10 @@ - - + +
                 
                - +
                @@ -166,6 +167,7 @@ diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css b/library/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/css/row.css b/library/tinymce/jscripts/tiny_mce/plugins/table/css/row.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/css/table.css b/library/tinymce/jscripts/tiny_mce/plugins/table/css/table.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js old mode 100755 new mode 100644 index 266d7d5371..ad462f0e07 --- a/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js @@ -1 +1 @@ -(function(b){var c=b.each;function a(F,E,I){var e,J,B,n;r();n=E.getParent(I.getStart(),"th,td");if(n){J=D(n);B=G();n=v(J.x,J.y)}function w(L,K){L=L.cloneNode(K);L.removeAttribute("id");return L}function r(){var K=0;e=[];c(["thead","tbody","tfoot"],function(L){var M=E.select(L+" tr",F);c(M,function(N,O){O+=K;c(E.select("td,th",N),function(U,P){var Q,R,S,T;if(e[O]){while(e[O][P]){P++}}S=g(U,"rowspan");T=g(U,"colspan");for(R=O;R'}return false}},"childNodes");K=w(K,false);K.rowSpan=K.colSpan=1;if(L){K.appendChild(L)}else{if(!b.isIE){K.innerHTML='
                '}}return K}function p(){var K=E.createRng();c(E.select("tr",F),function(L){if(L.cells.length==0){E.remove(L)}});if(E.select("tr",F).length==0){K.setStartAfter(F);K.setEndAfter(F);I.setRng(K);E.remove(F);return}c(E.select("thead,tbody,tfoot",F),function(L){if(L.rows.length==0){E.remove(L)}});r();row=e[Math.min(e.length-1,J.y)];if(row){I.select(row[Math.min(row.length-1,J.x)].elm,true);I.collapse(true)}}function s(Q,O,S,P){var N,L,K,M,R;N=e[O][Q].elm.parentNode;for(K=1;K<=S;K++){N=E.getNext(N,"tr");if(N){for(L=Q;L>=0;L--){R=e[O+K][L].elm;if(R.parentNode==N){for(M=1;M<=P;M++){E.insertAfter(d(R),R)}break}}if(L==-1){for(M=1;M<=P;M++){N.insertBefore(d(N.cells[0]),N.cells[0])}}}}}function A(){c(e,function(K,L){c(K,function(N,M){var Q,P,R,O;if(h(N)){N=N.elm;Q=g(N,"colspan");P=g(N,"rowspan");if(Q>1||P>1){N.colSpan=N.rowSpan=1;for(O=0;O1){P.rowSpan=rowSpan+1;continue}}else{if(K>0&&e[K-1][O]){S=e[K-1][O].elm;rowSpan=g(S,"rowspan");if(rowSpan>1){S.rowSpan=rowSpan+1;continue}}}L=d(P);L.colSpan=P.colSpan;R.appendChild(L);M=P}}if(R.hasChildNodes()){if(!N){E.insertAfter(R,Q)}else{Q.parentNode.insertBefore(R,Q)}}}function f(L){var M,K;c(e,function(N,O){c(N,function(Q,P){if(h(Q)){M=P;if(L){return false}}});if(L){return !M}});c(e,function(Q,R){var N=Q[M].elm,O,P;if(N!=K){P=g(N,"colspan");O=g(N,"rowspan");if(P==1){if(!L){E.insertAfter(d(N),N);s(M,R,O-1,P)}else{N.parentNode.insertBefore(d(N),N);s(M,R,O-1,P)}}else{N.colSpan++}K=N}})}function m(){var K=[];c(e,function(L,M){c(L,function(O,N){if(h(O)&&b.inArray(K,N)===-1){c(e,function(R){var P=R[N].elm,Q;Q=g(P,"colspan");if(Q>1){P.colSpan=Q-1}else{E.remove(P)}});K.push(N)}})});p()}function l(){var L;function K(O){var N,P,M;N=E.getNext(O,"tr");c(O.cells,function(Q){var R=g(Q,"rowspan");if(R>1){Q.rowSpan=R-1;P=D(Q);s(P.x,P.y,1,1)}});P=D(O.cells[0]);c(e[P.y],function(Q){var R;Q=Q.elm;if(Q!=M){R=g(Q,"rowspan");if(R<=1){E.remove(Q)}else{Q.rowSpan=R-1}M=Q}})}L=j();c(L.reverse(),function(M){K(M)});p()}function C(){var K=j();E.remove(K);p();return K}function H(){var K=j();c(K,function(M,L){K[L]=w(M,true)});return K}function z(M,L){var N=j(),K=N[L?0:N.length-1],O=K.cells.length;c(e,function(Q){var P;O=0;c(Q,function(S,R){if(S.real){O+=S.colspan}if(S.elm.parentNode==K){P=1}});if(P){return false}});if(!L){M.reverse()}c(M,function(R){var Q=R.cells.length,P;for(i=0;iL){L=P}if(O>K){K=O}if(Q.real){S=Q.colspan-1;R=Q.rowspan-1;if(S){if(P+S>L){L=P+S}}if(R){if(O+R>K){K=O+R}}}}})});return{x:L,y:K}}function t(Q){var N,M,S,R,L,K,O,P;B=D(Q);if(J&&B){N=Math.min(J.x,B.x);M=Math.min(J.y,B.y);S=Math.max(J.x,B.x);R=Math.max(J.y,B.y);L=S;K=R;for(y=M;y<=K;y++){Q=e[y][N];if(!Q.real){if(N-(Q.colspan-1)L){L=x+O}}if(P){if(y+P>K){K=y+P}}}}}E.removeClass(E.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=M;y<=K;y++){for(x=N;x<=L;x++){E.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:A,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:C,copyRows:H,pasteRows:z,getPos:D,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")||l.dom.select("td.mceSelected,th.mceSelected").length){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'
                ')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce); \ No newline at end of file +(function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='
                '}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){var T=S&&S[R?"lastChild":"firstChild"];return T&&T.nodeName==="BR"?C.dom.getParent(T,"td,th"):T}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){r.dom.add(r.getBody(),"p",null,'
                ')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName=="BR"){w.dom.remove(z)}});if(d.isGecko){r.onKeyDown.add(function(z,B){if(B.keyCode===d.VK.ENTER&&B.shiftKey){var A=z.selection.getRng().startContainer;var C=q.getParent(A,"td,th");if(C){var w=z.getDoc().createTextNode("\uFEFF");q.insertAfter(w,A)}}})}s();r.startContent=r.getContent({format:"raw"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js old mode 100755 new mode 100644 index c2f307f045..832b5e9433 --- a/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js @@ -1,1125 +1,1428 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var each = tinymce.each; - - /** - * Table Grid class. - */ - function TableGrid(table, dom, selection) { - var grid, startPos, endPos, selectedCell; - - buildGrid(); - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select(part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('td,th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) - x++; - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) - grid[y2] = []; - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part : part, - real : y2 == y && x2 == x, - elm : td, - rowspan : rowspan, - colspan : colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - }; - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) - return row[x]; - }; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1); - }; - - function isCellSelected(cell) { - return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell; - }; - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { - rows.push(row); - return false; - } - }); - }); - - return rows; - }; - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - }; - - function cloneCell(cell) { - var formatNode; - - // Clone formats - tinymce.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - node = cloneNode(node, false); - - if (!formatNode) - formatNode = curNode = node; - else if (curNode) - curNode.appendChild(node); - - curNode = node; - }); - - // Add something to the inner node - if (curNode) - curNode.innerHTML = tinymce.isIE ? ' ' : '
                '; - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - cell.rowSpan = cell.colSpan = 1; - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!tinymce.isIE) - cell.innerHTML = '
                '; - } - - return cell; - }; - - function cleanup() { - var rng = dom.createRng(); - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length == 0) - dom.remove(tr); - }); - - // Empty table - if (dom.select('tr', table).length == 0) { - rng.setStartAfter(table); - rng.setEndAfter(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length == 0) - dom.remove(part); - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - }; - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) - dom.insertAfter(cloneCell(cell), cell); - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - }; - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, newCell, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - cell.colSpan = cell.rowSpan = 1; - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) - dom.insertAfter(cloneCell(cell), cell); - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - }; - - function merge(cell, cols, rows) { - var startX, startY, endX, endY, x, y, startCell, endCell, cell, children; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - // Use selection - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - startCell.colSpan = (endX - startX) + 1; - startCell.rowSpan = (endY - startY) + 1; - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x].elm; - - if (cell != startCell) { - // Move children to startCell - children = tinymce.grep(cell.childNodes); - each(children, function(node, i) { - // Jump over last BR element - if (node.nodeName != 'BR' || i != children.length - 1) - startCell.appendChild(node); - }); - - // Remove cell - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - }; - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) - return false; - } - }); - - if (before) - return !posY; - }); - - for (x = 0; x < grid[0].length; x++) { - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - cell.rowSpan = rowSpan + 1; - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowspan'); - if (rowSpan > 1) { - otherCell.rowSpan = rowSpan + 1; - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell) - newCell.colSpan = cell.colSpan; - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) - dom.insertAfter(newRow, rowElm); - else - rowElm.parentNode.insertBefore(newRow, rowElm); - } - }; - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) - return false; - } - }); - - if (before) - return !posX; - }); - - each(grid, function(row, y) { - var cell = row[posX].elm, rowSpan, colSpan; - - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else - cell.colSpan++; - - lastCell = cell; - } - }); - }; - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colspan'); - - if (colSpan > 1) - cell.colSpan = colSpan - 1; - else - dom.remove(cell); - }); - - cols.push(x); - } - }); - }); - - cleanup(); - }; - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowspan'); - - if (rowSpan > 1) { - cell.rowSpan = rowSpan - 1; - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowspan'); - - if (rowSpan <= 1) - dom.remove(cell); - else - cell.rowSpan = rowSpan - 1; - - lastCell = cell; - } - }); - }; - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - }; - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - }; - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - }; - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell, x) { - if (cell.real) - targetCellCount += cell.colspan; - - if (cell.elm.parentNode == targetRow) - match = 1; - }); - - if (match) - return false; - }); - - if (!before) - rows.reverse(); - - each(rows, function(row) { - var cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - cell.colSpan = cell.rowSpan = 1; - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) - row.appendChild(cloneCell(row.cells[cellCount - 1])); - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) - dom.remove(row.cells[i]); - - // Add before/after - if (before) - targetRow.parentNode.insertBefore(row, targetRow); - else - dom.insertAfter(row, targetRow); - }); - }; - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - }; - - function setStartCell(cell) { - startPos = getPos(cell); - }; - - function findEndPos() { - var pos, maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) - maxX = x; - - if (y > maxY) - maxY = y; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - }; - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) - startX -= cell.colspan - 1; - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) - startY -= cell.rowspan - 1; - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) - dom.addClass(grid[y][x].elm, 'mceSelected'); - } - } - }; - - // Expose to public - tinymce.extend(this, { - deleteTable : deleteTable, - split : split, - merge : merge, - insertRow : insertRow, - insertCol : insertCol, - deleteCols : deleteCols, - deleteRows : deleteRows, - cutRows : cutRows, - copyRows : copyRows, - pasteRows : pasteRows, - getPos : getPos, - setStartCell : setStartCell, - setEndCell : setEndCell - }); - }; - - tinymce.create('tinymce.plugins.TablePlugin', { - init : function(ed, url) { - var winMan, clipboardRows; - - function createTableGrid(node) { - var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); - - if (tblElm) - return new TableGrid(tblElm, ed.dom, selection); - }; - - function cleanup() { - // Restore selection possibilities - ed.getBody().style.webkitUserSelect = ''; - ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - }; - - // Register buttons - each([ - ['table', 'table.desc', 'mceInsertTable', true], - ['delete_table', 'table.del', 'mceTableDelete'], - ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], - ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], - ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], - ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], - ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], - ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], - ['row_props', 'table.row_desc', 'mceTableRowProps', true], - ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], - ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], - ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] - ], function(c) { - ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); - }); - - // Select whole table is a table border is clicked - if (!tinymce.isIE) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'TABLE') - ed.selection.select(e); - }); - } - - // Handle node change updates - ed.onNodeChange.add(function(ed, cm, n) { - var p; - - n = ed.selection.getStart(); - p = ed.dom.getParent(n, 'td,th,caption'); - cm.setActive('table', n.nodeName === 'TABLE' || !!p); - - // Disable table tools if we are in caption - if (p && p.nodeName === 'CAPTION') - p = 0; - - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_col', !p); - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_row', !p); - cm.setDisabled('col_after', !p); - cm.setDisabled('col_before', !p); - cm.setDisabled('row_after', !p); - cm.setDisabled('row_before', !p); - cm.setDisabled('row_props', !p); - cm.setDisabled('cell_props', !p); - cm.setDisabled('split_cells', !p); - cm.setDisabled('merge_cells', !p); - }); - - ed.onInit.add(function(ed) { - var startTable, startCell, dom = ed.dom, tableGrid; - - winMan = ed.windowManager; - - // Add cell selection logic - ed.onMouseDown.add(function(ed, e) { - if (e.button != 2) { - cleanup(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - dom.bind(ed.getDoc(), 'mouseover', function(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = createTableGrid(table); - tableGrid.setStartCell(startCell); - - ed.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - } - - // Remove current selection - sel = ed.selection.getSel(); - - if (sel.removeAllRanges) - sel.removeAllRanges(); - else - sel.empty(); - - e.preventDefault(); - } - }); - - ed.onMouseUp.add(function(ed, e) { - var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; - - // Move selection to startCell - if (startCell) { - if (tableGrid) - ed.getBody().style.webkitUserSelect = ''; - - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mceSelected,th.mceSelected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - - setPoint(node, 1); - walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mceSelected')) - break; - - lastNode = node; - } - } while (node = walker.next()); - - setPoint(lastNode); - - sel.setRng(rng); - } - - ed.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - ed.onKeyUp.add(function(ed, e) { - cleanup(); - }); - - // Add context menu - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { - var sm, se = ed.selection, el = se.getNode() || ed.getBody(); - - if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { - m.removeAll(); - - if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - m.addSeparator(); - } - - if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - m.addSeparator(); - } - - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); - m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); - m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); - m.addSeparator(); - - // Cell menu - sm = m.addMenu({title : 'table.cell'}); - sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); - sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); - sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); - - // Row menu - sm = m.addMenu({title : 'table.row'}); - sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); - sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); - sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); - sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); - sm.addSeparator(); - sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); - sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); - sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); - sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); - - // Column menu - sm = m.addMenu({title : 'table.col'}); - sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); - sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); - sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); - } else - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - if (!tinymce.isIE) { - function fixTableCaretPos() { - var last; - - // Skip empty text nodes form the end - for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; - - if (last && last.nodeName == 'TABLE') - ed.dom.add(ed.getBody(), 'p', null, '
                '); - }; - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - if (tinymce.isGecko) { - ed.onKeyDown.add(function(ed, e) { - var rng, table, dom = ed.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = ed.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && ed.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - ed.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - ed.onKeyUp.add(fixTableCaretPos); - ed.onSetContent.add(fixTableCaretPos); - ed.onVisualAid.add(fixTableCaretPos); - - ed.onPreProcess.add(function(ed, o) { - var last = o.node.lastChild; - - if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') - ed.dom.remove(last); - }); - - fixTableCaretPos(); - } - }); - - // Register action commands - each({ - mceTableSplitCells : function(grid) { - grid.split(); - }, - - mceTableMergeCells : function(grid) { - var rowSpan, colSpan, cell; - - cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { - winMan.open({ - url : url + '/merge_cells.htm', - width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), - height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), - inline : 1 - }, { - rows : rowSpan, - cols : colSpan, - onaction : function(data) { - grid.merge(cell, data.cols, data.rows); - }, - plugin_url : url - }); - } else - grid.merge(); - }, - - mceTableInsertRowBefore : function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter : function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore : function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter : function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol : function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow : function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow : function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow : function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore : function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter : function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete : function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - ed.addCommand(name, function() { - var grid = createTableGrid(); - - if (grid) { - func(grid); - ed.execCommand('mceRepaint'); - cleanup(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable : function(val) { - winMan.open({ - url : url + '/table.htm', - width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), - height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - action : val ? val.action : 0 - }); - }, - - mceTableRowProps : function() { - winMan.open({ - url : url + '/row.htm', - width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }, - - mceTableCellProps : function() { - winMan.open({ - url : url + '/cell.htm', - width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - } - }, function(func, name) { - ed.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); -})(tinymce); \ No newline at end of file +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var each = tinymce.each; + + // Checks if the selection/caret is at the start of the specified block element + function isAtStart(rng, par) { + var doc = par.ownerDocument, rng2 = doc.createRange(), elm; + + rng2.setStartBefore(par); + rng2.setEnd(rng.endContainer, rng.endOffset); + + elm = doc.createElement('body'); + elm.appendChild(rng2.cloneContents()); + + // Check for text characters of other elements that should be treated as content + return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; + }; + + function getSpanVal(td, name) { + return parseInt(td.getAttribute(name) || 1); + } + + /** + * Table Grid class. + */ + function TableGrid(table, dom, selection) { + var grid, startPos, endPos, selectedCell; + + buildGrid(); + selectedCell = dom.getParent(selection.getStart(), 'th,td'); + if (selectedCell) { + startPos = getPos(selectedCell); + endPos = findEndPos(); + selectedCell = getCell(startPos.x, startPos.y); + } + + function cloneNode(node, children) { + node = node.cloneNode(children); + node.removeAttribute('id'); + + return node; + } + + function buildGrid() { + var startY = 0; + + grid = []; + + each(['thead', 'tbody', 'tfoot'], function(part) { + var rows = dom.select('> ' + part + ' tr', table); + + each(rows, function(tr, y) { + y += startY; + + each(dom.select('> td, > th', tr), function(td, x) { + var x2, y2, rowspan, colspan; + + // Skip over existing cells produced by rowspan + if (grid[y]) { + while (grid[y][x]) + x++; + } + + // Get col/rowspan from cell + rowspan = getSpanVal(td, 'rowspan'); + colspan = getSpanVal(td, 'colspan'); + + // Fill out rowspan/colspan right and down + for (y2 = y; y2 < y + rowspan; y2++) { + if (!grid[y2]) + grid[y2] = []; + + for (x2 = x; x2 < x + colspan; x2++) { + grid[y2][x2] = { + part : part, + real : y2 == y && x2 == x, + elm : td, + rowspan : rowspan, + colspan : colspan + }; + } + } + }); + }); + + startY += rows.length; + }); + }; + + function getCell(x, y) { + var row; + + row = grid[y]; + if (row) + return row[x]; + }; + + function setSpanVal(td, name, val) { + if (td) { + val = parseInt(val); + + if (val === 1) + td.removeAttribute(name, 1); + else + td.setAttribute(name, val, 1); + } + } + + function isCellSelected(cell) { + return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); + }; + + function getSelectedRows() { + var rows = []; + + each(table.rows, function(row) { + each(row.cells, function(cell) { + if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { + rows.push(row); + return false; + } + }); + }); + + return rows; + }; + + function deleteTable() { + var rng = dom.createRng(); + + rng.setStartAfter(table); + rng.setEndAfter(table); + + selection.setRng(rng); + + dom.remove(table); + }; + + function cloneCell(cell) { + var formatNode; + + // Clone formats + tinymce.walk(cell, function(node) { + var curNode; + + if (node.nodeType == 3) { + each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { + node = cloneNode(node, false); + + if (!formatNode) + formatNode = curNode = node; + else if (curNode) + curNode.appendChild(node); + + curNode = node; + }); + + // Add something to the inner node + if (curNode) + curNode.innerHTML = tinymce.isIE ? ' ' : '
                '; + + return false; + } + }, 'childNodes'); + + cell = cloneNode(cell, false); + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + if (formatNode) { + cell.appendChild(formatNode); + } else { + if (!tinymce.isIE) + cell.innerHTML = '
                '; + } + + return cell; + }; + + function cleanup() { + var rng = dom.createRng(); + + // Empty rows + each(dom.select('tr', table), function(tr) { + if (tr.cells.length == 0) + dom.remove(tr); + }); + + // Empty table + if (dom.select('tr', table).length == 0) { + rng.setStartAfter(table); + rng.setEndAfter(table); + selection.setRng(rng); + dom.remove(table); + return; + } + + // Empty header/body/footer + each(dom.select('thead,tbody,tfoot', table), function(part) { + if (part.rows.length == 0) + dom.remove(part); + }); + + // Restore selection to start position if it still exists + buildGrid(); + + // Restore the selection to the closest table position + row = grid[Math.min(grid.length - 1, startPos.y)]; + if (row) { + selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); + selection.collapse(true); + } + }; + + function fillLeftDown(x, y, rows, cols) { + var tr, x2, r, c, cell; + + tr = grid[y][x].elm.parentNode; + for (r = 1; r <= rows; r++) { + tr = dom.getNext(tr, 'tr'); + + if (tr) { + // Loop left to find real cell + for (x2 = x; x2 >= 0; x2--) { + cell = grid[y + r][x2].elm; + + if (cell.parentNode == tr) { + // Append clones after + for (c = 1; c <= cols; c++) + dom.insertAfter(cloneCell(cell), cell); + + break; + } + } + + if (x2 == -1) { + // Insert nodes before first cell + for (c = 1; c <= cols; c++) + tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); + } + } + } + }; + + function split() { + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan, newCell, i; + + if (isCellSelected(cell)) { + cell = cell.elm; + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan > 1 || rowSpan > 1) { + setSpanVal(cell, 'rowSpan', 1); + setSpanVal(cell, 'colSpan', 1); + + // Insert cells right + for (i = 0; i < colSpan - 1; i++) + dom.insertAfter(cloneCell(cell), cell); + + fillLeftDown(x, y, rowSpan - 1, colSpan); + } + } + }); + }); + }; + + function merge(cell, cols, rows) { + var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; + + // Use specified cell and cols/rows + if (cell) { + pos = getPos(cell); + startX = pos.x; + startY = pos.y; + endX = startX + (cols - 1); + endY = startY + (rows - 1); + } else { + // Use selection + startX = startPos.x; + startY = startPos.y; + endX = endPos.x; + endY = endPos.y; + } + + // Find start/end cells + startCell = getCell(startX, startY); + endCell = getCell(endX, endY); + + // Check if the cells exists and if they are of the same part for example tbody = tbody + if (startCell && endCell && startCell.part == endCell.part) { + // Split and rebuild grid + split(); + buildGrid(); + + // Set row/col span to start cell + startCell = getCell(startX, startY).elm; + setSpanVal(startCell, 'colSpan', (endX - startX) + 1); + setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); + + // Remove other cells and add it's contents to the start cell + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + if (!grid[y] || !grid[y][x]) + continue; + + cell = grid[y][x].elm; + + if (cell != startCell) { + // Move children to startCell + children = tinymce.grep(cell.childNodes); + each(children, function(node) { + startCell.appendChild(node); + }); + + // Remove bogus nodes if there is children in the target cell + if (children.length) { + children = tinymce.grep(startCell.childNodes); + count = 0; + each(children, function(node) { + if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) + startCell.removeChild(node); + }); + } + + // Remove cell + dom.remove(cell); + } + } + } + + // Remove empty rows etc and restore caret location + cleanup(); + } + }; + + function insertRow(before) { + var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; + + // Find first/last row + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + cell = cell.elm; + rowElm = cell.parentNode; + newRow = cloneNode(rowElm, false); + posY = y; + + if (before) + return false; + } + }); + + if (before) + return !posY; + }); + + for (x = 0; x < grid[0].length; x++) { + // Cell not found could be because of an invalid table structure + if (!grid[posY][x]) + continue; + + cell = grid[posY][x].elm; + + if (cell != lastCell) { + if (!before) { + rowSpan = getSpanVal(cell, 'rowspan'); + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan + 1); + continue; + } + } else { + // Check if cell above can be expanded + if (posY > 0 && grid[posY - 1][x]) { + otherCell = grid[posY - 1][x].elm; + rowSpan = getSpanVal(otherCell, 'rowSpan'); + if (rowSpan > 1) { + setSpanVal(otherCell, 'rowSpan', rowSpan + 1); + continue; + } + } + } + + // Insert new cell into new row + newCell = cloneCell(cell); + setSpanVal(newCell, 'colSpan', cell.colSpan); + + newRow.appendChild(newCell); + + lastCell = cell; + } + } + + if (newRow.hasChildNodes()) { + if (!before) + dom.insertAfter(newRow, rowElm); + else + rowElm.parentNode.insertBefore(newRow, rowElm); + } + }; + + function insertCol(before) { + var posX, lastCell; + + // Find first/last column + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell)) { + posX = x; + + if (before) + return false; + } + }); + + if (before) + return !posX; + }); + + each(grid, function(row, y) { + var cell, rowSpan, colSpan; + + if (!row[posX]) + return; + + cell = row[posX].elm; + if (cell != lastCell) { + colSpan = getSpanVal(cell, 'colspan'); + rowSpan = getSpanVal(cell, 'rowspan'); + + if (colSpan == 1) { + if (!before) { + dom.insertAfter(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } else { + cell.parentNode.insertBefore(cloneCell(cell), cell); + fillLeftDown(posX, y, rowSpan - 1, colSpan); + } + } else + setSpanVal(cell, 'colSpan', cell.colSpan + 1); + + lastCell = cell; + } + }); + }; + + function deleteCols() { + var cols = []; + + // Get selected column indexes + each(grid, function(row, y) { + each(row, function(cell, x) { + if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { + each(grid, function(row) { + var cell = row[x].elm, colSpan; + + colSpan = getSpanVal(cell, 'colSpan'); + + if (colSpan > 1) + setSpanVal(cell, 'colSpan', colSpan - 1); + else + dom.remove(cell); + }); + + cols.push(x); + } + }); + }); + + cleanup(); + }; + + function deleteRows() { + var rows; + + function deleteRow(tr) { + var nextTr, pos, lastCell; + + nextTr = dom.getNext(tr, 'tr'); + + // Move down row spanned cells + each(tr.cells, function(cell) { + var rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan > 1) { + setSpanVal(cell, 'rowSpan', rowSpan - 1); + pos = getPos(cell); + fillLeftDown(pos.x, pos.y, 1, 1); + } + }); + + // Delete cells + pos = getPos(tr.cells[0]); + each(grid[pos.y], function(cell) { + var rowSpan; + + cell = cell.elm; + + if (cell != lastCell) { + rowSpan = getSpanVal(cell, 'rowSpan'); + + if (rowSpan <= 1) + dom.remove(cell); + else + setSpanVal(cell, 'rowSpan', rowSpan - 1); + + lastCell = cell; + } + }); + }; + + // Get selected rows and move selection out of scope + rows = getSelectedRows(); + + // Delete all selected rows + each(rows.reverse(), function(tr) { + deleteRow(tr); + }); + + cleanup(); + }; + + function cutRows() { + var rows = getSelectedRows(); + + dom.remove(rows); + cleanup(); + + return rows; + }; + + function copyRows() { + var rows = getSelectedRows(); + + each(rows, function(row, i) { + rows[i] = cloneNode(row, true); + }); + + return rows; + }; + + function pasteRows(rows, before) { + var selectedRows = getSelectedRows(), + targetRow = selectedRows[before ? 0 : selectedRows.length - 1], + targetCellCount = targetRow.cells.length; + + // Calc target cell count + each(grid, function(row) { + var match; + + targetCellCount = 0; + each(row, function(cell, x) { + if (cell.real) + targetCellCount += cell.colspan; + + if (cell.elm.parentNode == targetRow) + match = 1; + }); + + if (match) + return false; + }); + + if (!before) + rows.reverse(); + + each(rows, function(row) { + var cellCount = row.cells.length, cell; + + // Remove col/rowspans + for (i = 0; i < cellCount; i++) { + cell = row.cells[i]; + setSpanVal(cell, 'colSpan', 1); + setSpanVal(cell, 'rowSpan', 1); + } + + // Needs more cells + for (i = cellCount; i < targetCellCount; i++) + row.appendChild(cloneCell(row.cells[cellCount - 1])); + + // Needs less cells + for (i = targetCellCount; i < cellCount; i++) + dom.remove(row.cells[i]); + + // Add before/after + if (before) + targetRow.parentNode.insertBefore(row, targetRow); + else + dom.insertAfter(row, targetRow); + }); + }; + + function getPos(target) { + var pos; + + each(grid, function(row, y) { + each(row, function(cell, x) { + if (cell.elm == target) { + pos = {x : x, y : y}; + return false; + } + }); + + return !pos; + }); + + return pos; + }; + + function setStartCell(cell) { + startPos = getPos(cell); + }; + + function findEndPos() { + var pos, maxX, maxY; + + maxX = maxY = 0; + + each(grid, function(row, y) { + each(row, function(cell, x) { + var colSpan, rowSpan; + + if (isCellSelected(cell)) { + cell = grid[y][x]; + + if (x > maxX) + maxX = x; + + if (y > maxY) + maxY = y; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + }); + }); + + return {x : maxX, y : maxY}; + }; + + function setEndCell(cell) { + var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; + + endPos = getPos(cell); + + if (startPos && endPos) { + // Get start/end positions + startX = Math.min(startPos.x, endPos.x); + startY = Math.min(startPos.y, endPos.y); + endX = Math.max(startPos.x, endPos.x); + endY = Math.max(startPos.y, endPos.y); + + // Expand end positon to include spans + maxX = endX; + maxY = endY; + + // Expand startX + for (y = startY; y <= maxY; y++) { + cell = grid[y][startX]; + + if (!cell.real) { + if (startX - (cell.colspan - 1) < startX) + startX -= cell.colspan - 1; + } + } + + // Expand startY + for (x = startX; x <= maxX; x++) { + cell = grid[startY][x]; + + if (!cell.real) { + if (startY - (cell.rowspan - 1) < startY) + startY -= cell.rowspan - 1; + } + } + + // Find max X, Y + for (y = startY; y <= endY; y++) { + for (x = startX; x <= endX; x++) { + cell = grid[y][x]; + + if (cell.real) { + colSpan = cell.colspan - 1; + rowSpan = cell.rowspan - 1; + + if (colSpan) { + if (x + colSpan > maxX) + maxX = x + colSpan; + } + + if (rowSpan) { + if (y + rowSpan > maxY) + maxY = y + rowSpan; + } + } + } + } + + // Remove current selection + dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + + // Add new selection + for (y = startY; y <= maxY; y++) { + for (x = startX; x <= maxX; x++) { + if (grid[y][x]) + dom.addClass(grid[y][x].elm, 'mceSelected'); + } + } + } + }; + + // Expose to public + tinymce.extend(this, { + deleteTable : deleteTable, + split : split, + merge : merge, + insertRow : insertRow, + insertCol : insertCol, + deleteCols : deleteCols, + deleteRows : deleteRows, + cutRows : cutRows, + copyRows : copyRows, + pasteRows : pasteRows, + getPos : getPos, + setStartCell : setStartCell, + setEndCell : setEndCell + }); + }; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload + + function createTableGrid(node) { + var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); + + if (tblElm) + return new TableGrid(tblElm, ed.dom, selection); + }; + + function cleanup() { + // Restore selection possibilities + ed.getBody().style.webkitUserSelect = ''; + + if (hasCellSelection) { + ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); + hasCellSelection = false; + } + }; + + // Register buttons + each([ + ['table', 'table.desc', 'mceInsertTable', true], + ['delete_table', 'table.del', 'mceTableDelete'], + ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], + ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], + ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], + ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], + ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], + ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], + ['row_props', 'table.row_desc', 'mceTableRowProps', true], + ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], + ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], + ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] + ], function(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') { + ed.selection.select(e); + ed.nodeChanged(); + } + }); + } + + ed.onPreProcess.add(function(ed, args) { + var nodes, i, node, dom = ed.dom, value; + + nodes = dom.select('table', args.node); + i = nodes.length; + while (i--) { + node = nodes[i]; + dom.setAttrib(node, 'data-mce-style', ''); + + if ((value = dom.getAttrib(node, 'width'))) { + dom.setStyle(node, 'width', value); + dom.setAttrib(node, 'width', ''); + } + + if ((value = dom.getAttrib(node, 'height'))) { + dom.setStyle(node, 'height', value); + dom.setAttrib(node, 'height', ''); + } + } + }); + + // Handle node change updates + ed.onNodeChange.add(function(ed, cm, n) { + var p; + + n = ed.selection.getStart(); + p = ed.dom.getParent(n, 'td,th,caption'); + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + + // Disable table tools if we are in caption + if (p && p.nodeName === 'CAPTION') + p = 0; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p); + cm.setDisabled('merge_cells', !p); + }); + + ed.onInit.add(function(ed) { + var startTable, startCell, dom = ed.dom, tableGrid; + + winMan = ed.windowManager; + + // Add cell selection logic + ed.onMouseDown.add(function(ed, e) { + if (e.button != 2) { + cleanup(); + + startCell = dom.getParent(e.target, 'td,th'); + startTable = dom.getParent(startCell, 'table'); + } + }); + + dom.bind(ed.getDoc(), 'mouseover', function(e) { + var sel, table, target = e.target; + + if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { + table = dom.getParent(target, 'table'); + if (table == startTable) { + if (!tableGrid) { + tableGrid = createTableGrid(table); + tableGrid.setStartCell(startCell); + + ed.getBody().style.webkitUserSelect = 'none'; + } + + tableGrid.setEndCell(target); + hasCellSelection = true; + } + + // Remove current selection + sel = ed.selection.getSel(); + + try { + if (sel.removeAllRanges) + sel.removeAllRanges(); + else + sel.empty(); + } catch (ex) { + // IE9 might throw errors here + } + + e.preventDefault(); + } + }); + + ed.onMouseUp.add(function(ed, e) { + var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; + + // Move selection to startCell + if (startCell) { + if (tableGrid) + ed.getBody().style.webkitUserSelect = ''; + + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + } + + // Try to expand text selection as much as we can only Gecko supports cell selection + selectedCells = dom.select('td.mceSelected,th.mceSelected'); + if (selectedCells.length > 0) { + rng = dom.createRng(); + node = selectedCells[0]; + endNode = selectedCells[selectedCells.length - 1]; + rng.setStartBefore(node); + rng.setEndAfter(node); + + setPoint(node, 1); + walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); + + do { + if (node.nodeName == 'TD' || node.nodeName == 'TH') { + if (!dom.hasClass(node, 'mceSelected')) + break; + + lastNode = node; + } + } while (node = walker.next()); + + setPoint(lastNode); + + sel.setRng(rng); + } + + ed.nodeChanged(); + startCell = tableGrid = startTable = null; + } + }); + + ed.onKeyUp.add(function(ed, e) { + cleanup(); + }); + + ed.onKeyDown.add(function (ed, e) { + fixTableCellSelection(ed); + }); + + ed.onMouseDown.add(function (ed, e) { + if (e.button != 2) { + fixTableCellSelection(ed); + } + }); + function tableCellSelected(ed, rng, n, currentCell) { + // The decision of when a table cell is selected is somewhat involved. The fact that this code is + // required is actually a pointer to the root cause of this bug. A cell is selected when the start + // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) + // or the parent of the table (in the case of the selection containing the last cell of a table). + var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), + tableParent, allOfCellSelected, tableCellSelection; + if (table) + tableParent = table.parentNode; + allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && + rng.startOffset == 0 && + rng.endOffset == 0 && + currentCell && + (n.nodeName=="TR" || n==tableParent); + tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; + return allOfCellSelected || tableCellSelection; + // return false; + } + + // this nasty hack is here to work around some WebKit selection bugs. + function fixTableCellSelection(ed) { + if (!tinymce.isWebKit) + return; + + var rng = ed.selection.getRng(); + var n = ed.selection.getNode(); + var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH'); + + if (!tableCellSelected(ed, rng, n, currentCell)) + return; + if (!currentCell) { + currentCell=n; + } + + // Get the very last node inside the table cell + var end = currentCell.lastChild; + while (end.lastChild) + end = end.lastChild; + + // Select the entire table cell. Nothing outside of the table cell should be selected. + rng.setEnd(end, end.nodeValue.length); + ed.selection.setRng(rng); + } + ed.plugins.table.fixTableCellSelection=fixTableCellSelection; + + // Add context menu + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); + }); + } + + // Fix to allow navigating up and down in a table in WebKit browsers. + if (tinymce.isWebKit) { + function moveSelection(ed, e) { + var VK = tinymce.VK; + var key = e.keyCode; + + function handle(upBool, sourceNode, event) { + var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; + var currentRow = ed.dom.getParent(sourceNode, 'tr'); + var siblingRow = currentRow[siblingDirection]; + + if (siblingRow) { + moveCursorToRow(ed, sourceNode, siblingRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } else { + var tableNode = ed.dom.getParent(currentRow, 'table'); + var middleNode = currentRow.parentNode; + var parentNodeName = middleNode.nodeName.toLowerCase(); + if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { + var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); + if (targetParent !== null) { + return moveToRowInTarget(upBool, targetParent, sourceNode, event); + } + } + return escapeTable(upBool, currentRow, siblingDirection, tableNode, event); + } + } + + function getTargetParent(upBool, topNode, secondNode, nodeName) { + var tbodies = ed.dom.select('>' + nodeName, topNode); + var position = tbodies.indexOf(secondNode); + if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { + return getFirstHeadOrFoot(upBool, topNode); + } else if (position === -1) { + var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; + return tbodies[topOrBottom]; + } else { + return tbodies[position + (upBool ? -1 : 1)]; + } + } + + function getFirstHeadOrFoot(upBool, parent) { + var tagName = upBool ? 'thead' : 'tfoot'; + var headOrFoot = ed.dom.select('>' + tagName, parent); + return headOrFoot.length !== 0 ? headOrFoot[0] : null; + } + + function moveToRowInTarget(upBool, targetParent, sourceNode, event) { + var targetRow = getChildForDirection(targetParent, upBool); + targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool); + tinymce.dom.Event.cancel(event); + return true; + } + + function escapeTable(upBool, currentRow, siblingDirection, table, event) { + var tableSibling = table[siblingDirection]; + if (tableSibling) { + moveCursorToStartOfElement(tableSibling); + return true; + } else { + var parentCell = ed.dom.getParent(table, 'td,th'); + if (parentCell) { + return handle(upBool, parentCell, event); + } else { + var backUpSibling = getChildForDirection(currentRow, !upBool); + moveCursorToStartOfElement(backUpSibling); + return tinymce.dom.Event.cancel(event); + } + } + } + + function getChildForDirection(parent, up) { + var child = parent && parent[up ? 'lastChild' : 'firstChild']; + // BR is not a valid table child to return in this case we return the table cell + return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child; + } + + function moveCursorToStartOfElement(n) { + ed.selection.setCursorLocation(n, 0); + } + + function isVerticalMovement() { + return key == VK.UP || key == VK.DOWN; + } + + function isInTable(ed) { + var node = ed.selection.getNode(); + var currentRow = ed.dom.getParent(node, 'tr'); + return currentRow !== null; + } + + function columnIndex(column) { + var colIndex = 0; + var c = column; + while (c.previousSibling) { + c = c.previousSibling; + colIndex = colIndex + getSpanVal(c, "colspan"); + } + return colIndex; + } + + function findColumn(rowElement, columnIndex) { + var c = 0; + var r = 0; + each(rowElement.children, function(cell, i) { + c = c + getSpanVal(cell, "colspan"); + r = i; + if (c > columnIndex) + return false; + }); + return r; + } + + function moveCursorToRow(ed, node, row, upBool) { + var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th')); + var tgtColumnIndex = findColumn(row, srcColumnIndex); + var tgtNode = row.childNodes[tgtColumnIndex]; + var rowCellTarget = getChildForDirection(tgtNode, upBool); + moveCursorToStartOfElement(rowCellTarget || tgtNode); + } + + function shouldFixCaret(preBrowserNode) { + var newNode = ed.selection.getNode(); + var newParent = ed.dom.getParent(newNode, 'td,th'); + var oldParent = ed.dom.getParent(preBrowserNode, 'td,th'); + return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent) + } + + function checkSameParentTable(nodeOne, NodeTwo) { + return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE'); + } + + if (isVerticalMovement() && isInTable(ed)) { + var preBrowserNode = ed.selection.getNode(); + setTimeout(function() { + if (shouldFixCaret(preBrowserNode)) { + handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); + } + }, 0); + } + } + + ed.onKeyDown.add(moveSelection); + } + + // Fixes an issue on Gecko where it's impossible to place the caret behind a table + // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled + if (!tinymce.isIE) { + function fixTableCaretPos() { + var last; + + // Skip empty text nodes form the end + for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; + + if (last && last.nodeName == 'TABLE') + ed.dom.add(ed.getBody(), 'p', null, '
                '); + }; + + // Fixes an bug where it's impossible to place the caret before a table in Gecko + // this fix solves it by detecting when the caret is at the beginning of such a table + // and then manually moves the caret infront of the table + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + var rng, table, dom = ed.dom; + + // On gecko it's not possible to place the caret before a table + if (e.keyCode == 37 || e.keyCode == 38) { + rng = ed.selection.getRng(); + table = dom.getParent(rng.startContainer, 'table'); + + if (table && ed.getBody().firstChild == table) { + if (isAtStart(rng, table)) { + rng = dom.createRng(); + + rng.setStartBefore(table); + rng.setEndBefore(table); + + ed.selection.setRng(rng); + + e.preventDefault(); + } + } + } + }); + } + + ed.onKeyUp.add(fixTableCaretPos); + ed.onSetContent.add(fixTableCaretPos); + ed.onVisualAid.add(fixTableCaretPos); + + ed.onPreProcess.add(function(ed, o) { + var last = o.node.lastChild; + + if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') + ed.dom.remove(last); + }); + + + /** + * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line + */ + if (tinymce.isGecko) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) { + var node = ed.selection.getRng().startContainer; + var tableCell = dom.getParent(node, 'td,th'); + if (tableCell) { + var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF"); + dom.insertAfter(zeroSizedNbsp, node); + } + } + }); + } + + + fixTableCaretPos(); + ed.startContent = ed.getContent({format : 'raw'}); + } + }); + + // Register action commands + each({ + mceTableSplitCells : function(grid) { + grid.split(); + }, + + mceTableMergeCells : function(grid) { + var rowSpan, colSpan, cell; + + cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); + if (cell) { + rowSpan = cell.rowSpan; + colSpan = cell.colSpan; + } + + if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { + winMan.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + rows : rowSpan, + cols : colSpan, + onaction : function(data) { + grid.merge(cell, data.cols, data.rows); + }, + plugin_url : url + }); + } else + grid.merge(); + }, + + mceTableInsertRowBefore : function(grid) { + grid.insertRow(true); + }, + + mceTableInsertRowAfter : function(grid) { + grid.insertRow(); + }, + + mceTableInsertColBefore : function(grid) { + grid.insertCol(true); + }, + + mceTableInsertColAfter : function(grid) { + grid.insertCol(); + }, + + mceTableDeleteCol : function(grid) { + grid.deleteCols(); + }, + + mceTableDeleteRow : function(grid) { + grid.deleteRows(); + }, + + mceTableCutRow : function(grid) { + clipboardRows = grid.cutRows(); + }, + + mceTableCopyRow : function(grid) { + clipboardRows = grid.copyRows(); + }, + + mceTablePasteRowBefore : function(grid) { + grid.pasteRows(clipboardRows, true); + }, + + mceTablePasteRowAfter : function(grid) { + grid.pasteRows(clipboardRows); + }, + + mceTableDelete : function(grid) { + grid.deleteTable(); + } + }, function(func, name) { + ed.addCommand(name, function() { + var grid = createTableGrid(); + + if (grid) { + func(grid); + ed.execCommand('mceRepaint'); + cleanup(); + } + }); + }); + + // Register dialog commands + each({ + mceInsertTable : function(val) { + winMan.open({ + url : url + '/table.htm', + width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), + height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + action : val ? val.action : 0 + }); + }, + + mceTableRowProps : function() { + winMan.open({ + url : url + '/row.htm', + width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }, + + mceTableCellProps : function() { + winMan.open({ + url : url + '/cell.htm', + width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), + height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + } + }, function(func, name) { + ed.addCommand(name, function(ui, val) { + func(val); + }); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(tinymce); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js b/library/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js old mode 100755 new mode 100644 index b5fc1fda3d..d6f3290599 --- a/library/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js @@ -63,6 +63,11 @@ function init() { function updateAction() { var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + tinyMCEPopup.restoreSelection(); el = ed.selection.getStart(); tdElm = ed.dom.getParent(el, "td,th"); @@ -83,8 +88,6 @@ function updateAction() { return; } - ed.execCommand('mceBeginUndoLevel'); - switch (getSelectValue(formObj, 'action')) { case "cell": var celltype = getSelectValue(formObj, 'celltype'); @@ -125,6 +128,36 @@ function updateAction() { break; + case "col": + var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + if (cell == tdElm) + break; + col += cell.getAttribute("colspan"); + } while ((cell = nextCell(cell)) != null); + + for (var i=0; i - +
                {#table_dlg.merge_cells_title} -
                 
                - - - - - - - - -
                {#table_dlg.cols}:
                {#table_dlg.rows}:
                + + + + + + + + + +
                :
                :
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/row.htm b/library/tinymce/jscripts/tiny_mce/plugins/table/row.htm old mode 100755 new mode 100644 index 092e6c8270..1885401f6b --- a/library/tinymce/jscripts/tiny_mce/plugins/table/row.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/table/row.htm @@ -5,16 +5,17 @@ + - + @@ -23,7 +24,7 @@
                {#table_dlg.general_props} - +
                - +
                @@ -70,7 +71,7 @@
                @@ -80,7 +81,7 @@
                {#table_dlg.advanced_props} - +
                @@ -112,7 +113,7 @@
                - +
                @@ -122,14 +123,16 @@ - +
                 
                - + +
                 
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/table/table.htm b/library/tinymce/jscripts/tiny_mce/plugins/table/table.htm old mode 100755 new mode 100644 index f269039228..b92fa741eb --- a/library/tinymce/jscripts/tiny_mce/plugins/table/table.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/table/table.htm @@ -10,12 +10,13 @@ - + + @@ -23,48 +24,48 @@
                {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                -
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                +
                @@ -72,7 +73,7 @@
                {#table_dlg.advanced_props} - +
                @@ -98,7 +99,7 @@
                - +
                @@ -150,10 +151,10 @@ - - + + "}else{e+=""}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,""))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,""));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},""+e+"")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+=''}E.iframeHTML+='';if(m.relaxedDomain){E.iframeHTML+=''; + t.plugins = {}; - bi = s.body_id || 'tinymce'; - if (bi.indexOf('=') != -1) { - bi = t.getParam('body_id', '', 'hash'); - bi = bi[t.id] || bi; - } + // Add events to the editor + each([ + 'onPreInit', - bc = s.body_class || ''; - if (bc.indexOf('=') != -1) { - bc = t.getParam('body_class', '', 'hash'); - bc = bc[t.id] || ''; - } + 'onBeforeRenderUI', - t.iframeHTML += ''; + 'onPostRender', - // Domain relaxing enabled, then set document domain - if (tinymce.relaxedDomain) { - // We need to write the contents here in IE since multiple writes messes up refresh button and back button - if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5)) - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; - else if (tinymce.isOpera) - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; - } + 'onLoad', - // Create iframe - n = DOM.add(o.iframeContainer, 'iframe', { - id : t.id + "_ifr", - src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 - frameBorder : '0', - style : { - width : '100%', - height : h - } - }); + 'onInit', - t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; - DOM.get(t.id).style.display = 'none'; + 'onRemove', - if (!isIE || !tinymce.relaxedDomain) - t.setupIframe(); + 'onActivate', - e = n = o = null; // Cleanup - }, + 'onDeactivate', - setupIframe : function() { - var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; + 'onClick', - // Setup iframe body - if (!isIE || !tinymce.relaxedDomain) { - d.open(); - d.write(t.iframeHTML); - d.close(); - } + 'onEvent', - // Design mode needs to be added here Ctrl+A will fail otherwise - if (!isIE) { - try { - if (!s.readonly) - d.designMode = 'On'; - } catch (ex) { - // Will fail on Gecko if the editor is placed in an hidden container element - // The design mode will be set ones the editor is focused - } - } + 'onMouseUp', - // IE needs to use contentEditable or it will display non secure items for HTTPS - if (isIE) { - // It will not steal focus if we hide it while setting contentEditable - b = t.getBody(); - DOM.hide(b); + 'onMouseDown', - if (!s.readonly) - b.contentEditable = true; + 'onDblClick', - DOM.show(b); - } + 'onKeyDown', - t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { - keep_values : true, - url_converter : t.convertURL, - url_converter_scope : t, - hex_colors : s.force_hex_style_colors, - class_filter : s.class_filter, - update_styles : 1, - fix_ie_paragraphs : 1, - valid_styles : s.valid_styles - }); + 'onKeyUp', - t.schema = new tinymce.dom.Schema(); + 'onKeyPress', - t.serializer = new tinymce.dom.Serializer(extend(s, { - valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements, - dom : t.dom, - schema : t.schema - })); + 'onContextMenu', - t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); + 'onSubmit', - t.formatter = new tinymce.Formatter(this); + 'onReset', - // Register default formats - t.formatter.register({ - alignleft : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, - {selector : 'img,table', styles : {'float' : 'left'}} - ], + 'onPaste', - aligncenter : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, - {selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, - {selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}} - ], + 'onPreProcess', - alignright : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, - {selector : 'img,table', styles : {'float' : 'right'}} - ], + 'onPostProcess', - alignfull : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}} - ], + 'onBeforeSetContent', - bold : [ - {inline : 'strong'}, - {inline : 'span', styles : {fontWeight : 'bold'}}, - {inline : 'b'} - ], + 'onBeforeGetContent', - italic : [ - {inline : 'em'}, - {inline : 'span', styles : {fontStyle : 'italic'}}, - {inline : 'i'} - ], + 'onSetContent', - underline : [ - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, - {inline : 'u'} - ], + 'onGetContent', - strikethrough : [ - {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, - {inline : 'u'} - ], + 'onLoadContent', - forecolor : {inline : 'span', styles : {color : '%value'}}, - hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}}, - fontname : {inline : 'span', styles : {fontFamily : '%value'}}, - fontsize : {inline : 'span', styles : {fontSize : '%value'}}, - fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, - blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, + 'onSaveContent', - removeformat : [ - {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, - {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, - {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} - ] - }); + 'onNodeChange', - // Register default block formats - each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) { - t.formatter.register(name, {block : name, remove : 'all'}); - }); + 'onChange', - // Register user defined formats - t.formatter.register(t.settings.formats); + 'onBeforeExecCommand', - t.undoManager = new tinymce.UndoManager(t); + 'onExecCommand', - // Pass through - t.undoManager.onAdd.add(function(um, l) { - if (!l.initial) - return t.onChange.dispatch(t, l, um); - }); + 'onUndo', - t.undoManager.onUndo.add(function(um, l) { - return t.onUndo.dispatch(t, l, um); - }); + 'onRedo', - t.undoManager.onRedo.add(function(um, l) { - return t.onRedo.dispatch(t, l, um); - }); + 'onVisualAid', + + 'onSetProgressState', - t.forceBlocks = new tinymce.ForceBlocks(t, { - forced_root_block : s.forced_root_block + 'onSetAttrib' + ], function(e) { + t[e] = new Dispatcher(t); }); - t.editorCommands = new tinymce.EditorCommands(t); + t.settings = s = extend({ + id : id, + language : 'en', + docs_language : 'en', + theme : 'simple', + skin : 'default', + delta_width : 0, + delta_height : 0, + popup_css : '', + plugins : '', + document_base_url : tinymce.documentBaseURL, + add_form_submit_trigger : 1, + submit_patch : 1, + add_unload_trigger : 1, + convert_urls : 1, + relative_urls : 1, + remove_script_host : 1, + table_inline_editing : 0, + object_resizing : 1, + cleanup : 1, + accessibility_focus : 1, + custom_shortcuts : 1, + custom_undo_redo_keyboard_shortcuts : 1, + custom_undo_redo_restore_selection : 1, + custom_undo_redo : 1, + doctype : tinymce.isIE6 ? '' : '', // Use old doctype on IE 6 to avoid horizontal scroll + visual_table_class : 'mceItemTable', + visual : 1, + font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', + font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size + apply_source_formatting : 1, + directionality : 'ltr', + forced_root_block : 'p', + hidden_input : 1, + padd_empty_editor : 1, + render_ui : 1, + init_theme : 1, + force_p_newlines : 1, + indentation : '30px', + keep_styles : 1, + fix_table_elements : 1, + inline_styles : 1, + convert_fonts_to_spans : true, + indent : 'simple', + indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside', + indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside', + validate : true, + entity_encoding : 'named', + url_converter : t.convertURL, + url_converter_scope : t, + ie7_compat : true + }, s); - // Pass through - t.serializer.onPreProcess.add(function(se, o) { - return t.onPreProcess.dispatch(t, o, se); + t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { + base_uri : tinyMCE.baseURI }); - t.serializer.onPostProcess.add(function(se, o) { - return t.onPostProcess.dispatch(t, o, se); - }); + t.baseURI = tinymce.baseURI; - t.onPreInit.dispatch(t); + t.contentCSS = []; - if (!s.gecko_spellcheck) - t.getBody().spellcheck = 0; + // Call setup + t.execCallback('setup', t); + }, - if (!s.readonly) - t._addEvents(); + render : function(nst) { + var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; - t.controlManager.onPostRender.dispatch(t, t.controlManager); - t.onPostRender.dispatch(t); + // Page is not loaded yet, wait for it + if (!Event.domLoaded) { + Event.add(window, 'ready', function() { + t.render(); + }); + return; + } - if (s.directionality) - t.getBody().dir = s.directionality; + tinyMCE.settings = s; - if (s.nowrap) - t.getBody().style.whiteSpace = "nowrap"; + // Element not found, then skip initialization + if (!t.getElement()) + return; - if (s.custom_elements) { - function handleCustom(ed, o) { - each(explode(s.custom_elements), function(v) { - var n; + // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff + // here since the browser says it has contentEditable support but there is no visible + // caret We will remove this check ones Apple implements full contentEditable support + if (tinymce.isIDevice && !tinymce.isIOS5) + return; - if (v.indexOf('~') === 0) { - v = v.substring(1); - n = 'span'; - } else - n = 'div'; + // Add hidden input for non input elements inside form elements + if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) + DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); - o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>'); - o.content = o.content.replace(new RegExp('', 'g'), ''); - }); - }; + if (tinymce.WindowManager) + t.windowManager = new tinymce.WindowManager(t); - t.onBeforeSetContent.add(handleCustom); - t.onPostProcess.add(function(ed, o) { - if (o.set) - handleCustom(ed, o); + if (s.encoding == 'xml') { + t.onGetContent.add(function(ed, o) { + if (o.save) + o.content = DOM.encode(o.content); }); } - if (s.handle_node_change_callback) { - t.onNodeChange.add(function(ed, cm, n) { - t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); + if (s.add_form_submit_trigger) { + t.onSubmit.addToTop(function() { + if (t.initialized) { + t.save(); + t.isNotDirty = 1; + } }); } - if (s.save_callback) { - t.onSaveContent.add(function(ed, o) { - var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); - - if (h) - o.content = h; + if (s.add_unload_trigger) { + t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { + if (t.initialized && !t.destroyed && !t.isHidden()) + t.save({format : 'raw', no_events : true}); }); } - if (s.onchange_callback) { - t.onChange.add(function(ed, l) { - t.execCallback('onchange_callback', t, l); - }); - } + tinymce.addUnload(t.destroy, t); - if (s.convert_newlines_to_brs) { - t.onBeforeSetContent.add(function(ed, o) { - if (o.initial) - o.content = o.content.replace(/\r?\n/g, '
                '); - }); - } + if (s.submit_patch) { + t.onBeforeRenderUI.add(function() { + var n = t.getElement().form; - if (s.fix_nesting && isIE) { - t.onBeforeSetContent.add(function(ed, o) { - o.content = t._fixNesting(o.content); + if (!n) + return; + + // Already patched + if (n._mceOldSubmit) + return; + + // Check page uses id="submit" or name="submit" for it's submit button + if (!n.submit.nodeType && !n.submit.length) { + t.formElement = n; + n._mceOldSubmit = n.submit; + n.submit = function() { + // Save all instances + tinymce.triggerSave(); + t.isNotDirty = 1; + + return t.formElement._mceOldSubmit(t.formElement); + }; + } + + n = null; }); } - if (s.preformatted) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^\s*/, ''); - o.content = o.content.replace(/<\/pre>\s*$/, ''); + // Load scripts + function loadScripts() { + if (s.language && s.language_load !== false) + sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); - if (o.set) - o.content = '
                ' + o.content + '
                '; + if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) + ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); + + each(explode(s.plugins), function(p) { + if (p &&!PluginManager.urls[p]) { + if (p.charAt(0) == '-') { + p = p.substr(1, p.length); + var dependencies = PluginManager.dependencies(p); + each(dependencies, function(dep) { + var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'}; + var dep = PluginManager.createUrl(defaultSettings, dep); + PluginManager.load(dep.resource, dep); + + }); + } else { + // Skip safari plugin, since it is removed as of 3.3b1 + if (p == 'safari') { + return; + } + PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'}); + } + } }); - } - if (s.verify_css_classes) { - t.serializer.attribValueFilter = function(n, v) { - var s, cl; + // Init when que is loaded + sl.loadQueue(function() { + if (!t.removed) + t.init(); + }); + }; - if (n == 'class') { - // Build regexp for classes - if (!t.classesRE) { - cl = t.dom.getClasses(); + loadScripts(); + }, - if (cl.length > 0) { - s = ''; + init : function() { + var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = []; - each (cl, function(o) { - s += (s ? '|' : '') + o['class']; - }); + tinymce.add(t); - t.classesRE = new RegExp('(' + s + ')', 'gi'); - } - } + s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); - return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; - } + if (s.theme) { + s.theme = s.theme.replace(/-/, ''); + o = ThemeManager.get(s.theme); + t.theme = new o(); - return v; - }; + if (t.theme.init && s.init_theme) + t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); } + function initPlugin(p) { + var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; + if (c && tinymce.inArray(initializedPlugins,p) === -1) { + each(PluginManager.dependencies(p), function(dep){ + initPlugin(dep); + }); + po = new c(t, u); - if (s.cleanup_callback) { - t.onBeforeSetContent.add(function(ed, o) { - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - }); + t.plugins[p] = po; - t.onPreProcess.add(function(ed, o) { - if (o.set) - t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); + if (po.init) { + po.init(t, u); + initializedPlugins.push(p); + } + } + } + + // Create all plugins + each(explode(s.plugins.replace(/\-/g, '')), initPlugin); - if (o.get) - t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); - }); + // Setup popup CSS path(s) + if (s.popup_css !== false) { + if (s.popup_css) + s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); + else + s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); + } - t.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + if (s.popup_css_add) + s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); - if (o.get) - o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); - }); - } + t.controlManager = new tinymce.ControlManager(t); - if (s.save_callback) { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); + if (s.custom_undo_redo) { + t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) { + if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) + t.undoManager.beforeChange(); }); - } - if (s.handle_event_callback) { - t.onEvent.add(function(ed, e, o) { - if (t.execCallback('handle_event_callback', e, ed, o) === false) - Event.cancel(e); + t.onExecCommand.add(function(ed, cmd, ui, val, a) { + if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) + t.undoManager.add(); }); } - // Add visual aids when new contents is added - t.onSetContent.add(function() { - t.addVisual(t.getBody()); + t.onExecCommand.add(function(ed, c) { + // Don't refresh the select lists until caret move + if (!/^(FontName|FontSize)$/.test(c)) + t.nodeChanged(); }); - // Remove empty contents - if (s.padd_empty_editor) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                [\r\n]*)$/, ''); - }); + // Remove ghost selections on images and tables in Gecko + if (isGecko) { + function repaint(a, o) { + if (!o || !o.initial) + t.execCommand('mceRepaint'); + }; + + t.onUndo.add(repaint); + t.onRedo.add(repaint); + t.onSetContent.add(repaint); } - if (isGecko) { - // Fix gecko link bug, when a link is placed at the end of block elements there is - // no way to move the caret behind the link. This fix adds a bogus br element after the link - function fixLinks(ed, o) { - each(ed.dom.select('a'), function(n) { - var pn = n.parentNode; + // Enables users to override the control factory + t.onBeforeRenderUI.dispatch(t, t.controlManager); - if (ed.dom.isBlock(pn) && pn.lastChild === n) - ed.dom.add(pn, 'br', {'_mce_bogus' : 1}); - }); - }; + // Measure box + if (s.render_ui) { + w = s.width || e.style.width || e.offsetWidth; + h = s.height || e.style.height || e.offsetHeight; + t.orgDisplay = e.style.display; + re = /^[0-9\.]+(|px)$/i; - t.onExecCommand.add(function(ed, cmd) { - if (cmd === 'CreateLink') - fixLinks(ed); + if (re.test('' + w)) + w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); + + if (re.test('' + h)) + h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); + + // Render UI + o = t.theme.renderUI({ + targetNode : e, + width : w, + height : h, + deltaWidth : s.delta_width, + deltaHeight : s.delta_height }); - t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); + t.editorContainer = o.editorContainer; + } + + + // User specified a document.domain value + if (document.domain && location.hostname != document.domain) + tinymce.relaxedDomain = document.domain; + + // Resize editor + DOM.setStyles(o.sizeContainer || o.editorContainer, { + width : w, + height : h + }); - if (!s.readonly) { - try { - // Design mode must be set here once again to fix a bug where - // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again - d.designMode = 'Off'; - d.designMode = 'On'; - } catch (ex) { - // Will fail on Gecko if the editor is placed in an hidden container element - // The design mode will be set ones the editor is focused - } - } + // Load specified content CSS last + if (s.content_css) { + tinymce.each(explode(s.content_css), function(u) { + t.contentCSS.push(t.documentBaseURI.toAbsolute(u)); + }); } - // A small timeout was needed since firefox will remove. Bug: #1838304 - setTimeout(function () { - if (t.removed) - return; - - t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); - t.startContent = t.getContent({format : 'raw'}); - t.initialized = true; + h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); + if (h < 100) + h = 100; - t.onInit.dispatch(t); - t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); - t.execCallback('init_instance_callback', t); - t.focus(true); - t.nodeChanged({initial : 1}); + t.iframeHTML = s.doctype + ''; - // Load specified content CSS last - if (s.content_css) { - tinymce.each(explode(s.content_css), function(u) { - t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); - }); - } + // We only need to override paths if we have to + // IE has a bug where it remove site absolute urls to relative ones if this is specified + if (s.document_base_url != tinymce.documentBaseURL) + t.iframeHTML += ''; - // Handle auto focus - if (s.auto_focus) { - setTimeout(function () { - var ed = tinymce.get(s.auto_focus); + // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. + if (s.ie7_compat) + t.iframeHTML += ''; + else + t.iframeHTML += ''; - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getWin().focus(); - }, 100); - } - }, 1); - - e = null; - }, + t.iframeHTML += ''; + // Load the CSS by injecting them into the HTML this will reduce "flicker" + for (i = 0; i < t.contentCSS.length; i++) { + t.iframeHTML += ''; + } - focus : function(sf) { - var oed, t = this, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); + t.contentCSS = []; - if (!sf) { - // Get selected control element - ieRng = t.selection.getRng(); - if (ieRng.item) { - controlElm = ieRng.item(0); - } + bi = s.body_id || 'tinymce'; + if (bi.indexOf('=') != -1) { + bi = t.getParam('body_id', '', 'hash'); + bi = bi[t.id] || bi; + } - // Is not content editable - if (!ce) - t.getWin().focus(); + bc = s.body_class || ''; + if (bc.indexOf('=') != -1) { + bc = t.getParam('body_class', '', 'hash'); + bc = bc[t.id] || ''; + } - // Restore selected control element - // This is needed when for example an image is selected within a - // layer a call to focus will then remove the control selection - if (controlElm && controlElm.ownerDocument == doc) { - ieRng = doc.body.createControlRange(); - ieRng.addElement(controlElm); - ieRng.select(); - } + t.iframeHTML += '
                '; + // Domain relaxing enabled, then set document domain + if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { + // We need to write the contents here in IE since multiple writes messes up refresh button and back button + u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; } - if (tinymce.activeEditor != t) { - if ((oed = tinymce.activeEditor) != null) - oed.onDeactivate.dispatch(oed, t); + // Create iframe + // TODO: ACC add the appropriate description on this. + n = DOM.add(o.iframeContainer, 'iframe', { + id : t.id + "_ifr", + src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 + frameBorder : '0', + allowTransparency : "true", + title : s.aria_label, + style : { + width : '100%', + height : h, + display : 'block' // Important for Gecko to render the iframe correctly + } + }); - t.onActivate.dispatch(t, oed); - } + t.contentAreaContainer = o.iframeContainer; + DOM.get(o.editorContainer).style.display = t.orgDisplay; + DOM.get(t.id).style.display = 'none'; + DOM.setAttrib(t.id, 'aria-hidden', true); - tinymce._setActive(t); + if (!tinymce.relaxedDomain || !u) + t.setupIframe(); + + e = n = o = null; // Cleanup }, - execCallback : function(n) { - var t = this, f = t.settings[n], s; + setupIframe : function() { + var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; - if (!f) - return; + // Setup iframe body + if (!isIE || !tinymce.relaxedDomain) { + d.open(); + d.write(t.iframeHTML); + d.close(); - // Look through lookup - if (t.callbackLookup && (s = t.callbackLookup[n])) { - f = s.func; - s = s.scope; + if (tinymce.relaxedDomain) + d.domain = tinymce.relaxedDomain; } - if (is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - t.callbackLookup = t.callbackLookup || {}; - t.callbackLookup[n] = {func : f, scope : s}; - } + // It will not steal focus while setting contentEditable + b = t.getBody(); + b.disabled = true; - return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); - }, + if (!s.readonly) + b.contentEditable = true; - translate : function(s) { - var c = this.settings.language || 'en', i18n = tinymce.i18n; + b.disabled = false; - if (!s) - return ''; + t.schema = new tinymce.html.Schema(s); - return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { - return i18n[c + '.' + b] || '{#' + b + '}'; + t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { + keep_values : true, + url_converter : t.convertURL, + url_converter_scope : t, + hex_colors : s.force_hex_style_colors, + class_filter : s.class_filter, + update_styles : 1, + fix_ie_paragraphs : 1, + schema : t.schema }); - }, - getLang : function(n, dv) { - return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); - }, + t.parser = new tinymce.html.DomParser(s, t.schema); - getParam : function(n, dv, ty) { - var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; + // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. + if (!t.settings.allow_html_in_named_anchor) { + t.parser.addAttributeFilter('name', function(nodes, name) { + var i = nodes.length, sibling, prevSibling, parent, node; + + while (i--) { + node = nodes[i]; + if (node.name === 'a' && node.firstChild) { + parent = node.parent; + + // Move children after current node + sibling = node.lastChild; + do { + prevSibling = sibling.prev; + parent.insert(sibling, node); + sibling = prevSibling; + } while (sibling); + } + } + }); + } - if (ty === 'hash') { - o = {}; + // Convert src and href into data-mce-src, data-mce-href and data-mce-style + t.parser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, dom = t.dom, value, internalName; - if (is(v, 'string')) { - each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { - v = v.split('='); + while (i--) { + node = nodes[i]; + value = node.attr(name); + internalName = 'data-mce-' + name; - if (v.length > 1) - o[tr(v[0])] = tr(v[1]); + // Add internal attribute if we need to we don't on a refresh of the document + if (!node.attributes.map[internalName]) { + if (name === "style") + node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); else - o[tr(v[0])] = tr(v); - }); - } else - o = v; - - return o; - } + node.attr(internalName, t.convertURL(value, name, node.name)); + } + } + }); - return v; - }, + // Keep scripts from executing + t.parser.addNodeFilter('script', function(nodes, name) { + var i = nodes.length, node; - nodeChanged : function(o) { - var t = this, s = t.selection, n = (isIE ? s.getNode() : s.getStart()) || t.getBody(); + while (i--) { + node = nodes[i]; + node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); + } + }); - // Fix for bug #1896577 it seems that this can not be fired while the editor is loading - if (t.initialized) { - o = o || {}; - n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state + t.parser.addNodeFilter('#cdata', function(nodes, name) { + var i = nodes.length, node; - // Get parents and add them to object - o.parents = []; - t.dom.getParent(n, function(node) { - if (node.nodeName == 'BODY') - return true; + while (i--) { + node = nodes[i]; + node.type = 8; + node.name = '#comment'; + node.value = '[CDATA[' + node.value + ']]'; + } + }); - o.parents.push(node); - }); + t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { + var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); - t.onNodeChange.dispatch( - t, - o ? o.controlManager || t.controlManager : t.controlManager, - n, - s.isCollapsed(), - o - ); - } - }, + while (i--) { + node = nodes[i]; - addButton : function(n, s) { - var t = this; + if (node.isEmpty(nonEmptyElements)) + node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; + } + }); - t.buttons = t.buttons || {}; - t.buttons[n] = s; - }, + t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); - addCommand : function(n, f, s) { - this.execCommands[n] = {func : f, scope : s || this}; - }, + t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); - addQueryStateHandler : function(n, f, s) { - this.queryStateCommands[n] = {func : f, scope : s || this}; - }, + t.formatter = new tinymce.Formatter(this); - addQueryValueHandler : function(n, f, s) { - this.queryValueCommands[n] = {func : f, scope : s || this}; - }, + // Register default formats + t.formatter.register({ + alignleft : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}, defaultBlock: 'div'}, + {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} + ], - addShortcut : function(pa, desc, cmd_func, sc) { - var t = this, c; + aligncenter : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}, defaultBlock: 'div'}, + {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, + {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} + ], - if (!t.settings.custom_shortcuts) - return false; + alignright : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}, defaultBlock: 'div'}, + {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} + ], - t.shortcuts = t.shortcuts || {}; + alignfull : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}, defaultBlock: 'div'} + ], - if (is(cmd_func, 'string')) { - c = cmd_func; + bold : [ + {inline : 'strong', remove : 'all'}, + {inline : 'span', styles : {fontWeight : 'bold'}}, + {inline : 'b', remove : 'all'} + ], - cmd_func = function() { - t.execCommand(c, false, null); - }; - } + italic : [ + {inline : 'em', remove : 'all'}, + {inline : 'span', styles : {fontStyle : 'italic'}}, + {inline : 'i', remove : 'all'} + ], - if (is(cmd_func, 'object')) { - c = cmd_func; + underline : [ + {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, + {inline : 'u', remove : 'all'} + ], - cmd_func = function() { - t.execCommand(c[0], c[1], c[2]); - }; - } + strikethrough : [ + {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, + {inline : 'strike', remove : 'all'} + ], - each(explode(pa), function(pa) { - var o = { - func : cmd_func, - scope : sc || this, - desc : desc, - alt : false, - ctrl : false, - shift : false - }; + forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, + hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, + fontname : {inline : 'span', styles : {fontFamily : '%value'}}, + fontsize : {inline : 'span', styles : {fontSize : '%value'}}, + fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, + blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, + subscript : {inline : 'sub'}, + superscript : {inline : 'sup'}, - each(explode(pa, '+'), function(v) { - switch (v) { - case 'alt': - case 'ctrl': - case 'shift': - o[v] = true; - break; + link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, + onmatch : function(node) { + return true; + }, - default: - o.charCode = v.charCodeAt(0); - o.keyCode = v.toUpperCase().charCodeAt(0); + onformat : function(elm, fmt, vars) { + each(vars, function(value, key) { + t.dom.setAttrib(elm, key, value); + }); } - }); + }, + + removeformat : [ + {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, + {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, + {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} + ] + }); - t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; + // Register default block formats + each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) { + t.formatter.register(name, {block : name, remove : 'all'}); }); - return true; - }, + // Register user defined formats + t.formatter.register(t.settings.formats); - execCommand : function(cmd, ui, val, a) { - var t = this, s = 0, o, st; + t.undoManager = new tinymce.UndoManager(t); - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) - t.focus(); + // Pass through + t.undoManager.onAdd.add(function(um, l) { + if (um.hasUndo()) + return t.onChange.dispatch(t, l, um); + }); - o = {}; - t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o); - if (o.terminate) - return false; + t.undoManager.onUndo.add(function(um, l) { + return t.onUndo.dispatch(t, l, um); + }); - // Command callback - if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } + t.undoManager.onRedo.add(function(um, l) { + return t.onRedo.dispatch(t, l, um); + }); - // Registred commands - if (o = t.execCommands[cmd]) { - st = o.func.call(o.scope, ui, val); + t.forceBlocks = new tinymce.ForceBlocks(t); + t.enterKey = new tinymce.EnterKey(t); - // Fall through on true - if (st !== true) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return st; - } - } + t.editorCommands = new tinymce.EditorCommands(t); - // Plugin commands - each(t.plugins, function(p) { - if (p.execCommand && p.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - s = 1; - return false; - } + // Pass through + t.serializer.onPreProcess.add(function(se, o) { + return t.onPreProcess.dispatch(t, o, se); }); - if (s) - return true; + t.serializer.onPostProcess.add(function(se, o) { + return t.onPostProcess.dispatch(t, o, se); + }); - // Theme commands - if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } + t.onPreInit.dispatch(t); - // Execute global commands - if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } + if (!s.gecko_spellcheck) + t.getBody().spellcheck = 0; - // Editor commands - if (t.editorCommands.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } + if (!s.readonly) + t._addEvents(); - // Browser commands - t.getDoc().execCommand(cmd, ui, val); - t.onExecCommand.dispatch(t, cmd, ui, val, a); - }, + t.controlManager.onPostRender.dispatch(t, t.controlManager); + t.onPostRender.dispatch(t); - queryCommandState : function(cmd) { - var t = this, o, s; + t.quirks = new tinymce.util.Quirks(this); - // Is hidden then return undefined - if (t._isHidden()) - return; + if (s.directionality) + t.getBody().dir = s.directionality; - // Registred commands - if (o = t.queryStateCommands[cmd]) { - s = o.func.call(o.scope); + if (s.nowrap) + t.getBody().style.whiteSpace = "nowrap"; - // Fall though on true - if (s !== true) - return s; + if (s.handle_node_change_callback) { + t.onNodeChange.add(function(ed, cm, n) { + t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); + }); } - // Registred commands - o = t.editorCommands.queryCommandState(cmd); - if (o !== -1) - return o; + if (s.save_callback) { + t.onSaveContent.add(function(ed, o) { + var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); - // Browser commands - try { - return this.getDoc().queryCommandState(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 + if (h) + o.content = h; + }); } - }, - queryCommandValue : function(c) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; + if (s.onchange_callback) { + t.onChange.add(function(ed, l) { + t.execCallback('onchange_callback', t, l); + }); + } - // Registred commands - if (o = t.queryValueCommands[c]) { - s = o.func.call(o.scope); + if (s.protect) { + t.onBeforeSetContent.add(function(ed, o) { + if (s.protect) { + each(s.protect, function(pattern) { + o.content = o.content.replace(pattern, function(str) { + return ''; + }); + }); + } + }); + } - // Fall though on true - if (s !== true) - return s; + if (s.convert_newlines_to_brs) { + t.onBeforeSetContent.add(function(ed, o) { + if (o.initial) + o.content = o.content.replace(/\r?\n/g, '
                '); + }); } - // Registred commands - o = t.editorCommands.queryCommandValue(c); - if (is(o)) - return o; + if (s.preformatted) { + t.onPostProcess.add(function(ed, o) { + o.content = o.content.replace(/^\s*/, ''); + o.content = o.content.replace(/<\/pre>\s*$/, ''); - // Browser commands - try { - return this.getDoc().queryCommandValue(c); - } catch (ex) { - // Fails sometimes see bug: 1896577 + if (o.set) + o.content = '
                ' + o.content + '
                '; + }); } - }, - show : function() { - var t = this; + if (s.verify_css_classes) { + t.serializer.attribValueFilter = function(n, v) { + var s, cl; - DOM.show(t.getContainer()); - DOM.hide(t.id); - t.load(); - }, + if (n == 'class') { + // Build regexp for classes + if (!t.classesRE) { + cl = t.dom.getClasses(); - hide : function() { - var t = this, d = t.getDoc(); + if (cl.length > 0) { + s = ''; - // Fixed bug where IE has a blinking cursor left from the editor - if (isIE && d) - d.execCommand('SelectAll'); + each (cl, function(o) { + s += (s ? '|' : '') + o['class']; + }); - // We must save before we hide so Safari doesn't crash - t.save(); - DOM.hide(t.getContainer()); - DOM.setStyle(t.id, 'display', t.orgDisplay); - }, + t.classesRE = new RegExp('(' + s + ')', 'gi'); + } + } - isHidden : function() { - return !DOM.isHidden(this.id); - }, + return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; + } - setProgressState : function(b, ti, o) { - this.onSetProgressState.dispatch(this, b, ti, o); + return v; + }; + } - return b; - }, + if (s.cleanup_callback) { + t.onBeforeSetContent.add(function(ed, o) { + o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + }); - load : function(o) { - var t = this, e = t.getElement(), h; + t.onPreProcess.add(function(ed, o) { + if (o.set) + t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); - if (e) { - o = o || {}; - o.load = true; + if (o.get) + t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); + }); - // Double encode existing entities in the value - h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); - o.element = e; + t.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + + if (o.get) + o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); + }); + } + + if (s.save_callback) { + t.onGetContent.add(function(ed, o) { + if (o.save) + o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); + }); + } + + if (s.handle_event_callback) { + t.onEvent.add(function(ed, e, o) { + if (t.execCallback('handle_event_callback', e, ed, o) === false) + Event.cancel(e); + }); + } + + // Add visual aids when new contents is added + t.onSetContent.add(function() { + t.addVisual(t.getBody()); + }); + + // Remove empty contents + if (s.padd_empty_editor) { + t.onPostProcess.add(function(ed, o) { + o.content = o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                [\r\n]*)$/, ''); + }); + } - if (!o.no_events) - t.onLoadContent.dispatch(t, o); + if (isGecko) { + // Fix gecko link bug, when a link is placed at the end of block elements there is + // no way to move the caret behind the link. This fix adds a bogus br element after the link + function fixLinks(ed, o) { + each(ed.dom.select('a'), function(n) { + var pn = n.parentNode; - o.element = e = null; + if (ed.dom.isBlock(pn) && pn.lastChild === n) + ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); + }); + }; - return h; + t.onExecCommand.add(function(ed, cmd) { + if (cmd === 'CreateLink') + fixLinks(ed); + }); + + t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); } - }, - save : function(o) { - var t = this, e = t.getElement(), h, f; + t.load({initial : true, format : 'html'}); + t.startContent = t.getContent({format : 'raw'}); + t.undoManager.add(); + t.initialized = true; - if (!e || !t.initialized) - return; + t.onInit.dispatch(t); + t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); + t.execCallback('init_instance_callback', t); + t.focus(true); + t.nodeChanged({initial : 1}); - o = o || {}; - o.save = true; + // Load specified content CSS last + each(t.contentCSS, function(u) { + t.dom.loadCSS(u); + }); - // Add undo level will trigger onchange event - if (!o.no_events) { - t.undoManager.typing = 0; - t.undoManager.add(); - } + // Handle auto focus + if (s.auto_focus) { + setTimeout(function () { + var ed = tinymce.get(s.auto_focus); - o.element = e; - h = o.content = t.getContent(o); + ed.selection.select(ed.getBody(), 1); + ed.selection.collapse(1); + ed.getBody().focus(); + ed.getWin().focus(); + }, 100); + } - if (!o.no_events) - t.onSaveContent.dispatch(t, o); + e = null; + }, - h = o.content; - if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { - e.innerHTML = h; + focus : function(sf) { + var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); - // Update hidden form element - if (f = DOM.getParent(t.id, 'form')) { - each(f.elements, function(e) { - if (e.name == t.id) { - e.value = h; - return false; - } - }); + if (!sf) { + // Get selected control element + ieRng = selection.getRng(); + if (ieRng.item) { + controlElm = ieRng.item(0); } - } else - e.value = h; - o.element = e = null; - - return h; - }, + t._refreshContentEditable(); - setContent : function(h, o) { - var t = this; + // Is not content editable + if (!ce) + t.getWin().focus(); - o = o || {}; - o.format = o.format || 'html'; - o.set = true; - o.content = h; + // Focus the body as well since it's contentEditable + if (tinymce.isGecko) { + t.getBody().focus(); + } - if (!o.no_events) - t.onBeforeSetContent.dispatch(t, o); + // Restore selected control element + // This is needed when for example an image is selected within a + // layer a call to focus will then remove the control selection + if (controlElm && controlElm.ownerDocument == doc) { + ieRng = doc.body.createControlRange(); + ieRng.addElement(controlElm); + ieRng.select(); + } - // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content - // It will also be impossible to place the caret in the editor unless there is a BR element present - if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) { - o.content = t.dom.setHTML(t.getBody(), '
                '); - o.format = 'raw'; } - o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content)); + if (tinymce.activeEditor != t) { + if ((oed = tinymce.activeEditor) != null) + oed.onDeactivate.dispatch(oed, t); - if (o.format != 'raw' && t.settings.cleanup) { - o.getInner = true; - o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o)); + t.onActivate.dispatch(t, oed); } - if (!o.no_events) - t.onSetContent.dispatch(t, o); - - return o.content; + tinymce._setActive(t); }, - getContent : function(o) { - var t = this, h; + execCallback : function(n) { + var t = this, f = t.settings[n], s; - o = o || {}; - o.format = o.format || 'html'; - o.get = true; + if (!f) + return; - if (!o.no_events) - t.onBeforeGetContent.dispatch(t, o); + // Look through lookup + if (t.callbackLookup && (s = t.callbackLookup[n])) { + f = s.func; + s = s.scope; + } - if (o.format != 'raw' && t.settings.cleanup) { - o.getInner = true; - h = t.serializer.serialize(t.getBody(), o); - } else - h = t.getBody().innerHTML; + if (is(f, 'string')) { + s = f.replace(/\.\w+$/, ''); + s = s ? tinymce.resolve(s) : 0; + f = tinymce.resolve(f); + t.callbackLookup = t.callbackLookup || {}; + t.callbackLookup[n] = {func : f, scope : s}; + } - h = h.replace(/^\s*|\s*$/g, ''); - o.content = h; + return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); + }, - if (!o.no_events) - t.onGetContent.dispatch(t, o); + translate : function(s) { + var c = this.settings.language || 'en', i18n = tinymce.i18n; - return o.content; - }, + if (!s) + return ''; - isDirty : function() { - var t = this; + return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { + return i18n[c + '.' + b] || '{#' + b + '}'; + }); + }, - return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty; + getLang : function(n, dv) { + return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); }, - getContainer : function() { - var t = this; + getParam : function(n, dv, ty) { + var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; - if (!t.container) - t.container = DOM.get(t.editorContainer || t.id + '_parent'); + if (ty === 'hash') { + o = {}; - return t.container; - }, + if (is(v, 'string')) { + each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { + v = v.split('='); - getContentAreaContainer : function() { - return this.contentAreaContainer; - }, + if (v.length > 1) + o[tr(v[0])] = tr(v[1]); + else + o[tr(v[0])] = tr(v); + }); + } else + o = v; - getElement : function() { - return DOM.get(this.settings.content_element || this.id); + return o; + } + + return v; }, - getWin : function() { - var t = this, e; + nodeChanged : function(o) { + var t = this, s = t.selection, n = s.getStart() || t.getBody(); - if (!t.contentWindow) { - e = DOM.get(t.id + "_ifr"); + // Fix for bug #1896577 it seems that this can not be fired while the editor is loading + if (t.initialized) { + o = o || {}; + n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state - if (e) - t.contentWindow = e.contentWindow; - } + // Get parents and add them to object + o.parents = []; + t.dom.getParent(n, function(node) { + if (node.nodeName == 'BODY') + return true; - return t.contentWindow; + o.parents.push(node); + }); + + t.onNodeChange.dispatch( + t, + o ? o.controlManager || t.controlManager : t.controlManager, + n, + s.isCollapsed(), + o + ); + } }, - getDoc : function() { - var t = this, w; + addButton : function(n, s) { + var t = this; - if (!t.contentDocument) { - w = t.getWin(); + t.buttons = t.buttons || {}; + t.buttons[n] = s; + }, - if (w) - t.contentDocument = w.document; - } + addCommand : function(name, callback, scope) { + this.execCommands[name] = {func : callback, scope : scope || this}; + }, - return t.contentDocument; + addQueryStateHandler : function(name, callback, scope) { + this.queryStateCommands[name] = {func : callback, scope : scope || this}; }, - getBody : function() { - return this.bodyElement || this.getDoc().body; + addQueryValueHandler : function(name, callback, scope) { + this.queryValueCommands[name] = {func : callback, scope : scope || this}; }, - convertURL : function(u, n, e) { - var t = this, s = t.settings; + addShortcut : function(pa, desc, cmd_func, sc) { + var t = this, c; - // Use callback instead - if (s.urlconverter_callback) - return t.execCallback('urlconverter_callback', u, e, true, n); + if (!t.settings.custom_shortcuts) + return false; - // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs - if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) - return u; + t.shortcuts = t.shortcuts || {}; - // Convert to relative - if (s.relative_urls) - return t.documentBaseURI.toRelative(u); + if (is(cmd_func, 'string')) { + c = cmd_func; - // Convert to absolute - u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); + cmd_func = function() { + t.execCommand(c, false, null); + }; + } - return u; - }, + if (is(cmd_func, 'object')) { + c = cmd_func; - addVisual : function(e) { - var t = this, s = t.settings; + cmd_func = function() { + t.execCommand(c[0], c[1], c[2]); + }; + } - e = e || t.getBody(); + each(explode(pa), function(pa) { + var o = { + func : cmd_func, + scope : sc || this, + desc : desc, + alt : false, + ctrl : false, + shift : false + }; - if (!is(t.hasVisual)) - t.hasVisual = s.visual; + each(explode(pa, '+'), function(v) { + switch (v) { + case 'alt': + case 'ctrl': + case 'shift': + o[v] = true; + break; + + default: + o.charCode = v.charCodeAt(0); + o.keyCode = v.toUpperCase().charCodeAt(0); + } + }); + + t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; + }); - each(t.dom.select('table,a', e), function(e) { - var v; + return true; + }, - switch (e.nodeName) { - case 'TABLE': - v = t.dom.getAttrib(e, 'border'); + execCommand : function(cmd, ui, val, a) { + var t = this, s = 0, o, st; - if (!v || v == '0') { - if (t.hasVisual) - t.dom.addClass(e, s.visual_table_class); - else - t.dom.removeClass(e, s.visual_table_class); - } + if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) + t.focus(); - return; + a = extend({}, a); + t.onBeforeExecCommand.dispatch(t, cmd, ui, val, a); + if (a.terminate) + return false; - case 'A': - v = t.dom.getAttrib(e, 'name'); + // Command callback + if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } - if (v) { - if (t.hasVisual) - t.dom.addClass(e, 'mceItemAnchor'); - else - t.dom.removeClass(e, 'mceItemAnchor'); - } + // Registred commands + if (o = t.execCommands[cmd]) { + st = o.func.call(o.scope, ui, val); - return; + // Fall through on true + if (st !== true) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return st; } - }); - - t.onVisualAid.dispatch(t, e, t.hasVisual); - }, + } - remove : function() { - var t = this, e = t.getContainer(); + // Plugin commands + each(t.plugins, function(p) { + if (p.execCommand && p.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + s = 1; + return false; + } + }); - t.removed = 1; // Cancels post remove event execution - t.hide(); + if (s) + return true; - t.execCallback('remove_instance_callback', t); - t.onRemove.dispatch(t); + // Theme commands + if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } - // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command - t.onExecCommand.listeners = []; + // Editor commands + if (t.editorCommands.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } - tinymce.remove(t); - DOM.remove(e); + // Browser commands + t.getDoc().execCommand(cmd, ui, val); + t.onExecCommand.dispatch(t, cmd, ui, val, a); }, - destroy : function(s) { - var t = this; + queryCommandState : function(cmd) { + var t = this, o, s; - // One time is enough - if (t.destroyed) + // Is hidden then return undefined + if (t._isHidden()) return; - if (!s) { - tinymce.removeUnload(t.destroy); - tinyMCE.onBeforeUnload.remove(t._beforeUnload); + // Registred commands + if (o = t.queryStateCommands[cmd]) { + s = o.func.call(o.scope); - // Manual destroy - if (t.theme && t.theme.destroy) - t.theme.destroy(); + // Fall though on true + if (s !== true) + return s; + } - // Destroy controls, selection and dom - t.controlManager.destroy(); - t.selection.destroy(); - t.dom.destroy(); + // Registred commands + o = t.editorCommands.queryCommandState(cmd); + if (o !== -1) + return o; - // Remove all events + // Browser commands + try { + return this.getDoc().queryCommandState(cmd); + } catch (ex) { + // Fails sometimes see bug: 1896577 + } + }, - // Don't clear the window or document if content editable - // is enabled since other instances might still be present - if (!t.settings.content_editable) { - Event.clear(t.getWin()); - Event.clear(t.getDoc()); - } + queryCommandValue : function(c) { + var t = this, o, s; - Event.clear(t.getBody()); - Event.clear(t.formElement); - } + // Is hidden then return undefined + if (t._isHidden()) + return; - if (t.formElement) { - t.formElement.submit = t.formElement._mceOldSubmit; - t.formElement._mceOldSubmit = null; + // Registred commands + if (o = t.queryValueCommands[c]) { + s = o.func.call(o.scope); + + // Fall though on true + if (s !== true) + return s; } - t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; + // Registred commands + o = t.editorCommands.queryCommandValue(c); + if (is(o)) + return o; - if (t.selection) - t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; + // Browser commands + try { + return this.getDoc().queryCommandValue(c); + } catch (ex) { + // Fails sometimes see bug: 1896577 + } + }, - t.destroyed = 1; + show : function() { + var t = this; + + DOM.show(t.getContainer()); + DOM.hide(t.id); + t.load(); }, - // Internal functions + hide : function() { + var t = this, d = t.getDoc(); - _addEvents : function() { - // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset - var t = this, i, s = t.settings, lo = { - mouseup : 'onMouseUp', - mousedown : 'onMouseDown', - click : 'onClick', - keyup : 'onKeyUp', - keydown : 'onKeyDown', - keypress : 'onKeyPress', - submit : 'onSubmit', - reset : 'onReset', - contextmenu : 'onContextMenu', - dblclick : 'onDblClick', - paste : 'onPaste' // Doesn't work in all browsers yet - }; + // Fixed bug where IE has a blinking cursor left from the editor + if (isIE && d) + d.execCommand('SelectAll'); - function eventHandler(e, o) { - var ty = e.type; + // We must save before we hide so Safari doesn't crash + t.save(); + DOM.hide(t.getContainer()); + DOM.setStyle(t.id, 'display', t.orgDisplay); + }, - // Don't fire events when it's removed - if (t.removed) - return; + isHidden : function() { + return !DOM.isHidden(this.id); + }, - // Generic event handler - if (t.onEvent.dispatch(t, e, o) !== false) { - // Specific event handler - t[lo[e.fakeType || e.type]].dispatch(t, e, o); - } - }; + setProgressState : function(b, ti, o) { + this.onSetProgressState.dispatch(this, b, ti, o); - // Add DOM events - each(lo, function(v, k) { - switch (k) { - case 'contextmenu': - if (tinymce.isOpera) { - // Fake contextmenu on Opera - t.dom.bind(t.getBody(), 'mousedown', function(e) { - if (e.ctrlKey) { - e.fakeType = 'contextmenu'; - eventHandler(e); - } - }); - } else - t.dom.bind(t.getBody(), k, eventHandler); - break; + return b; + }, - case 'paste': - t.dom.bind(t.getBody(), k, function(e) { - eventHandler(e); - }); - break; + load : function(o) { + var t = this, e = t.getElement(), h; - case 'submit': - case 'reset': - t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); - break; + if (e) { + o = o || {}; + o.load = true; - default: - t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); - } - }); + // Double encode existing entities in the value + h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); + o.element = e; - t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { - t.focus(true); - }); + if (!o.no_events) + t.onLoadContent.dispatch(t, o); + o.element = e = null; - // Fixes bug where a specified document_base_uri could result in broken images - // This will also fix drag drop of images in Gecko - if (tinymce.isGecko) { - // Convert all images to absolute URLs -/* t.onSetContent.add(function(ed, o) { - each(ed.dom.select('img'), function(e) { - var v; + return h; + } + }, - if (v = e.getAttribute('_mce_src')) - e.src = t.documentBaseURI.toAbsolute(v); - }) - });*/ + save : function(o) { + var t = this, e = t.getElement(), h, f; - t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { - var v; + if (!e || !t.initialized) + return; - e = e.target; + o = o || {}; + o.save = true; - if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('_mce_src'))) - e.src = t.documentBaseURI.toAbsolute(v); - }); + // Add undo level will trigger onchange event + if (!o.no_events) { + t.undoManager.typing = false; + t.undoManager.add(); } - // Set various midas options in Gecko - if (isGecko) { - function setOpts() { - var t = this, d = t.getDoc(), s = t.settings; + o.element = e; + h = o.content = t.getContent(o); + + if (!o.no_events) + t.onSaveContent.dispatch(t, o); + + h = o.content; - if (isGecko && !s.readonly) { - if (t._isHidden()) { - try { - if (!s.content_editable) - d.designMode = 'On'; - } catch (ex) { - // Fails if it's hidden - } - } + if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { + e.innerHTML = h; - try { - // Try new Gecko method - d.execCommand("styleWithCSS", 0, false); - } catch (ex) { - // Use old method - if (!t._isHidden()) - try {d.execCommand("useCSS", 0, true);} catch (ex) {} + // Update hidden form element + if (f = DOM.getParent(t.id, 'form')) { + each(f.elements, function(e) { + if (e.name == t.id) { + e.value = h; + return false; } + }); + } + } else + e.value = h; - if (!s.table_inline_editing) - try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} + o.element = e = null; - if (!s.object_resizing) - try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} - } - }; + return h; + }, - t.onBeforeExecCommand.add(setOpts); - t.onMouseDown.add(setOpts); - } + setContent : function(content, args) { + var self = this, rootNode, body = self.getBody(), forcedRootBlockName; - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - // WebKit can't even do simple things like selecting an image - // This also fixes so it's possible to select mceItemAnchors - if (tinymce.isWebKit) { - t.onClick.add(function(ed, e) { - e = e.target; + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.set = true; + args.content = content; - // Needs tobe the setBaseAndExtend or it will fail to select floated images - if (e.nodeName == 'IMG' || (e.nodeName == 'A' && t.dom.hasClass(e, 'mceItemAnchor'))) - t.selection.getSel().setBaseAndExtent(e, 0, e, 1); - }); - } + // Do preprocessing + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); - // Add node change handlers - t.onMouseUp.add(t.nodeChanged); - //t.onClick.add(t.nodeChanged); - t.onKeyUp.add(function(ed, e) { - var c = e.keyCode; + content = args.content; - if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) - t.nodeChanged(); - }); + // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content + // It will also be impossible to place the caret in the editor unless there is a BR element present + if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { + forcedRootBlockName = self.settings.forced_root_block; + if (forcedRootBlockName) + content = '<' + forcedRootBlockName + '>
                '; + else + content = '
                '; - // Add reset handler - t.onReset.add(function() { - t.setContent(t.startContent, {format : 'raw'}); - }); + body.innerHTML = content; + self.selection.select(body, true); + self.selection.collapse(true); + return; + } - // Add shortcuts - if (s.custom_shortcuts) { - if (s.custom_undo_redo_keyboard_shortcuts) { - t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); - t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); - } + // Parse and serialize the html + if (args.format !== 'raw') { + content = new tinymce.html.Serializer({}, self.schema).serialize( + self.parser.parse(content) + ); + } - // Add default shortcuts for gecko - t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); - t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); - t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); + // Set the new cleaned contents to the editor + args.content = tinymce.trim(content); + self.dom.setHTML(body, args.content); - // BlockFormat shortcuts keys - for (i=1; i<=6; i++) - t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); + // Do post processing + if (!args.no_events) + self.onSetContent.dispatch(self, args); - t.addShortcut('ctrl+7', '', ['FormatBlock', false, '

                ']); - t.addShortcut('ctrl+8', '', ['FormatBlock', false, '

                ']); - t.addShortcut('ctrl+9', '', ['FormatBlock', false, '
                ']); + self.selection.normalize(); - function find(e) { - var v = null; + return args.content; + }, - if (!e.altKey && !e.ctrlKey && !e.metaKey) - return v; + getContent : function(args) { + var self = this, content; - each(t.shortcuts, function(o) { - if (tinymce.isMac && o.ctrl != e.metaKey) - return; - else if (!tinymce.isMac && o.ctrl != e.ctrlKey) - return; + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.get = true; - if (o.alt != e.altKey) - return; + // Do preprocessing + if (!args.no_events) + self.onBeforeGetContent.dispatch(self, args); - if (o.shift != e.shiftKey) - return; + // Get raw contents or by default the cleaned contents + if (args.format == 'raw') + content = self.getBody().innerHTML; + else + content = self.serializer.serialize(self.getBody(), args); - if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { - v = o; - return false; - } - }); + args.content = tinymce.trim(content); - return v; - }; + // Do post processing + if (!args.no_events) + self.onGetContent.dispatch(self, args); - t.onKeyUp.add(function(ed, e) { - var o = find(e); + return args.content; + }, - if (o) - return Event.cancel(e); - }); + isDirty : function() { + var self = this; - t.onKeyPress.add(function(ed, e) { - var o = find(e); + return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; + }, - if (o) - return Event.cancel(e); - }); + getContainer : function() { + var t = this; - t.onKeyDown.add(function(ed, e) { - var o = find(e); + if (!t.container) + t.container = DOM.get(t.editorContainer || t.id + '_parent'); - if (o) { - o.func.call(o.scope); - return Event.cancel(e); - } - }); - } + return t.container; + }, - if (tinymce.isIE) { - // Fix so resize will only update the width and height attributes not the styles of an image - // It will also block mceItemNoResize items - t.dom.bind(t.getDoc(), 'controlselect', function(e) { - var re = t.resizeInfo, cb; + getContentAreaContainer : function() { + return this.contentAreaContainer; + }, - e = e.target; + getElement : function() { + return DOM.get(this.settings.content_element || this.id); + }, - // Don't do this action for non image elements - if (e.nodeName !== 'IMG') - return; + getWin : function() { + var t = this, e; - if (re) - t.dom.unbind(re.node, re.ev, re.cb); + if (!t.contentWindow) { + e = DOM.get(t.id + "_ifr"); - if (!t.dom.hasClass(e, 'mceItemNoResize')) { - ev = 'resizeend'; - cb = t.dom.bind(e, ev, function(e) { - var v; + if (e) + t.contentWindow = e.contentWindow; + } - e = e.target; + return t.contentWindow; + }, - if (v = t.dom.getStyle(e, 'width')) { - t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); - t.dom.setStyle(e, 'width', ''); - } + getDoc : function() { + var t = this, w; - if (v = t.dom.getStyle(e, 'height')) { - t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); - t.dom.setStyle(e, 'height', ''); - } - }); - } else { - ev = 'resizestart'; - cb = t.dom.bind(e, 'resizestart', Event.cancel, Event); - } + if (!t.contentDocument) { + w = t.getWin(); - re = t.resizeInfo = { - node : e, - ev : ev, - cb : cb - }; - }); + if (w) + t.contentDocument = w.document; + } - t.onKeyDown.add(function(ed, e) { - switch (e.keyCode) { - case 8: - // Fix IE control + backspace browser bug - if (t.selection.getRng().item) { - ed.dom.remove(t.selection.getRng().item(0)); - return Event.cancel(e); - } - } - }); + return t.contentDocument; + }, - /*if (t.dom.boxModel) { - t.getBody().style.height = '100%'; + getBody : function() { + return this.bodyElement || this.getDoc().body; + }, - Event.add(t.getWin(), 'resize', function(e) { - var docElm = t.getDoc().documentElement; + convertURL : function(u, n, e) { + var t = this, s = t.settings; - docElm.style.height = (docElm.offsetHeight - 10) + 'px'; - }); - }*/ - } + // Use callback instead + if (s.urlconverter_callback) + return t.execCallback('urlconverter_callback', u, e, true, n); - if (tinymce.isOpera) { - t.onClick.add(function(ed, e) { - Event.prevent(e); - }); - } + // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs + if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) + return u; - // Add custom undo/redo handlers - if (s.custom_undo_redo) { - function addUndo() { - t.undoManager.typing = 0; - t.undoManager.add(); - }; + // Convert to relative + if (s.relative_urls) + return t.documentBaseURI.toRelative(u); - t.dom.bind(t.getDoc(), 'focusout', function(e) { - if (!t.removed && t.undoManager.typing) - addUndo(); - }); + // Convert to absolute + u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); - t.onKeyUp.add(function(ed, e) { - if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) - addUndo(); - }); + return u; + }, - t.onKeyDown.add(function(ed, e) { - var rng, tmpRng, parent, offset; - - // IE has a really odd bug where the DOM might include an node that doesn't have - // a proper structure. If you try to access nodeValue it would throw an illegal value exception. - // This seems to only happen when you delete contents and it seems to be avoidable if you refresh the element - // after you delete contents from it. See: #3008923 - if (isIE && e.keyCode == 46) { - rng = t.selection.getRng(); - - if (rng.parentElement) { - parent = rng.parentElement(); - - // Get the current caret position within the element - tmpRng = rng.duplicate(); - tmpRng.moveToElementText(parent); - tmpRng.setEndPoint('EndToEnd', rng); - offset = tmpRng.text.length; - - // Select next word when ctrl key is used in combo with delete - if (e.ctrlKey) { - rng.moveEnd('word', 1); - rng.select(); - } + addVisual : function(e) { + var t = this, s = t.settings; - // Delete contents - t.selection.getSel().clear(); + e = e || t.getBody(); - // Check if we are within the same parent - if (rng.parentElement() == parent) { - try { - // Update the HTML and hopefully it will remove the artifacts - parent.innerHTML = parent.innerHTML; - } catch (ex) { - // And since it's IE it can sometimes produce an unknown runtime error - } + if (!is(t.hasVisual)) + t.hasVisual = s.visual; - // Restore the caret position - tmpRng.moveToElementText(parent); - tmpRng.collapse(); - tmpRng.move('character', offset); - tmpRng.select(); - } + each(t.dom.select('table,a', e), function(e) { + var v; - // Block the default delete behavior since it might be broken - e.preventDefault(); - return; - } - } + switch (e.nodeName) { + case 'TABLE': + v = t.dom.getAttrib(e, 'border'); - // Is caracter positon keys - if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) { - if (t.undoManager.typing) - addUndo(); + if (!v || v == '0') { + if (t.hasVisual) + t.dom.addClass(e, s.visual_table_class); + else + t.dom.removeClass(e, s.visual_table_class); + } return; - } - - if (!t.undoManager.typing) { - t.undoManager.add(); - t.undoManager.typing = 1; - } - }); - t.onMouseDown.add(function() { - if (t.undoManager.typing) - addUndo(); - }); - } - }, + case 'A': + v = t.dom.getAttrib(e, 'name'); - _isHidden : function() { - var s; + if (v) { + if (t.hasVisual) + t.dom.addClass(e, 'mceItemAnchor'); + else + t.dom.removeClass(e, 'mceItemAnchor'); + } - if (!isGecko) - return 0; + return; + } + }); - // Weird, wheres that cursor selection? - s = this.selection.getSel(); - return (!s || !s.rangeCount || s.rangeCount == 0); + t.onVisualAid.dispatch(t, e, t.hasVisual); }, - // Fix for bug #1867292 - _fixNesting : function(s) { - var d = [], i; - - s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) { - var e; + remove : function() { + var t = this, e = t.getContainer(); - // Handle end element - if (b === '/') { - if (!d.length) - return ''; + if (!t.removed) { + t.removed = 1; // Cancels post remove event execution + t.hide(); - if (c !== d[d.length - 1].tag) { - for (i=d.length - 1; i>=0; i--) { - if (d[i].tag === c) { - d[i].close = 1; - break; - } - } + // Remove all events - return ''; - } else { - d.pop(); + // Don't clear the window or document if content editable + // is enabled since other instances might still be present + if (!t.settings.content_editable) { + Event.clear(t.getWin()); + Event.clear(t.getDoc()); + } - if (d.length && d[d.length - 1].close) { - a = a + ''; - d.pop(); - } - } - } else { - // Ignore these - if (/^(br|hr|input|meta|img|link|param)$/i.test(c)) - return a; + Event.clear(t.getBody()); + Event.clear(t.formElement); + Event.unbind(e); - // Ignore closed ones - if (/\/>$/.test(a)) - return a; + t.execCallback('remove_instance_callback', t); + t.onRemove.dispatch(t); - d.push({tag : c}); // Push start element - } + // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command + t.onExecCommand.listeners = []; - return a; - }); + tinymce.remove(t); + DOM.remove(e); + } + }, - // End all open tags - for (i=d.length - 1; i>=0; i--) - s += ''; + destroy : function(s) { + var t = this; - return s; - } - }); -})(tinymce); + // One time is enough + if (t.destroyed) + return; -(function(tinymce) { - // Added for compression purposes - var each = tinymce.each, undefined, TRUE = true, FALSE = false; + // We must unbind on Gecko since it would otherwise produce the pesky "attempt to run compile-and-go script on a cleared scope" message + if (isGecko) { + Event.unbind(t.getDoc()); + Event.unbind(t.getWin()); + Event.unbind(t.getBody()); + } - tinymce.EditorCommands = function(editor) { - var dom = editor.dom, - selection = editor.selection, - commands = {state: {}, exec : {}, value : {}}, - settings = editor.settings, - bookmark; + if (!s) { + tinymce.removeUnload(t.destroy); + tinyMCE.onBeforeUnload.remove(t._beforeUnload); - function execCommand(command, ui, value) { - var func; + // Manual destroy + if (t.theme && t.theme.destroy) + t.theme.destroy(); - command = command.toLowerCase(); - if (func = commands.exec[command]) { - func(command, ui, value); - return TRUE; + // Destroy controls, selection and dom + t.controlManager.destroy(); + t.selection.destroy(); + t.dom.destroy(); } - return FALSE; - }; + if (t.formElement) { + t.formElement.submit = t.formElement._mceOldSubmit; + t.formElement._mceOldSubmit = null; + } - function queryCommandState(command) { - var func; + t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; - command = command.toLowerCase(); - if (func = commands.state[command]) - return func(command); + if (t.selection) + t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; - return -1; - }; + t.destroyed = 1; + }, - function queryCommandValue(command) { - var func; + // Internal functions - command = command.toLowerCase(); - if (func = commands.value[command]) - return func(command); + _addEvents : function() { + // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset + var t = this, i, s = t.settings, dom = t.dom, lo = { + mouseup : 'onMouseUp', + mousedown : 'onMouseDown', + click : 'onClick', + keyup : 'onKeyUp', + keydown : 'onKeyDown', + keypress : 'onKeyPress', + submit : 'onSubmit', + reset : 'onReset', + contextmenu : 'onContextMenu', + dblclick : 'onDblClick', + paste : 'onPaste' // Doesn't work in all browsers yet + }; - return FALSE; - }; + function eventHandler(e, o) { + var ty = e.type; - function addCommands(command_list, type) { - type = type || 'exec'; + // Don't fire events when it's removed + if (t.removed) + return; - each(command_list, function(callback, command) { - each(command.toLowerCase().split(','), function(command) { - commands[type][command] = callback; - }); - }); - }; + // Generic event handler + if (t.onEvent.dispatch(t, e, o) !== false) { + // Specific event handler + t[lo[e.fakeType || e.type]].dispatch(t, e, o); + } + }; - // Expose public methods - tinymce.extend(this, { - execCommand : execCommand, - queryCommandState : queryCommandState, - queryCommandValue : queryCommandValue, - addCommands : addCommands - }); + // Add DOM events + each(lo, function(v, k) { + switch (k) { + case 'contextmenu': + dom.bind(t.getDoc(), k, eventHandler); + break; - // Private methods + case 'paste': + dom.bind(t.getBody(), k, function(e) { + eventHandler(e); + }); + break; - function execNativeCommand(command, ui, value) { - if (ui === undefined) - ui = FALSE; + case 'submit': + case 'reset': + dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); + break; - if (value === undefined) - value = null; + default: + dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); + } + }); - return editor.getDoc().execCommand(command, ui, value); - }; + dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { + t.focus(true); + }); - function isFormatMatch(name) { - return editor.formatter.match(name); - }; - function toggleFormat(name, value) { - editor.formatter.toggle(name, value ? {value : value} : undefined); - }; + // Fixes bug where a specified document_base_uri could result in broken images + // This will also fix drag drop of images in Gecko + if (tinymce.isGecko) { + dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { + var v; - function storeSelection(type) { - bookmark = selection.getBookmark(type); - }; + e = e.target; - function restoreSelection() { - selection.moveToBookmark(bookmark); - }; + if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) + e.src = t.documentBaseURI.toAbsolute(v); + }); + } - // Add execCommand overrides - addCommands({ - // Ignore these, added for compatibility - 'mceResetDesignMode,mceBeginUndoLevel' : function() {}, + // Set various midas options in Gecko + if (isGecko) { + function setOpts() { + var t = this, d = t.getDoc(), s = t.settings; - // Add undo manager logic - 'mceEndUndoLevel,mceAddUndoLevel' : function() { - editor.undoManager.add(); - }, + if (isGecko && !s.readonly) { + t._refreshContentEditable(); - 'Cut,Copy,Paste' : function(command) { - var doc = editor.getDoc(), failed; + try { + // Try new Gecko method + d.execCommand("styleWithCSS", 0, false); + } catch (ex) { + // Use old method + if (!t._isHidden()) + try {d.execCommand("useCSS", 0, true);} catch (ex) {} + } - // Try executing the native command - try { - execNativeCommand(command); - } catch (ex) { - // Command failed - failed = TRUE; - } + if (!s.table_inline_editing) + try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} - // Present alert message about clipboard access not being available - if (failed || !doc.queryCommandSupported(command)) { - if (tinymce.isGecko) { - editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { - if (state) - open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); - }); - } else - editor.windowManager.alert(editor.getLang('clipboard_no_support')); - } - }, + if (!s.object_resizing) + try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} + } + }; - // Override unlink command - unlink : function(command) { - if (selection.isCollapsed()) - selection.select(selection.getNode()); + t.onBeforeExecCommand.add(setOpts); + t.onMouseDown.add(setOpts); + } - execNativeCommand(command); - selection.collapse(FALSE); - }, + // Add node change handlers + t.onMouseUp.add(t.nodeChanged); + //t.onClick.add(t.nodeChanged); + t.onKeyUp.add(function(ed, e) { + var c = e.keyCode; - // Override justify commands to use the text formatter engine - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - var align = command.substring(7); + if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) + t.nodeChanged(); + }); - // Remove all other alignments first - each('left,center,right,full'.split(','), function(name) { - if (align != name) - editor.formatter.remove('align' + name); - }); - toggleFormat('align' + align); - }, + // Add block quote deletion handler + t.onKeyDown.add(function(ed, e) { + if (e.keyCode != VK.BACKSPACE) + return; - // Override list commands to fix WebKit bug - 'InsertUnorderedList,InsertOrderedList' : function(command) { - var listElm, listParent; + var rng = ed.selection.getRng(); + if (!rng.collapsed) + return; - execNativeCommand(command); + var n = rng.startContainer; + var offset = rng.startOffset; - // WebKit produces lists within block elements so we need to split them - // we will replace the native list creation logic to custom logic later on - // TODO: Remove this when the list creation logic is removed - listElm = dom.getParent(selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; + while (n && n.nodeType && n.nodeType != 1 && n.parentNode) + n = n.parentNode; - // If list is within a text block then split that block - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - storeSelection(); - dom.split(listParent, listElm); - restoreSelection(); - } - } - }, + // Is the cursor at the beginning of a blockquote? + if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { + // Remove the blockquote + ed.formatter.toggle('blockquote', null, n.parentNode); - // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough' : function(command) { - toggleFormat(command); - }, + // Move the caret to the beginning of n + rng.setStart(n, 0); + rng.setEnd(n, 0); + ed.selection.setRng(rng); + ed.selection.collapse(false); + } + }); - // Override commands to use the text formatter engine - 'ForeColor,HiliteColor,FontName' : function(command, ui, value) { - toggleFormat(command, value); - }, - FontSize : function(command, ui, value) { - var fontClasses, fontSizes; - // Convert font size 1-7 to styles - if (value >= 1 && value <= 7) { - fontSizes = tinymce.explode(settings.font_size_style_values); - fontClasses = tinymce.explode(settings.font_size_classes); + // Add reset handler + t.onReset.add(function() { + t.setContent(t.startContent, {format : 'raw'}); + }); - if (fontClasses) - value = fontClasses[value - 1] || value; - else - value = fontSizes[value - 1] || value; + // Add shortcuts + if (s.custom_shortcuts) { + if (s.custom_undo_redo_keyboard_shortcuts) { + t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); + t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); } - toggleFormat(command, value); - }, + // Add default shortcuts for gecko + t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); + t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); + t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); - RemoveFormat : function(command) { - editor.formatter.remove(command); - }, + // BlockFormat shortcuts keys + for (i=1; i<=6; i++) + t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - mceBlockQuote : function(command) { - toggleFormat('blockquote'); - }, + t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); + t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); + t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); - FormatBlock : function(command, ui, value) { - return toggleFormat(value); - }, + function find(e) { + var v = null; - mceCleanup : function() { - var bookmark = selection.getBookmark(); + if (!e.altKey && !e.ctrlKey && !e.metaKey) + return v; - editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE}); + each(t.shortcuts, function(o) { + if (tinymce.isMac && o.ctrl != e.metaKey) + return; + else if (!tinymce.isMac && o.ctrl != e.ctrlKey) + return; - selection.moveToBookmark(bookmark); - }, + if (o.alt != e.altKey) + return; - mceRemoveNode : function(command, ui, value) { - var node = value || selection.getNode(); + if (o.shift != e.shiftKey) + return; - // Make sure that the body node isn't removed - if (node != editor.getBody()) { - storeSelection(); - editor.dom.remove(node, TRUE); - restoreSelection(); - } - }, + if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { + v = o; + return false; + } + }); - mceSelectNodeDepth : function(command, ui, value) { - var counter = 0; + return v; + }; - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, + t.onKeyUp.add(function(ed, e) { + var o = find(e); - mceSelectNode : function(command, ui, value) { - selection.select(value); - }, + if (o) + return Event.cancel(e); + }); - mceInsertContent : function(command, ui, value) { - selection.setContent(value); - }, + t.onKeyPress.add(function(ed, e) { + var o = find(e); - mceInsertRawHTML : function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, value)); - }, + if (o) + return Event.cancel(e); + }); - mceSetContent : function(command, ui, value) { - editor.setContent(value); - }, + t.onKeyDown.add(function(ed, e) { + var o = find(e); - 'Indent,Outdent' : function(command) { - var intentValue, indentUnit, value; + if (o) { + o.func.call(o.scope); + return Event.cancel(e); + } + }); + } - // Setup indent level - intentValue = settings.indentation; - indentUnit = /[a-z%]+$/i.exec(intentValue); - intentValue = parseInt(intentValue); + if (tinymce.isIE) { + // Fix so resize will only update the width and height attributes not the styles of an image + // It will also block mceItemNoResize items + dom.bind(t.getDoc(), 'controlselect', function(e) { + var re = t.resizeInfo, cb; - if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { - each(selection.getSelectedBlocks(), function(element) { - if (command == 'outdent') { - value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue); - dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : ''); - } else - dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit); - }); - } else - execNativeCommand(command); - }, + e = e.target; - mceRepaint : function() { - var bookmark; + // Don't do this action for non image elements + if (e.nodeName !== 'IMG') + return; - if (tinymce.isGecko) { - try { - storeSelection(TRUE); + if (re) + dom.unbind(re.node, re.ev, re.cb); - if (selection.getSel()) - selection.getSel().selectAllChildren(editor.getBody()); + if (!dom.hasClass(e, 'mceItemNoResize')) { + ev = 'resizeend'; + cb = dom.bind(e, ev, function(e) { + var v; - selection.collapse(TRUE); - restoreSelection(); - } catch (ex) { - // Ignore + e = e.target; + + if (v = dom.getStyle(e, 'width')) { + dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'width', ''); + } + + if (v = dom.getStyle(e, 'height')) { + dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'height', ''); + } + }); + } else { + ev = 'resizestart'; + cb = dom.bind(e, 'resizestart', Event.cancel, Event); } - } - }, - mceToggleFormat : function(command, ui, value) { - editor.formatter.toggle(value); - }, + re = t.resizeInfo = { + node : e, + ev : ev, + cb : cb + }; + }); + } - InsertHorizontalRule : function() { - selection.setContent('
                '); - }, + if (tinymce.isOpera) { + t.onClick.add(function(ed, e) { + Event.prevent(e); + }); + } - mceToggleVisualAid : function() { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, + // Add custom undo/redo handlers + if (s.custom_undo_redo) { + function addUndo() { + t.undoManager.typing = false; + t.undoManager.add(); + }; - mceReplaceContent : function(command, ui, value) { - selection.setContent(value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); - }, + var focusLostFunc = tinymce.isGecko ? 'blur' : 'focusout'; + dom.bind(t.getDoc(), focusLostFunc, function(e){ + if (!t.removed && t.undoManager.typing) + addUndo(); + }); - mceInsertLink : function(command, ui, value) { - var link = dom.getParent(selection.getNode(), 'a'); + // Add undo level when contents is drag/dropped within the editor + t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { + addUndo(); + }); - if (tinymce.is(value, 'string')) - value = {href : value}; + t.onKeyUp.add(function(ed, e) { + var keyCode = e.keyCode; - if (!link) { - execNativeCommand('CreateLink', FALSE, 'javascript:mctmp(0);'); - each(dom.select('a[href=javascript:mctmp(0);]'), function(link) { - dom.setAttribs(link, value); - }); - } else { - if (value.href) - dom.setAttribs(link, value); - else - editor.dom.remove(link, TRUE); - } - }, - - selectAll : function() { - var root = dom.getRoot(); - var rng = dom.createRng(); - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - editor.selection.setRng(rng); - } - }); + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) + addUndo(); + }); - // Add queryCommandState overrides - addCommands({ - // Override justify commands - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - return isFormatMatch('align' + command.substring(7)); - }, + t.onKeyDown.add(function(ed, e) { + var keyCode = e.keyCode, sel; - 'Bold,Italic,Underline,Strikethrough' : function(command) { - return isFormatMatch(command); - }, + if (keyCode == 8) { + sel = t.getDoc().selection; - mceBlockQuote : function() { - return isFormatMatch('blockquote'); - }, + // Fix IE control + backspace browser bug + if (sel && sel.createRange && sel.createRange().item) { + t.undoManager.beforeChange(); + ed.dom.remove(sel.createRange().item(0)); + addUndo(); - Outdent : function() { - var node; + return Event.cancel(e); + } + } - if (settings.inline_styles) { - if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; + // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { + // Add position before enter key is pressed, used by IE since it still uses the default browser behavior + // Todo: Remove this once we normalize enter behavior on IE + if (tinymce.isIE && keyCode == 13) + t.undoManager.beforeChange(); - if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - } + if (t.undoManager.typing) + addUndo(); + + return; + } - return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')); - }, + // If key isn't shift,ctrl,alt,capslock,metakey + if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { + t.undoManager.beforeChange(); + t.undoManager.typing = true; + t.undoManager.add(); + } + }); - 'InsertUnorderedList,InsertOrderedList' : function(command) { - return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL'); + t.onMouseDown.add(function() { + if (t.undoManager.typing) + addUndo(); + }); } - }, 'state'); + }, - // Add queryCommandValue overrides - addCommands({ - 'FontSize,FontName' : function(command) { - var value = 0, parent; + _refreshContentEditable : function() { + var self = this, body, parent; - if (parent = dom.getParent(selection.getNode(), 'span')) { - if (command == 'fontsize') - value = parent.style.fontSize; - else - value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); - } + // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again + if (self._isHidden()) { + body = self.getBody(); + parent = body.parentNode; - return value; + parent.removeChild(body); + parent.appendChild(body); + + body.focus(); } - }, 'value'); + }, - // Add undo manager logic - if (settings.custom_undo_redo) { - addCommands({ - Undo : function() { - editor.undoManager.undo(); - }, + _isHidden : function() { + var s; - Redo : function() { - editor.undoManager.redo(); - } - }); + if (!isGecko) + return 0; + + // Weird, wheres that cursor selection? + s = this.selection.getSel(); + return (!s || !s.rangeCount || s.rangeCount == 0); } - }; + }); })(tinymce); + (function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher; + // Added for compression purposes + var each = tinymce.each, undefined, TRUE = true, FALSE = false; - tinymce.UndoManager = function(editor) { - var self, index = 0, data = []; + tinymce.EditorCommands = function(editor) { + var dom = editor.dom, + selection = editor.selection, + commands = {state: {}, exec : {}, value : {}}, + settings = editor.settings, + formatter = editor.formatter, + bookmark; - function getContent() { - return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); - }; + function execCommand(command, ui, value) { + var func; - return self = { - typing : 0, + command = command.toLowerCase(); + if (func = commands.exec[command]) { + func(command, ui, value); + return TRUE; + } - onAdd : new Dispatcher(self), - onUndo : new Dispatcher(self), - onRedo : new Dispatcher(self), + return FALSE; + }; - add : function(level) { - var i, settings = editor.settings, lastLevel; + function queryCommandState(command) { + var func; - level = level || {}; - level.content = getContent(); + command = command.toLowerCase(); + if (func = commands.state[command]) + return func(command); - // Add undo level if needed - lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) { - if (index > 0 || data.length == 1) - return null; - } + return -1; + }; - // Time to compress - if (settings.custom_undo_redo_levels) { - if (data.length > settings.custom_undo_redo_levels) { - for (i = 0; i < data.length - 1; i++) - data[i] = data[i + 1]; + function queryCommandValue(command) { + var func; - data.length--; - index = data.length; - } - } + command = command.toLowerCase(); + if (func = commands.value[command]) + return func(command); - // Get a non intrusive normalized bookmark - level.bookmark = editor.selection.getBookmark(2, true); + return FALSE; + }; - // Crop array if needed - if (index < data.length - 1) { - // Treat first level as initial - if (index == 0) - data = []; - else - data.length = index + 1; - } + function addCommands(command_list, type) { + type = type || 'exec'; - data.push(level); - index = data.length - 1; + each(command_list, function(callback, command) { + each(command.toLowerCase().split(','), function(command) { + commands[type][command] = callback; + }); + }); + }; - self.onAdd.dispatch(self, level); - editor.isNotDirty = 0; + // Expose public methods + tinymce.extend(this, { + execCommand : execCommand, + queryCommandState : queryCommandState, + queryCommandValue : queryCommandValue, + addCommands : addCommands + }); - return level; - }, + // Private methods - undo : function() { - var level, i; + function execNativeCommand(command, ui, value) { + if (ui === undefined) + ui = FALSE; - if (self.typing) { - self.add(); - self.typing = 0; - } + if (value === undefined) + value = null; - if (index > 0) { - level = data[--index]; + return editor.getDoc().execCommand(command, ui, value); + }; - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); + function isFormatMatch(name) { + return formatter.match(name); + }; - self.onUndo.dispatch(self, level); - } + function toggleFormat(name, value) { + formatter.toggle(name, value ? {value : value} : undefined); + }; - return level; - }, + function storeSelection(type) { + bookmark = selection.getBookmark(type); + }; - redo : function() { - var level; + function restoreSelection() { + selection.moveToBookmark(bookmark); + }; - if (index < data.length - 1) { - level = data[++index]; + // Add execCommand overrides + addCommands({ + // Ignore these, added for compatibility + 'mceResetDesignMode,mceBeginUndoLevel' : function() {}, - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); + // Add undo manager logic + 'mceEndUndoLevel,mceAddUndoLevel' : function() { + editor.undoManager.add(); + }, - self.onRedo.dispatch(self, level); + 'Cut,Copy,Paste' : function(command) { + var doc = editor.getDoc(), failed; + + // Try executing the native command + try { + execNativeCommand(command); + } catch (ex) { + // Command failed + failed = TRUE; } - return level; + // Present alert message about clipboard access not being available + if (failed || !doc.queryCommandSupported(command)) { + if (tinymce.isGecko) { + editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { + if (state) + open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); + }); + } else + editor.windowManager.alert(editor.getLang('clipboard_no_support')); + } }, - clear : function() { - data = []; - index = self.typing = 0; - }, + // Override unlink command + unlink : function(command) { + if (selection.isCollapsed()) + selection.select(selection.getNode()); - hasUndo : function() { - return index > 0 || self.typing; + execNativeCommand(command); + selection.collapse(FALSE); }, - hasRedo : function() { - return index < data.length - 1; - } - }; - }; -})(tinymce); + // Override justify commands to use the text formatter engine + 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { + var align = command.substring(7); -(function(tinymce) { - // Shorten names - var Event = tinymce.dom.Event, - isIE = tinymce.isIE, - isGecko = tinymce.isGecko, - isOpera = tinymce.isOpera, - each = tinymce.each, - extend = tinymce.extend, - TRUE = true, - FALSE = false; - - function cloneFormats(node) { - var clone, temp, inner; - - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) { - if (clone) { - temp = node.cloneNode(false); - temp.appendChild(clone); - clone = temp; - } else { - clone = inner = node.cloneNode(false); - } + // Remove all other alignments first + each('left,center,right,full'.split(','), function(name) { + if (align != name) + formatter.remove('align' + name); + }); - clone.removeAttribute('id'); - } - } while (node = node.parentNode); + toggleFormat('align' + align); + execCommand('mceRepaint'); + }, - if (clone) - return {wrapper : clone, inner : inner}; - }; + // Override list commands to fix WebKit bug + 'InsertUnorderedList,InsertOrderedList' : function(command) { + var listElm, listParent; - // Checks if the selection/caret is at the end of the specified block element - function isAtEnd(rng, par) { - var rng2 = par.ownerDocument.createRange(); + execNativeCommand(command); - rng2.setStart(rng.endContainer, rng.endOffset); - rng2.setEndAfter(par); + // WebKit produces lists within block elements so we need to split them + // we will replace the native list creation logic to custom logic later on + // TODO: Remove this when the list creation logic is removed + listElm = dom.getParent(selection.getNode(), 'ol,ul'); + if (listElm) { + listParent = listElm.parentNode; - // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element - return rng2.cloneContents().textContent.length == 0; - }; + // If list is within a text block then split that block + if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { + storeSelection(); + dom.split(listParent, listElm); + restoreSelection(); + } + } + }, + + // Override commands to use the text formatter engine + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { + toggleFormat(command); + }, + + // Override commands to use the text formatter engine + 'ForeColor,HiliteColor,FontName' : function(command, ui, value) { + toggleFormat(command, value); + }, - function isEmpty(n) { - n = n.innerHTML; + FontSize : function(command, ui, value) { + var fontClasses, fontSizes; - n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars - n = n.replace(/<[^>]+>/g, ''); // Remove all tags + // Convert font size 1-7 to styles + if (value >= 1 && value <= 7) { + fontSizes = tinymce.explode(settings.font_size_style_values); + fontClasses = tinymce.explode(settings.font_size_classes); - return n.replace(/[ \u00a0\t\r\n]+/g, '') == ''; - }; + if (fontClasses) + value = fontClasses[value - 1] || value; + else + value = fontSizes[value - 1] || value; + } - function splitList(selection, dom, li) { - var listBlock, block; + toggleFormat(command, value); + }, - if (isEmpty(li)) { - listBlock = dom.getParent(li, 'ul,ol'); + RemoveFormat : function(command) { + formatter.remove(command); + }, - if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { - dom.split(listBlock, li); - block = dom.create('p', 0, '
                '); - dom.replace(block, li); - selection.select(block, 1); - } + mceBlockQuote : function(command) { + toggleFormat('blockquote'); + }, - return FALSE; - } + FormatBlock : function(command, ui, value) { + return toggleFormat(value || 'p'); + }, - return TRUE; - }; + mceCleanup : function() { + var bookmark = selection.getBookmark(); - tinymce.create('tinymce.ForceBlocks', { - ForceBlocks : function(ed) { - var t = this, s = ed.settings, elm; + editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE}); - t.editor = ed; - t.dom = ed.dom; - elm = (s.forced_root_block || 'p').toLowerCase(); - s.element = elm.toUpperCase(); + selection.moveToBookmark(bookmark); + }, - ed.onPreInit.add(t.setup, t); + mceRemoveNode : function(command, ui, value) { + var node = value || selection.getNode(); - t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi'); - t.rePadd = new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

                <\\\/p>||

                \\s+<\\\/p>'.replace(/p/g, elm), 'gi'); - t.reNbsp2BR1 = new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

                [\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi'); - t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi'); - t.reBR2Nbsp = new RegExp(']+)>\\s*
                \\s*<\\\/p>|

                \\s*
                \\s*<\\\/p>'.replace(/p/g, elm), 'gi'); + // Make sure that the body node isn't removed + if (node != editor.getBody()) { + storeSelection(); + editor.dom.remove(node, TRUE); + restoreSelection(); + } + }, - function padd(ed, o) { - if (isOpera) - o.content = o.content.replace(t.reOpera, ''); + mceSelectNodeDepth : function(command, ui, value) { + var counter = 0; - o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0'); + dom.getParent(selection.getNode(), function(node) { + if (node.nodeType == 1 && counter++ == value) { + selection.select(node); + return FALSE; + } + }, editor.getBody()); + }, - if (!isIE && !isOpera && o.set) { - // Use   instead of BR in padded paragraphs - o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2>
                '); - o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2>
                '); - } else - o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0'); - }; + mceSelectNode : function(command, ui, value) { + selection.select(value); + }, - ed.onBeforeSetContent.add(padd); - ed.onPostProcess.add(padd); + mceInsertContent : function(command, ui, value) { + var parser, serializer, parentNode, rootNode, fragment, args, + marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; - if (s.forced_root_block) { - ed.onInit.add(t.forceRoots, t); - ed.onSetContent.add(t.forceRoots, t); - ed.onBeforeGetContent.add(t.forceRoots, t); - } - }, + //selection.normalize(); - setup : function() { - var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection; + // Setup parser and serializer + parser = editor.parser; + serializer = new tinymce.html.Serializer({}, editor.schema); + bookmarkHtml = '\uFEFF'; - // Force root blocks when typing and when getting output - if (s.forced_root_block) { - ed.onBeforeExecCommand.add(t.forceRoots, t); - ed.onKeyUp.add(t.forceRoots, t); - ed.onPreProcess.add(t.forceRoots, t); - } + // Run beforeSetContent handlers on the HTML to be inserted + args = {content: value, format: 'html'}; + selection.onBeforeSetContent.dispatch(selection, args); + value = args.content; - if (s.force_br_newlines) { - // Force IE to produce BRs on enter - if (isIE) { - ed.onKeyPress.add(function(ed, e) { - var n; - - if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') { - selection.setContent('
                ', {format : 'raw'}); - n = dom.get('__'); - n.removeAttribute('id'); - selection.select(n); - selection.collapse(); - return Event.cancel(e); - } - }); - } - } + // Add caret at end of contents if it's missing + if (value.indexOf('{$caret}') == -1) + value += '{$caret}'; - if (s.force_p_newlines) { - if (!isIE) { - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e)) - Event.cancel(e); - }); - } else { - // Ungly hack to for IE to preserve the formatting when you press - // enter at the end of a block element with formatted contents - // This logic overrides the browsers default logic with - // custom logic that enables us to control the output - tinymce.addUnload(function() { - t._previousFormats = 0; // Fix IE leak - }); + // Replace the caret marker with a span bookmark element + value = value.replace(/\{\$caret\}/, bookmarkHtml); - ed.onKeyPress.add(function(ed, e) { - t._previousFormats = 0; + // Insert node maker where we will insert the new HTML and get it's parent + if (!selection.isCollapsed()) + editor.getDoc().execCommand('Delete', false, null); - // Clone the current formats, this will later be applied to the new block contents - if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles) - t._previousFormats = cloneFormats(ed.selection.getStart()); - }); + parentNode = selection.getNode(); - ed.onKeyUp.add(function(ed, e) { - // Let IE break the element and the wrap the new caret location in the previous formats - if (e.keyCode == 13 && !e.shiftKey) { - var parent = ed.selection.getStart(), fmt = t._previousFormats; + // Parse the fragment within the context of the parent node + args = {context : parentNode.nodeName.toLowerCase()}; + fragment = parser.parse(value, args); - // Parent is an empty block - if (!parent.hasChildNodes()) { - parent = dom.getParent(parent, dom.isBlock); + // Move the caret to a more suitable location + node = fragment.lastChild; + if (node.attr('id') == 'mce_marker') { + marker = node; - if (parent) { - parent.innerHTML = ''; - - if (t._previousFormats) { - parent.appendChild(fmt.wrapper); - fmt.inner.innerHTML = '\uFEFF'; - } else - parent.innerHTML = '\uFEFF'; - - selection.select(parent, 1); - ed.getDoc().execCommand('Delete', false, null); - } - } + for (node = node.prev; node; node = node.walk(true)) { + if (node.type == 3 || !dom.isBlock(node.name)) { + node.parent.insert(marker, node, node.name === 'br'); + break; } - }); + } } - if (isGecko) { - ed.onKeyDown.add(function(ed, e) { - if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) - t.backspaceDelete(e, e.keyCode == 8); - }); - } - } + // If parser says valid we can insert the contents into that parent + if (!args.invalid) { + value = serializer.serialize(fragment); - // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 - if (tinymce.isWebKit) { - function insertBr(ed) { - var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h; + // Check if parent is empty or only has one BR element then set the innerHTML of that parent + node = parentNode.firstChild; + node2 = parentNode.lastChild; + if (!node || (node === node2 && node.nodeName === 'BR')) + dom.setHTML(parentNode, value); + else + selection.setContent(value); + } else { + // If the fragment was invalid within that context then we need + // to parse and process the parent it's inserted into - // Insert BR element - rng.insertNode(br = dom.create('br')); + // Insert bookmark node and get the parent + selection.setContent(bookmarkHtml); + parentNode = editor.selection.getNode(); + rootNode = editor.getBody(); - // Place caret after BR - rng.setStartAfter(br); - rng.setEndAfter(br); - selection.setRng(rng); + // Opera will return the document node when selection is in root + if (parentNode.nodeType == 9) + parentNode = node = rootNode; + else + node = parentNode; - // Could not place caret after BR then insert an nbsp entity and move the caret - if (selection.getSel().focusNode == br.previousSibling) { - selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); - selection.collapse(TRUE); + // Find the ancestor just before the root element + while (node !== rootNode) { + parentNode = node; + node = node.parentNode; } - // Create a temporary DIV after the BR and get the position as it - // seems like getPos() returns 0 for text nodes and BR elements. - dom.insertAfter(div, br); - divYPos = dom.getPos(div).y; - dom.remove(div); + // Get the outer/inner HTML depending on if we are in the root and parser and serialize that + value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); + value = serializer.serialize( + parser.parse( + // Need to replace by using a function since $ in the contents would otherwise be a problem + value.replace(//i, function() { + return serializer.serialize(fragment); + }) + ) + ); + + // Set the inner/outer HTML depending on if we are in the root or not + if (parentNode == rootNode) + dom.setHTML(rootNode, value); + else + dom.setOuterHTML(parentNode, value); + } - // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 - if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port. - ed.getWin().scrollTo(0, divYPos); - }; + marker = dom.get('mce_marker'); - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) { - insertBr(ed); - Event.cancel(e); - } - }); - } + // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well + nodeRect = dom.getRect(marker); + viewPortRect = dom.getViewPort(editor.getWin()); - // Padd empty inline elements within block elements - // For example:

                becomes

                 

                - ed.onPreProcess.add(function(ed, o) { - each(dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) { - if (isEmpty(p)) { - each(dom.select('span,em,strong,b,i', o.node), function(n) { - if (!n.hasChildNodes()) { - n.appendChild(ed.getDoc().createTextNode('\u00a0')); - return FALSE; // Break the loop one padding is enough - } - }); - } - }); - }); + // Check if node is out side the viewport if it is then scroll to it + if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || + (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { + viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); + viewportBodyElement.scrollLeft = nodeRect.x; + viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; + } - // IE specific fixes - if (isIE) { - // Replaces IE:s auto generated paragraphs with the specified element name - if (s.element != 'P') { - ed.onKeyPress.add(function(ed, e) { - t.lastElm = selection.getNode().nodeName; - }); + // Move selection before marker and remove it + rng = dom.createRng(); - ed.onKeyUp.add(function(ed, e) { - var bl, n = selection.getNode(), b = ed.getBody(); + // If previous sibling is a text node set the selection to the end of that node + node = marker.previousSibling; + if (node && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + } else { + // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node + rng.setStartBefore(marker); + rng.setEndBefore(marker); + } - if (b.childNodes.length === 1 && n.nodeName == 'P') { - n = dom.rename(n, s.element); - selection.select(n); - selection.collapse(); - ed.nodeChanged(); - } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { - bl = dom.getParent(n, 'p'); + // Remove the marker node and set the new range + dom.remove(marker); + selection.setRng(rng); - if (bl) { - dom.rename(bl, s.element); - ed.nodeChanged(); - } - } - }); - } - } - }, + // Dispatch after event and add any visual elements needed + selection.onSetContent.dispatch(selection, args); + editor.addVisual(); + }, - find : function(n, t, s) { - var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, FALSE), c = -1; + mceInsertRawHTML : function(command, ui, value) { + selection.setContent('tiny_mce_marker'); + editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); + }, - while (n = w.nextNode()) { - c++; + mceSetContent : function(command, ui, value) { + editor.setContent(value); + }, - // Index by node - if (t == 0 && n == s) - return c; + 'Indent,Outdent' : function(command) { + var intentValue, indentUnit, value; - // Node by index - if (t == 1 && c == s) - return n; - } + // Setup indent level + intentValue = settings.indentation; + indentUnit = /[a-z%]+$/i.exec(intentValue); + intentValue = parseInt(intentValue); - return -1; - }, + if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { + // If forced_root_blocks is set to false we don't have a block to indent so lets create a div + if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) { + formatter.apply('div'); + } + + each(selection.getSelectedBlocks(), function(element) { + if (command == 'outdent') { + value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue); + dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : ''); + } else + dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit); + }); + } else + execNativeCommand(command); + }, - forceRoots : function(ed, e) { - var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF; - var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid; + mceRepaint : function() { + var bookmark; - // Fix for bug #1863847 - //if (e && e.keyCode == 13) - // return TRUE; + if (tinymce.isGecko) { + try { + storeSelection(TRUE); - // Wrap non blocks into blocks - for (i = nl.length - 1; i >= 0; i--) { - nx = nl[i]; + if (selection.getSel()) + selection.getSel().selectAllChildren(editor.getBody()); - // Ignore internal elements - if (nx.nodeType === 1 && nx.getAttribute('_mce_type')) { - bl = null; - continue; + selection.collapse(TRUE); + restoreSelection(); + } catch (ex) { + // Ignore + } } + }, - // Is text or non block element - if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) { - if (!bl) { - // Create new block but ignore whitespace - if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) { - // Store selection - if (si == -2 && r) { - if (!isIE) { - // If selection is element then mark it - if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) { - // Save the id of the selected element - eid = n.getAttribute("id"); - n.setAttribute("id", "__mce"); - } else { - // If element is inside body, might not be the case in contentEdiable mode - if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) { - so = r.startOffset; - eo = r.endOffset; - si = t.find(b, 0, r.startContainer); - ei = t.find(b, 0, r.endContainer); - } - } - } else { - // Force control range into text range - if (r.item) { - tr = d.body.createTextRange(); - tr.moveToElementText(r.item(0)); - r = tr; - } + mceToggleFormat : function(command, ui, value) { + formatter.toggle(value); + }, - tr = d.body.createTextRange(); - tr.moveToElementText(b); - tr.collapse(1); - bp = tr.move('character', c) * -1; + InsertHorizontalRule : function() { + editor.execCommand('mceInsertContent', false, '
                '); + }, - tr = r.duplicate(); - tr.collapse(1); - sp = tr.move('character', c) * -1; + mceToggleVisualAid : function() { + editor.hasVisual = !editor.hasVisual; + editor.addVisual(); + }, - tr = r.duplicate(); - tr.collapse(0); - le = (tr.move('character', c) * -1) - sp; + mceReplaceContent : function(command, ui, value) { + editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); + }, - si = sp - bp; - ei = le; - } - } + mceInsertLink : function(command, ui, value) { + var anchor; - // Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE - // See: http://support.microsoft.com/kb/829907 - bl = ed.dom.create(ed.settings.forced_root_block); - nx.parentNode.replaceChild(bl, nx); - bl.appendChild(nx); - } - } else { - if (bl.hasChildNodes()) - bl.insertBefore(nx, bl.firstChild); - else - bl.appendChild(nx); - } - } else - bl = null; // Time to create new block - } + if (typeof(value) == 'string') + value = {href : value}; - // Restore selection - if (si != -2) { - if (!isIE) { - bl = b.getElementsByTagName(ed.settings.element)[0]; - r = d.createRange(); + anchor = dom.getParent(selection.getNode(), 'a'); - // Select last location or generated block - if (si != -1) - r.setStart(t.find(b, 1, si), so); - else - r.setStart(bl, 0); + // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. + value.href = value.href.replace(' ', '%20'); - // Select last location or generated block - if (ei != -1) - r.setEnd(t.find(b, 1, ei), eo); - else - r.setEnd(bl, 0); + // Remove existing links if there could be child links or that the href isn't specified + if (!anchor || !value.href) { + formatter.remove('link'); + } - if (s) { - s.removeAllRanges(); - s.addRange(r); - } - } else { - try { - r = s.createRange(); - r.moveToElementText(b); - r.collapse(1); - r.moveStart('character', si); - r.moveEnd('character', ei); - r.select(); - } catch (ex) { - // Ignore - } + // Apply new link to selection + if (value.href) { + formatter.apply('link', value, anchor); } - } else if (!isIE && (n = ed.dom.get('__mce'))) { - // Restore the id of the selected element - if (eid) - n.setAttribute('id', eid); - else - n.removeAttribute('id'); + }, - // Move caret before selected element - r = d.createRange(); - r.setStartBefore(n); - r.setEndBefore(n); - se.setRng(r); - } - }, + selectAll : function() { + var root = dom.getRoot(), rng = dom.createRng(); - getParentBlock : function(n) { - var d = this.dom; + rng.setStart(root, 0); + rng.setEnd(root, root.childNodes.length); - return d.getParent(n, d.isBlock); - }, + editor.selection.setRng(rng); + } + }); - insertPara : function(e) { - var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; - var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; + // Add queryCommandState overrides + addCommands({ + // Override justify commands + 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { + var name = 'align' + command.substring(7); + // Use Formatter.matchNode instead of Formatter.match so that we don't match on parent node. This fixes bug where for both left + // and right align buttons can be active. This could occur when selected nodes have align right and the parent has align left. + var nodes = selection.isCollapsed() ? [selection.getNode()] : selection.getSelectedBlocks(); + var matches = tinymce.map(nodes, function(node) { + return !!formatter.matchNode(node, name); + }); + return tinymce.inArray(matches, TRUE) !== -1; + }, + + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { + return isFormatMatch(command); + }, - // If root blocks are forced then use Operas default behavior since it's really good -// Removed due to bug: #1853816 -// if (se.forced_root_block && isOpera) -// return TRUE; + mceBlockQuote : function() { + return isFormatMatch('blockquote'); + }, - // Setup before range - rb = d.createRange(); + Outdent : function() { + var node; - // If is before the first block element and in body, then move it into first block element - rb.setStart(s.anchorNode, s.anchorOffset); - rb.collapse(TRUE); + if (settings.inline_styles) { + if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) + return TRUE; - // Setup after range - ra = d.createRange(); + if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) + return TRUE; + } - // If is before the first block element and in body, then move it into first block element - ra.setStart(s.focusNode, s.focusOffset); - ra.collapse(TRUE); + return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')); + }, - // Setup start/end points - dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; - sn = dir ? s.anchorNode : s.focusNode; - so = dir ? s.anchorOffset : s.focusOffset; - en = dir ? s.focusNode : s.anchorNode; - eo = dir ? s.focusOffset : s.anchorOffset; + 'InsertUnorderedList,InsertOrderedList' : function(command) { + return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL'); + } + }, 'state'); - // If selection is in empty table cell - if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { - if (sn.firstChild.nodeName == 'BR') - dom.remove(sn.firstChild); // Remove BR + // Add queryCommandValue overrides + addCommands({ + 'FontSize,FontName' : function(command) { + var value = 0, parent; - // Create two new block elements - if (sn.childNodes.length == 0) { - ed.dom.add(sn, se.element, null, '
                '); - aft = ed.dom.add(sn, se.element, null, '
                '); - } else { - n = sn.innerHTML; - sn.innerHTML = ''; - ed.dom.add(sn, se.element, null, n); - aft = ed.dom.add(sn, se.element, null, '
                '); + if (parent = dom.getParent(selection.getNode(), 'span')) { + if (command == 'fontsize') + value = parent.style.fontSize; + else + value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); } - // Move caret into the last one - r = d.createRange(); - r.selectNodeContents(aft); - r.collapse(1); - ed.selection.setRng(r); - - return FALSE; + return value; } + }, 'value'); - // If the caret is in an invalid location in FF we need to move it into the first block - if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { - sn = en = sn.firstChild; - so = eo = 0; - rb = d.createRange(); - rb.setStart(sn, 0); - ra = d.createRange(); - ra.setStart(en, 0); - } + // Add undo manager logic + if (settings.custom_undo_redo) { + addCommands({ + Undo : function() { + editor.undoManager.undo(); + }, + + Redo : function() { + editor.undoManager.redo(); + } + }); + } + }; +})(tinymce); + +(function(tinymce) { + var Dispatcher = tinymce.util.Dispatcher; - // Never use body as start or end node - sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - sn = sn.nodeName == "BODY" ? sn.firstChild : sn; - en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - en = en.nodeName == "BODY" ? en.firstChild : en; + tinymce.UndoManager = function(editor) { + var self, index = 0, data = [], beforeBookmark; - // Get start and end blocks - sb = t.getParentBlock(sn); - eb = t.getParentBlock(en); - bn = sb ? sb.nodeName : se.element; // Get block name to create + function getContent() { + // Remove whitespace before/after and remove pure bogus nodes + return tinymce.trim(editor.getContent({format : 'raw', no_events : 1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g, '')); + }; - // Return inside list use default browser behavior - if (n = t.dom.getParent(sb, 'li,pre')) { - if (n.nodeName == 'LI') - return splitList(ed.selection, t.dom, n); + return self = { + typing : false, - return TRUE; - } + onAdd : new Dispatcher(self), - // If caption or absolute layers then always generate new blocks within - if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - sb = null; - } + onUndo : new Dispatcher(self), - // If caption or absolute layers then always generate new blocks within - if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - eb = null; - } + onRedo : new Dispatcher(self), - // Use P instead - if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) { - bn = se.element; - sb = eb = null; - } + beforeChange : function() { + beforeBookmark = editor.selection.getBookmark(2, true); + }, - // Setup new before and after blocks - bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); - aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); + add : function(level) { + var i, settings = editor.settings, lastLevel; - // Remove id from after clone - aft.removeAttribute('id'); + level = level || {}; + level.content = getContent(); - // Is header and cursor is at the end, then force paragraph under - if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb)) - aft = ed.dom.create(se.element); + // Add undo level if needed + lastLevel = data[index]; + if (lastLevel && lastLevel.content == level.content) + return null; - // Find start chop node - n = sc = sn; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; + // Set before bookmark on previous level + if (data[index]) + data[index].beforeBookmark = beforeBookmark; - sc = n; - } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); + // Time to compress + if (settings.custom_undo_redo_levels) { + if (data.length > settings.custom_undo_redo_levels) { + for (i = 0; i < data.length - 1; i++) + data[i] = data[i + 1]; - // Find end chop node - n = ec = en; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; + data.length--; + index = data.length; + } + } - ec = n; - } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); + // Get a non intrusive normalized bookmark + level.bookmark = editor.selection.getBookmark(2, true); - // Place first chop part into before block element - if (sc.nodeName == bn) - rb.setStart(sc, 0); - else - rb.setStartBefore(sc); + // Crop array if needed + if (index < data.length - 1) + data.length = index + 1; - rb.setEnd(sn, so); - bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari + data.push(level); + index = data.length - 1; - // Place secnd chop part within new block element - try { - ra.setEndAfter(ec); - } catch(ex) { - //console.debug(s.focusNode, s.focusOffset); - } + self.onAdd.dispatch(self, level); + editor.isNotDirty = 0; - ra.setStart(en, eo); - aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari + return level; + }, - // Create range around everything - r = d.createRange(); - if (!sc.previousSibling && sc.parentNode.nodeName == bn) { - r.setStartBefore(sc.parentNode); - } else { - if (rb.startContainer.nodeName == bn && rb.startOffset == 0) - r.setStartBefore(rb.startContainer); - else - r.setStart(rb.startContainer, rb.startOffset); - } + undo : function() { + var level, i; - if (!ec.nextSibling && ec.parentNode.nodeName == bn) - r.setEndAfter(ec.parentNode); - else - r.setEnd(ra.endContainer, ra.endOffset); + if (self.typing) { + self.add(); + self.typing = false; + } - // Delete and replace it with new block elements - r.deleteContents(); + if (index > 0) { + level = data[--index]; - if (isOpera) - ed.getWin().scrollTo(0, vp.y); + editor.setContent(level.content, {format : 'raw'}); + editor.selection.moveToBookmark(level.beforeBookmark); - // Never wrap blocks in blocks - if (bef.firstChild && bef.firstChild.nodeName == bn) - bef.innerHTML = bef.firstChild.innerHTML; + self.onUndo.dispatch(self, level); + } - if (aft.firstChild && aft.firstChild.nodeName == bn) - aft.innerHTML = aft.firstChild.innerHTML; + return level; + }, - // Padd empty blocks - if (isEmpty(bef)) - bef.innerHTML = '
                '; + redo : function() { + var level; - function appendStyles(e, en) { - var nl = [], nn, n, i; + if (index < data.length - 1) { + level = data[++index]; - e.innerHTML = ''; + editor.setContent(level.content, {format : 'raw'}); + editor.selection.moveToBookmark(level.bookmark); - // Make clones of style elements - if (se.keep_styles) { - n = en; - do { - // We only want style specific elements - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { - nn = n.cloneNode(FALSE); - dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique - nl.push(nn); - } - } while (n = n.parentNode); + self.onRedo.dispatch(self, level); } - // Append style elements to aft - if (nl.length > 0) { - for (i = nl.length - 1, nn = e; i >= 0; i--) - nn = nn.appendChild(nl[i]); + return level; + }, - // Padd most inner style element - nl[0].innerHTML = isOpera ? ' ' : '
                '; // Extra space for Opera so that the caret can move there - return nl[0]; // Move caret to most inner element - } else - e.innerHTML = isOpera ? ' ' : '
                '; // Extra space for Opera so that the caret can move there - }; + clear : function() { + data = []; + index = 0; + self.typing = false; + }, - // Fill empty afterblook with current style - if (isEmpty(aft)) - car = appendStyles(aft, en); + hasUndo : function() { + return index > 0 || this.typing; + }, - // Opera needs this one backwards for older versions - if (isOpera && parseFloat(opera.version()) < 9.5) { - r.insertNode(bef); - r.insertNode(aft); - } else { - r.insertNode(aft); - r.insertNode(bef); + hasRedo : function() { + return index < data.length - 1 && !this.typing; } + }; + }; +})(tinymce); - // Normalize - aft.normalize(); - bef.normalize(); +tinymce.ForceBlocks = function(editor) { + var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements(); - function first(n) { - return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE).nextNode() || n; - }; + // Force root blocks + if (settings.forced_root_block) { + function addRootBlocks() { + var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; - // Move cursor and scroll into view - r = d.createRange(); - r.selectNodeContents(isGecko ? first(car || aft) : car || aft); - r.collapse(1); - s.removeAllRanges(); - s.addRange(r); + if (!node || node.nodeType !== 1 || !settings.forced_root_block) + return; - // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs - y = ed.dom.getPos(aft).y; - ch = aft.clientHeight; + // Check if node is wrapped in block + while (node != rootNode) { + if (blockElements[node.nodeName]) + return; - // Is element within viewport - if (y < vp.y || y + ch > vp.y + vp.h) { - ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks - //console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight)); + node = node.parentNode; } - return FALSE; - }, - - backspaceDelete : function(e, bs) { - var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker; + // Get current selection + rng = selection.getRng(); + if (rng.setStart) { + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + } else { + // Force control range into text range + if (rng.item) { + node = rng.item(0); + rng = editor.getDoc().body.createTextRange(); + rng.moveToElementText(node); + } - // Delete when caret is behind a element doesn't work correctly on Gecko see #3011651 - if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) { - walker = new tinymce.dom.TreeWalker(sc.lastChild, sc); + tmpRng = rng.duplicate(); + tmpRng.collapse(true); + startOffset = tmpRng.move('character', offset) * -1; - // Walk the dom backwards until we find a text node - for (n = sc.lastChild; n; n = walker.prev()) { - if (n.nodeType == 3) { - r.setStart(n, n.nodeValue.length); - r.collapse(true); - se.setRng(r); - return; - } + if (!tmpRng.collapsed) { + tmpRng = rng.duplicate(); + tmpRng.collapse(false); + endOffset = (tmpRng.move('character', offset) * -1) - startOffset; } } - // The caret sometimes gets stuck in Gecko if you delete empty paragraphs - // This workaround removes the element by hand and moves the caret to the previous element - if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { - if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { - // Find previous block element - n = sc; - while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; + // Wrap non block elements and text nodes + for (node = rootNode.firstChild; node; node) { + if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { + if (!rootBlockNode) { + rootBlockNode = dom.create(settings.forced_root_block); + node.parentNode.insertBefore(rootBlockNode, node); + } - if (n) { - if (sc != b.firstChild) { - // Find last text node - w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE); - while (tn = w.nextNode()) - n = tn; + tempNode = node; + node = node.nextSibling; + rootBlockNode.appendChild(tempNode); + } else { + rootBlockNode = null; + node = node.nextSibling; + } + } - // Place caret at the end of last text node - r = ed.getDoc().createRange(); - r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); - r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); - se.setRng(r); + if (rng.setStart) { + rng.setStart(startContainer, startOffset); + rng.setEnd(endContainer, endOffset); + selection.setRng(rng); + } else { + try { + rng = editor.getDoc().body.createTextRange(); + rng.moveToElementText(rootNode); + rng.collapse(true); + rng.moveStart('character', startOffset); - // Remove the target container - ed.dom.remove(sc); - } + if (endOffset > 0) + rng.moveEnd('character', endOffset); - return Event.cancel(e); - } + rng.select(); + } catch (ex) { + // Ignore } } - } - }); -})(tinymce); + + editor.nodeChanged(); + }; + + editor.onKeyUp.add(addRootBlocks); + editor.onClick.add(addRootBlocks); + } +}; (function(tinymce) { // Shorten names @@ -12484,11 +14767,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; - if (ed.settings.use_native_selects) + + function useNativeListForAccessibility(ed) { + return ed.settings.use_accessible_selects && !tinymce.isGecko + } + + if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) c = new tinymce.ui.NativeListBox(id, s); else { cls = cc || t._cls.listbox || tinymce.ui.ListBox; - c = new cls(id, s); + c = new cls(id, s, ed); } t.controls[id] = c; @@ -12543,11 +14831,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (s.menu_button) { cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; - c = new cls(id, s); + c = new cls(id, s, ed); ed.onMouseDown.add(c.hideMenu, c); } else { cls = t._cls.button || tinymce.ui.Button; - c = new cls(id, s); + c = new cls(id, s, ed); } return t.add(c); @@ -12590,7 +14878,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; - c = t.add(new cls(id, s)); + c = t.add(new cls(id, s, ed)); ed.onMouseDown.add(c.hideMenu, c); return c; @@ -12630,7 +14918,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; - c = new cls(id, s); + c = new cls(id, s, ed); ed.onMouseDown.add(c.hideMenu, c); // Remove the menu element when the editor is removed @@ -12662,13 +14950,25 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { id = t.prefix + id; cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; - c = new cls(id, s); + c = new cls(id, s, t.editor); if (t.get(id)) return null; return t.add(c); }, + + createToolbarGroup : function(id, s, cc) { + var c, t = this, cls; + id = t.prefix + id; + cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; + c = new cls(id, s, t.editor); + + if (t.get(id)) + return null; + + return t.add(c); + }, createSeparator : function(cc) { var cls = cc || this._cls.separator || tinymce.ui.Separator; @@ -12805,53 +15105,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }); }(tinymce)); -(function(tinymce) { - function CommandManager() { - var execCommands = {}, queryStateCommands = {}, queryValueCommands = {}; - - function add(collection, cmd, func, scope) { - if (typeof(cmd) == 'string') - cmd = [cmd]; - - tinymce.each(cmd, function(cmd) { - collection[cmd.toLowerCase()] = {func : func, scope : scope}; - }); - }; - - tinymce.extend(this, { - add : function(cmd, func, scope) { - add(execCommands, cmd, func, scope); - }, - - addQueryStateHandler : function(cmd, func, scope) { - add(queryStateCommands, cmd, func, scope); - }, - - addQueryValueHandler : function(cmd, func, scope) { - add(queryValueCommands, cmd, func, scope); - }, - - execCommand : function(scope, cmd, ui, value, args) { - if (cmd = execCommands[cmd.toLowerCase()]) { - if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false) - return true; - } - }, - - queryCommandValue : function() { - if (cmd = queryValueCommands[cmd.toLowerCase()]) - return cmd.func.call(scope || cmd.scope, ui, value, args); - }, - - queryCommandState : function() { - if (cmd = queryStateCommands[cmd.toLowerCase()]) - return cmd.func.call(scope || cmd.scope, ui, value, args); - } - }); - }; - - tinymce.GlobalCommands = new CommandManager(); -})(tinymce); (function(tinymce) { tinymce.Formatter = function(ed) { var formats = {}, @@ -12860,16 +15113,28 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { selection = ed.selection, TreeWalker = tinymce.dom.TreeWalker, rangeUtils = new tinymce.dom.RangeUtils(dom), - isValid = ed.schema.isValid, + isValid = ed.schema.isValidChild, isBlock = dom.isBlock, forcedRootBlock = ed.settings.forced_root_block, nodeIndex = dom.nodeIndex, - INVISIBLE_CHAR = '\uFEFF', + INVISIBLE_CHAR = tinymce.isGecko ? '\u200B' : '\uFEFF', MCE_ATTR_RE = /^(src|href|style)$/, FALSE = false, TRUE = true, - undefined, - pendingFormats = {apply : [], remove : []}; + undefined; + + // Returns the content editable state of a node + function getContentEditable(node) { + var contentEditable = node.getAttribute("data-mce-contenteditable"); + + // Check for fake content editable + if (contentEditable && contentEditable !== "inherit") { + return contentEditable; + } + + // Check for real content editable + return node.contentEditable !== "inherit" ? node.contentEditable : null; + }; function isArray(obj) { return obj instanceof Array; @@ -12880,7 +15145,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isCaretNode(node) { - return node.nodeType === 1 && (node.face === 'mceinline' || node.style.fontFamily === 'mceinline'); + return node.nodeType === 1 && node.id === '_mce_caret'; }; // Public functions @@ -12929,37 +15194,40 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }; - function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, i; + var getTextDecoration = function(node) { + var decoration; - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, - walker, node; - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1 || container.nodeValue === "") { - container = container.nodeType == 1 ? container.childNodes[offset] : container; - - // Might fail if the offset is behind the last element in it's container - if (container) { - walker = new TreeWalker(container, container.parentNode); - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - rng.setStart(node, 0); - break; - } - } - } + ed.dom.getParent(node, function(n) { + decoration = ed.dom.getStyle(n, 'text-decoration'); + return decoration && decoration !== 'none'; + }); + + return decoration; + }; + + var processUnderlineAndColor = function(node) { + var textDecoration; + if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { + textDecoration = getTextDecoration(node.parentNode); + if (ed.dom.getStyle(node, 'color') && textDecoration) { + ed.dom.setStyle(node, 'text-decoration', textDecoration); + } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { + ed.dom.setStyle(node, 'text-decoration', null); } + } + }; - return rng; - }; + function apply(name, vars, node) { + var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); function setElementFormat(elm, fmt) { fmt = fmt || format; if (elm) { + if (fmt.onformat) { + fmt.onformat(elm, fmt, vars, node); + } + each(fmt.styles, function(value, name) { dom.setStyle(elm, name, replaceVars(value, vars)); }); @@ -12976,9 +15244,90 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); } }; + function adjustSelectionToVisibleSelection() { + function findSelectionEnd(start, end) { + var walker = new TreeWalker(end); + for (node = walker.current(); node; node = walker.prev()) { + if (node.childNodes.length > 1 || node == start) { + return node; + } + } + }; + + // Adjust selection so that a end container with a end offset of zero is not included in the selection + // as this isn't visible to the user. + var rng = ed.selection.getRng(); + var start = rng.startContainer; + var end = rng.endContainer; + + if (start != end && rng.endOffset == 0) { + var newEnd = findSelectionEnd(start, end); + var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; + + rng.setEnd(newEnd, endOffset); + } + + return rng; + } + + function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ + var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; + + // find the index of the first child list. + each(node.childNodes, function(n, index) { + if (n.nodeName === "UL" || n.nodeName === "OL") { + listIndex = index; + list = n; + return false; + } + }); + + // get the index of the bookmarks + each(node.childNodes, function(n, index) { + if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { + if (n.id == bookmark.id + "_start") { + startIndex = index; + } else if (n.id == bookmark.id + "_end") { + endIndex = index; + } + } + }); + + // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally + if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { + each(tinymce.grep(node.childNodes), process); + return 0; + } else { + currentWrapElm = dom.clone(wrapElm, FALSE); + + // create a list of the nodes on the same side of the list as the selection + each(tinymce.grep(node.childNodes), function(n, index) { + if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { + nodes.push(n); + n.parentNode.removeChild(n); + } + }); + + // insert the wrapping element either before or after the list. + if (startIndex < listIndex) { + node.insertBefore(currentWrapElm, list); + } else if (startIndex > listIndex) { + node.insertBefore(currentWrapElm, list.nextSibling); + } + + // add the new nodes to the list. + newWrappers.push(currentWrapElm); + + each(nodes, function(node) { + currentWrapElm.appendChild(node); + }); + + return currentWrapElm; + } + }; - function applyRngStyle(rng) { - var newWrappers = [], wrapName, wrapElm; + function applyRngStyle(rng, bookmark, node_specific) { + var newWrappers = [], wrapName, wrapElm, contentEditable = true; // Setup wrapper element wrapName = format.inline || format.block; @@ -12989,7 +15338,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { var currentWrapElm; function process(node) { - var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found; + var nodeName, parentName, found, hasContentEditableState, lastContentEditable; + + lastContentEditable = contentEditable; + nodeName = node.nodeName.toLowerCase(); + parentName = node.parentNode.nodeName.toLowerCase(); + + // Node has a contentEditable value + if (node.nodeType === 1 && getContentEditable(node)) { + lastContentEditable = contentEditable; + contentEditable = getContentEditable(node) === "true"; + hasContentEditableState = true; // We don't want to wrap the container only it's children + } // Stop wrapping on br elements if (isEq(nodeName, 'br')) { @@ -13009,7 +15369,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Can we rename the block - if (format.block && !format.wrapper && isTextBlock(nodeName)) { + if (contentEditable && !hasContentEditableState && format.block && !format.wrapper && isTextBlock(nodeName)) { node = dom.rename(node, wrapName); setElementFormat(node); newWrappers.push(node); @@ -13021,6 +15381,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (format.selector) { // Look for matching formats each(formatList, function(format) { + // Check collapsed state if it exists + if ('collapsed' in format && format.collapsed !== isCollapsed) { + return; + } + if (dom.is(node, format.selector) && !isCaretNode(node)) { setElementFormat(node, format); found = true; @@ -13035,22 +15400,30 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Is it valid to wrap this item - if (isValid(wrapName, nodeName) && isValid(parentName, wrapName)) { + if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) && + !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node)) { // Start wrapping if (!currentWrapElm) { // Wrap the node - currentWrapElm = wrapElm.cloneNode(FALSE); + currentWrapElm = dom.clone(wrapElm, FALSE); node.parentNode.insertBefore(currentWrapElm, node); newWrappers.push(currentWrapElm); } currentWrapElm.appendChild(node); + } else if (nodeName == 'li' && bookmark) { + // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. + currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); } else { // Start a new wrapper for possible children currentWrapElm = 0; - + each(tinymce.grep(node.childNodes), process); + if (hasContentEditableState) { + contentEditable = lastContentEditable; // Restore last contentEditable state from stack + } + // End the last wrapper currentWrapElm = 0; } @@ -13060,7 +15433,32 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { each(nodes, process); }); + // Wrap links inside as well, for example color inside a link when the wrapper is around the link + if (format.wrap_links === false) { + each(newWrappers, function(node) { + function process(node) { + var i, currentWrapElm, children; + + if (node.nodeName === 'A') { + currentWrapElm = dom.clone(wrapElm, FALSE); + newWrappers.push(currentWrapElm); + + children = tinymce.grep(node.childNodes); + for (i = 0; i < children.length; i++) + currentWrapElm.appendChild(children[i]); + + node.appendChild(currentWrapElm); + } + + each(tinymce.grep(node.childNodes), process); + }; + + process(node); + }); + } + // Cleanup + each(newWrappers, function(node) { var childCount; @@ -13087,7 +15485,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // If child was found and of the same type as the current node if (child && matchName(child, format)) { - clone = child.cloneNode(FALSE); + clone = dom.clone(child, FALSE); setElementFormat(clone); dom.replace(clone, node, TRUE); @@ -13099,8 +15497,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { childCount = getChildCount(node); - // Remove empty nodes - if (childCount === 0) { + // Remove empty nodes but only if there is multiple wrappers and they are not block + // elements so never remove single

                since that would remove the currrent empty block element where the caret is at + if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { dom.remove(node, 1); return; } @@ -13116,6 +15515,19 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // this: text // will become: text each(dom.select(format.inline, node), function(child) { + var parent; + + // When wrap_links is set to false we don't want + // to remove the format on children within links + if (format.wrap_links === false) { + parent = child.parentNode; + + do { + if (parent.nodeName === 'A') + return; + } while (parent = parent.parentNode); + } + removeFormat(format, vars, child, format.exact ? child : null); }); }); @@ -13139,7 +15551,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Merge next and previous siblings if they are similar texttext becomes texttext - if (node) { + if (node && format.merge_siblings !== false) { node = mergeSiblings(getNonWhiteSpaceSibling(node), node); node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); } @@ -13149,20 +15561,38 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (format) { if (node) { - rng = dom.createRng(); - - rng.setStartBefore(node); - rng.setEndAfter(node); - - applyRngStyle(expandRng(rng, formatList)); + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + applyRngStyle(expandRng(rng, formatList), null, true); + } else { + applyRngStyle(node, null, true); + } } else { - if (!selection.isCollapsed() || !format.inline) { + if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { + // Obtain selection node before selection is unselected by applyRngStyle() + var curSelNode = ed.selection.getNode(); + + // If the formats have a default block and we can't find a parent block then start wrapping it with a DIV this is for forced_root_blocks: false + // It's kind of a hack but people should be using the default block type P since all desktop editors work that way + if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) { + apply(formatList[0].defaultBlock); + } + // Apply formatting to selection + ed.selection.setRng(adjustSelectionToVisibleSelection()); bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList)); + applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); + + // Colored nodes should be underlined so that the color of the underline matches the text color. + if (format.styles && (format.styles.color || format.styles.textDecoration)) { + tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); + processUnderlineAndColor(curSelNode); + } selection.moveToBookmark(bookmark); - selection.setRng(moveStart(selection.getRng(TRUE))); + moveStart(selection.getRng(TRUE)); ed.nodeChanged(); } else performCaretAction('apply', name, vars); @@ -13171,25 +15601,40 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function remove(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, i, rng; + var formatList = get(name), format = formatList[0], bookmark, i, rng, contentEditable = true; // Merges the styles for each node function process(node) { - var children, i, l; + var children, i, l, localContentEditable, lastContentEditable, hasContentEditableState; + + // Node has a contentEditable value + if (node.nodeType === 1 && getContentEditable(node)) { + lastContentEditable = contentEditable; + contentEditable = getContentEditable(node) === "true"; + hasContentEditableState = true; // We don't want to wrap the container only it's children + } // Grab the children first since the nodelist might be changed children = tinymce.grep(node.childNodes); // Process current node - for (i = 0, l = formatList.length; i < l; i++) { - if (removeFormat(formatList[i], vars, node, node)) - break; + if (contentEditable && !hasContentEditableState) { + for (i = 0, l = formatList.length; i < l; i++) { + if (removeFormat(formatList[i], vars, node, node)) + break; + } } // Process the children if (format.deep) { - for (i = 0, l = children.length; i < l; i++) - process(children[i]); + if (children.length) { + for (i = 0, l = children.length; i < l; i++) + process(children[i]); + + if (hasContentEditableState) { + contentEditable = lastContentEditable; // Restore last contentEditable state from stack + } + } } }; @@ -13220,7 +15665,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { formatRootParent = format_root.parentNode; for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { - clone = parent.cloneNode(FALSE); + clone = dom.clone(parent, FALSE); for (i = 0; i < formatList.length; i++) { if (removeFormat(formatList[i], vars, clone, clone)) { @@ -13285,8 +15730,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (startContainer != endContainer) { // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id : '_start', _mce_type : 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id : '_end', _mce_type : 'bookmark'}); + startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); + endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); // Split start/end splitToFormatRoot(startContainer); @@ -13309,30 +15754,56 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { rangeUtils.walk(rng, function(nodes) { each(nodes, function(node) { process(node); + + // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. + if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { + removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); + } }); }); }; // Handle node if (node) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + removeRngStyle(rng); + } else { + removeRngStyle(node); + } + return; } - if (!selection.isCollapsed() || !format.inline) { + if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { bookmark = selection.getBookmark(); removeRngStyle(selection.getRng(TRUE)); selection.moveToBookmark(bookmark); + + // Check if start element still has formatting then we are at: "text|text" and need to move the start into the next text node + if (format.inline && match(name, vars, selection.getStart())) { + moveStart(selection.getRng(true)); + } + ed.nodeChanged(); } else performCaretAction('remove', name, vars); + + // Removed this logic since it breaks unit tests and produces empty caret elements since they will be destroyed in the cleanup process + // Also there must be a better way to rerender a table and I couldn't reproduce the case causing this might be some old WebKit + /* + // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width + if (tinymce.isWebKit) { + ed.execCommand('mceCleanup'); + }*/ }; function toggle(name, vars, node) { - if (match(name, vars, node)) + var fmt = get(name); + + if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) remove(name, vars, node); else apply(name, vars, node); @@ -13344,6 +15815,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function matchItems(node, format, item_name) { var key, value, items = format[item_name], i; + // Custom match + if (format.onmatch) { + return format.onmatch(node, format, item_name); + } + // Check all items if (items) { // Non indexed object @@ -13396,7 +15872,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function match(name, vars, node) { - var startNode, i; + var startNode; function matchParents(node) { // Find first node with similar format settings @@ -13412,21 +15888,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (node) return matchParents(node); - // Check pending formats - if (selection.isCollapsed()) { - for (i = pendingFormats.apply.length - 1; i >= 0; i--) { - if (pendingFormats.apply[i].name == name) - return true; - } - - for (i = pendingFormats.remove.length - 1; i >= 0; i--) { - if (pendingFormats.remove[i].name == name) - return false; - } - - return matchParents(selection.getNode()); - } - // Check selected node node = selection.getNode(); if (matchParents(node)) @@ -13445,33 +15906,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function matchAll(names, vars) { var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; - // If the selection is collapsed then check pending formats - if (selection.isCollapsed()) { - for (ni = 0; ni < names.length; ni++) { - // If the name is to be removed, then stop it from being added - for (i = pendingFormats.remove.length - 1; i >= 0; i--) { - name = names[ni]; - - if (pendingFormats.remove[i].name == name) { - checkedMap[name] = true; - break; - } - } - } - - // If the format is to be applied - for (i = pendingFormats.apply.length - 1; i >= 0; i--) { - for (ni = 0; ni < names.length; ni++) { - name = names[ni]; - - if (!checkedMap[name] && pendingFormats.apply[i].name == name) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - } - } - // Check start of selection for formats startElement = selection.getStart(); dom.getParent(startElement, function(node) { @@ -13580,7 +16014,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\s\r\n]+|)$/.test(node.nodeValue); + return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); }; function wrap(node, name, attrs) { @@ -13593,39 +16027,64 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function expandRng(rng, format, remove) { - var startContainer = rng.startContainer, + var sibling, lastIdx, leaf, + startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, - endOffset = rng.endOffset, sibling, lastIdx; + endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(container, child_name, sibling_name, root) { - var parent, child; - - root = root || dom.getRoot(); + function findParentContainer(start) { + var container, parent, child, sibling, siblingName; - for (;;) { - // Check if we can move up are we at root level or body level - parent = container.parentNode; + container = parent = start ? startContainer : endContainer; + siblingName = start ? 'previousSibling' : 'nextSibling'; + root = dom.getRoot(); - // Stop expanding on block elements or root depending on format - if (parent == root || (!format[0].block_expand && isBlock(parent))) + // If it's a text node and the offset is inside the text + if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { + if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { return container; + } + } - for (sibling = parent[child_name]; sibling && sibling != container; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return container; + for (;;) { + // Stop expanding on block elements + if (!format[0].block_expand && isBlock(parent)) + return parent; + + // Walk left/right + for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { + if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { + return parent; + } + } - if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling)) - return container; + // Check if we can move up are we at root level or body level + if (parent.parentNode == root) { + container = parent; + break; } - container = container.parentNode; + parent = parent.parentNode; } return container; }; + // This function walks down the tree to find the leaf at the selection. + // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. + function findLeaf(node, offset) { + if (offset === undefined) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + while (node && node.hasChildNodes()) { + node = node.childNodes[offset]; + if (node) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + } + return { node: node, offset: offset }; + } + // If index based start position then resolve it if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { lastIdx = startContainer.childNodes.length - 1; @@ -13644,32 +16103,161 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { endOffset = endContainer.nodeValue.length; } - // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode)) - startContainer = startContainer.parentNode; + // Expands the node to the closes contentEditable false element if it exists + function findParentContentEditable(node) { + var parent = node; + + while (parent) { + if (parent.nodeType === 1 && getContentEditable(parent)) { + return getContentEditable(parent) === "false" ? parent : node; + } + + parent = parent.parentNode; + } + + return node; + }; - if (isBookmarkNode(startContainer)) + // Expand to closest contentEditable element + startContainer = findParentContentEditable(startContainer); + endContainer = findParentContentEditable(endContainer); + + // Exclude bookmark nodes if possible + if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { + startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; startContainer = startContainer.nextSibling || startContainer; - if (isBookmarkNode(endContainer.parentNode)) - endContainer = endContainer.parentNode; + if (startContainer.nodeType == 3) + startOffset = 0; + } - if (isBookmarkNode(endContainer)) + if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { + endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; endContainer = endContainer.previousSibling || endContainer; + if (endContainer.nodeType == 3) + endOffset = endContainer.length; + } + + if (format[0].inline) { + if (rng.collapsed) { + function findWordEndPoint(container, offset, start) { + var walker, node, pos, lastTextNode; + + function findSpace(node, offset) { + var pos, pos2, str = node.nodeValue; + + if (typeof(offset) == "undefined") { + offset = start ? str.length : 0; + } + + if (start) { + pos = str.lastIndexOf(' ', offset); + pos2 = str.lastIndexOf('\u00a0', offset); + pos = pos > pos2 ? pos : pos2; + + // Include the space on remove to avoid tag soup + if (pos !== -1 && !remove) { + pos++; + } + } else { + pos = str.indexOf(' ', offset); + pos2 = str.indexOf('\u00a0', offset); + pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; + } + + return pos; + }; + + if (container.nodeType === 3) { + pos = findSpace(container, offset); + + if (pos !== -1) { + return {container : container, offset : pos}; + } + + lastTextNode = container; + } + + // Walk the nodes inside the block + walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); + while (node = walker[start ? 'prev' : 'next']()) { + if (node.nodeType === 3) { + lastTextNode = node; + pos = findSpace(node); + + if (pos !== -1) { + return {container : node, offset : pos}; + } + } else if (isBlock(node)) { + break; + } + } + + if (lastTextNode) { + if (start) { + offset = 0; + } else { + offset = lastTextNode.length; + } + + return {container: lastTextNode, offset: offset}; + } + } + + // Expand left to closest word boundery + endPoint = findWordEndPoint(startContainer, startOffset, true); + if (endPoint) { + startContainer = endPoint.container; + startOffset = endPoint.offset; + } + + // Expand right to closest word boundery + endPoint = findWordEndPoint(endContainer, endOffset); + if (endPoint) { + endContainer = endPoint.container; + endOffset = endPoint.offset; + } + } + + // Avoid applying formatting to a trailing space. + leaf = findLeaf(endContainer, endOffset); + if (leaf.node) { + while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) + leaf = findLeaf(leaf.node.previousSibling); + + if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && + leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { + + if (leaf.offset > 1) { + endContainer = leaf.node; + endContainer.splitText(leaf.offset - 1); + } else if (leaf.node.previousSibling) { + // TODO: Figure out why this is in here + //endContainer = leaf.node.previousSibling; + } + } + } + } + // Move start/end point up the tree if the leaves are sharp and if we are in different containers // Example * becomes !: !

                *texttext*

                ! // This will reduce the number of wrapper elements that needs to be created // Move start point up the tree if (format[0].inline || format[0].block_expand) { - startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling'); - endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling'); + if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { + startContainer = findParentContainer(true); + } + + if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { + endContainer = findParentContainer(); + } } // Expand start/end container to matching selector if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { function findSelectorEndPoint(container, sibling_name) { - var parents, i, y; + var parents, i, y, curFormat; if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) container = container[sibling_name]; @@ -13677,7 +16265,13 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { parents = getParents(container); for (i = 0; i < parents.length; i++) { for (y = 0; y < format.length; y++) { - if (dom.is(parents[i], format[y].selector)) + curFormat = format[y]; + + // If collapsed state is set then skip formats that doesn't match that + if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) + continue; + + if (dom.is(parents[i], curFormat.selector)) return parents[i]; } } @@ -13731,10 +16325,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Non block element then try to expand up the leaf if (format[0].block) { if (!isBlock(startContainer)) - startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling'); + startContainer = findParentContainer(true); if (!isBlock(endContainer)) - endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling'); + endContainer = findParentContainer(); } } @@ -13787,7 +16381,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove style attribute if it's empty if (stylesModified && dom.getAttrib(node, 'style') == '') { node.removeAttribute('style'); - node.removeAttribute('_mce_style'); + node.removeAttribute('data-mce-style'); } // Remove attributes @@ -13828,7 +16422,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove mce prefixed attributes if (MCE_ATTR_RE.test(name)) - node.removeAttribute('_mce_' + name); + node.removeAttribute('data-mce-' + name); node.removeAttribute(name); } @@ -13913,7 +16507,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark'; + return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; }; function mergeSiblings(prev, next) { @@ -13959,184 +16553,394 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } } - // Check if obj 2 has something obj 1 doesn't have - for (name in obj2) { - // Obj2 has item obj1 doesn't have - if (obj2.hasOwnProperty(name)) - return FALSE; - } + // Check if obj 2 has something obj 1 doesn't have + for (name in obj2) { + // Obj2 has item obj1 doesn't have + if (obj2.hasOwnProperty(name)) + return FALSE; + } + + return TRUE; + }; + + // Attribs are not the same + if (!compareObjects(getAttribs(node1), getAttribs(node2))) + return FALSE; + + // Styles are not the same + if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) + return FALSE; + + return TRUE; + }; + + // Check if next/prev exists and that they are elements + if (prev && next) { + function findElementSibling(node, sibling_name) { + for (sibling = node; sibling; sibling = sibling[sibling_name]) { + if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) + return node; + + if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) + return sibling; + } + + return node; + }; + + // If previous sibling is empty then jump over it + prev = findElementSibling(prev, 'previousSibling'); + next = findElementSibling(next, 'nextSibling'); + + // Compare next and previous nodes + if (compareElements(prev, next)) { + // Append nodes between + for (sibling = prev.nextSibling; sibling && sibling != next;) { + tmpSibling = sibling; + sibling = sibling.nextSibling; + prev.appendChild(tmpSibling); + } + + // Remove next node + dom.remove(next); + + // Move children into prev node + each(tinymce.grep(next.childNodes), function(node) { + prev.appendChild(node); + }); + + return prev; + } + } + + return next; + }; + + function isTextBlock(name) { + return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name); + }; + + function getContainer(rng, start) { + var container, offset, lastIdx, walker; + + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + + if (container.nodeType == 1) { + lastIdx = container.childNodes.length - 1; + + if (!start && offset) + offset--; + + container = container.childNodes[offset > lastIdx ? lastIdx : offset]; + } + + // If start text node is excluded then walk to the next node + if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { + container = new TreeWalker(container, ed.getBody()).next() || container; + } + + // If end text node is excluded then walk to the previous node + if (container.nodeType === 3 && !start && offset == 0) { + container = new TreeWalker(container, ed.getBody()).prev() || container; + } + + return container; + }; + + function performCaretAction(type, name, vars) { + var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; + + // Creates a caret container bogus element + function createCaretContainer(fill) { + var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); + + if (fill) { + caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR)); + } + + return caretContainer; + }; + + function isCaretContainerEmpty(node, nodes) { + while (node) { + if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) { + return false; + } + + // Collect nodes + if (nodes && node.nodeType === 1) { + nodes.push(node); + } + + node = node.firstChild; + } + + return true; + }; + + // Returns any parent caret container element + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Removes the caret container for the specified node or all on the current document + function removeCaretContainer(node, move_caret) { + var child, rng; + + if (!node) { + node = getParentCaretContainer(selection.getStart()); + + if (!node) { + while (node = dom.get(caretContainerId)) { + removeCaretContainer(node, false); + } + } + } else { + rng = selection.getRng(true); + + if (isCaretContainerEmpty(node)) { + if (move_caret !== false) { + rng.setStartBefore(node); + rng.setEndBefore(node); + } + + dom.remove(node); + } else { + child = findFirstTextNode(node); + + if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) { + child = child.deleteData(0, 1); + } + + dom.remove(node, 1); + } + + selection.setRng(rng); + } + }; + + // Applies formatting to the caret postion + function applyCaretFormat() { + var rng, caretContainer, textNode, offset, bookmark, container, text; + + rng = selection.getRng(true); + offset = rng.startOffset; + container = rng.startContainer; + text = container.nodeValue; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer) { + textNode = findFirstTextNode(caretContainer); + } + + // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character + if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); - return TRUE; - }; + // Collapse bookmark range (WebKit) + rng.collapse(true); - // Attribs are not the same - if (!compareObjects(getAttribs(node1), getAttribs(node2))) - return FALSE; + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name)); + rng = rangeUtils.split(rng); - // Styles are not the same - if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) - return FALSE; + // Apply the format to the range + apply(name, vars, rng); - return TRUE; - }; + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) { + caretContainer = createCaretContainer(true); + textNode = caretContainer.firstChild; - // Check if next/prev exists and that they are elements - if (prev && next) { - function findElementSibling(node, sibling_name) { - for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling)) - return node; + rng.insertNode(caretContainer); + offset = 1; - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return sibling; + apply(name, vars, caretContainer); + } else { + apply(name, vars, caretContainer); } - return node; - }; + // Move selection to text node + selection.setCursorLocation(textNode, offset); + } + }; - // If previous sibling is empty then jump over it - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); + function removeCaretFormat() { + var rng = selection.getRng(true), container, offset, bookmark, + hasContentAfter, node, formatNode, parents = [], i, caretContainer; - // Compare next and previous nodes - if (compareElements(prev, next)) { - // Append nodes between - for (sibling = prev.nextSibling; sibling && sibling != next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); + container = rng.startContainer; + offset = rng.startOffset; + node = container; + + if (container.nodeType == 3) { + if (offset != container.nodeValue.length || container.nodeValue === INVISIBLE_CHAR) { + hasContentAfter = true; } - // Remove next node - dom.remove(next); + node = node.parentNode; + } - // Move children into prev node - each(tinymce.grep(next.childNodes), function(node) { - prev.appendChild(node); - }); + while (node) { + if (matchNode(node, name, vars)) { + formatNode = node; + break; + } - return prev; + if (node.nextSibling) { + hasContentAfter = true; + } + + parents.push(node); + node = node.parentNode; } - } - return next; - }; + // Node doesn't have the specified format + if (!formatNode) { + return; + } - function isTextBlock(name) { - return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name); - }; + // Is there contents after the caret then remove the format on the element + if (hasContentAfter) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); - function getContainer(rng, start) { - var container, offset, lastIdx; + // Collapse bookmark range (WebKit) + rng.collapse(true); - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name), true); + rng = rangeUtils.split(rng); - if (container.nodeType == 1) { - lastIdx = container.childNodes.length - 1; + // Remove the format from the range + remove(name, vars, rng); - if (!start && offset) - offset--; + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + caretContainer = createCaretContainer(); - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } + node = caretContainer; + for (i = parents.length - 1; i >= 0; i--) { + node.appendChild(dom.clone(parents[i], false)); + node = node.firstChild; + } - return container; - }; + // Insert invisible character into inner most format element + node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR)); + node = node.firstChild; - function performCaretAction(type, name, vars) { - var i, currentPendingFormats = pendingFormats[type], - otherPendingFormats = pendingFormats[type == 'apply' ? 'remove' : 'apply']; + // Insert caret container after the formated node + dom.insertAfter(caretContainer, formatNode); - function hasPending() { - return pendingFormats.apply.length || pendingFormats.remove.length; + // Move selection to text node + selection.setCursorLocation(node, 1); + } }; - function resetPending() { - pendingFormats.apply = []; - pendingFormats.remove = []; - }; + // Only bind the caret events once + if (!self._hasCaretEvents) { + // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements + ed.onBeforeGetContent.addToTop(function() { + var nodes = [], i; + + if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { + // Mark children + i = nodes.length; + while (i--) { + dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); + } + } + }); - function perform(caret_node) { - // Apply pending formats - each(pendingFormats.apply.reverse(), function(item) { - apply(item.name, item.vars, caret_node); + // Remove caret container on mouse up and on key up + tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { + ed[name].addToTop(function() { + removeCaretContainer(); + }); }); - // Remove pending formats - each(pendingFormats.remove.reverse(), function(item) { - remove(item.name, item.vars, caret_node); + // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys + ed.onKeyDown.addToTop(function(ed, e) { + var keyCode = e.keyCode; + + if (keyCode == 8 || keyCode == 37 || keyCode == 39) { + removeCaretContainer(getParentCaretContainer(selection.getStart())); + } }); - dom.remove(caret_node, 1); - resetPending(); - }; + self._hasCaretEvents = true; + } - // Check if it already exists then ignore it - for (i = currentPendingFormats.length - 1; i >= 0; i--) { - if (currentPendingFormats[i].name == name) - return; + // Do apply or remove caret format + if (type == "apply") { + applyCaretFormat(); + } else { + removeCaretFormat(); } + }; - currentPendingFormats.push({name : name, vars : vars}); + function moveStart(rng) { + var container = rng.startContainer, + offset = rng.startOffset, + walker, node, nodes, tmpNode; - // Check if it's in the other type, then remove it - for (i = otherPendingFormats.length - 1; i >= 0; i--) { - if (otherPendingFormats[i].name == name) - otherPendingFormats.splice(i, 1); + // Convert text node into index if possible + if (container.nodeType == 3 && offset >= container.nodeValue.length) { + // Get the parent container location and walk from there + container = container.parentNode; + offset = nodeIndex(container) + 1; } - // Pending apply or remove formats - if (hasPending()) { - ed.getDoc().execCommand('FontName', false, 'mceinline'); - pendingFormats.lastRng = selection.getRng(); - - // IE will convert the current word - each(dom.select('font,span'), function(node) { - var bookmark; + // Move startContainer/startOffset in to a suitable node + if (container.nodeType == 1) { + nodes = container.childNodes; + container = nodes[Math.min(offset, nodes.length - 1)]; + walker = new TreeWalker(container, dom.getParent(container, dom.isBlock)); + + // If offset is at end of the parent node walk to the next one + if (offset > nodes.length - 1) + walker.next(); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { + // IE has a "neat" feature where it moves the start node into the closest element + // we can avoid this by inserting an element before it and then remove it after we set the selection + tmpNode = dom.create('a', null, INVISIBLE_CHAR); + node.parentNode.insertBefore(tmpNode, node); + + // Set selection and remove tmpNode + rng.setStart(node, 0); + selection.setRng(rng); + dom.remove(tmpNode); - if (isCaretNode(node)) { - bookmark = selection.getBookmark(); - perform(node); - selection.moveToBookmark(bookmark); - ed.nodeChanged(); + return; } - }); - - // Only register listeners once if we need to - if (!pendingFormats.isListening && hasPending()) { - pendingFormats.isListening = true; - - each('onKeyDown,onKeyUp,onKeyPress,onMouseUp'.split(','), function(event) { - ed[event].addToTop(function(ed, e) { - // Do we have pending formats and is the selection moved has moved - if (hasPending() && !tinymce.dom.RangeUtils.compareRanges(pendingFormats.lastRng, selection.getRng())) { - each(dom.select('font,span'), function(node) { - var textNode, rng; - - // Look for marker - if (isCaretNode(node)) { - textNode = node.firstChild; - - if (textNode) { - perform(node); - - rng = dom.createRng(); - rng.setStart(textNode, textNode.nodeValue.length); - rng.setEnd(textNode, textNode.nodeValue.length); - selection.setRng(rng); - ed.nodeChanged(); - } else - dom.remove(node); - } - }); - - // Always unbind and clear pending styles on keyup - if (e.type == 'keyup' || e.type == 'mouseup') - resetPending(); - } - }); - }); } } }; @@ -14147,12 +16951,15 @@ tinymce.onAddEditor.add(function(tinymce, ed) { var filters, fontSizes, dom, settings = ed.settings; if (settings.inline_styles) { - fontSizes = tinymce.explode(settings.font_size_style_values); + fontSizes = tinymce.explode(settings.font_size_legacy_values); function replaceWithSpan(node, styles) { - dom.replace(dom.create('span', { - style : styles - }), node, 1); + tinymce.each(styles, function(value, name) { + if (value) + dom.setStyle(node, name, value); + }); + + dom.rename(node, 'span'); }; filters = { @@ -14189,6 +16996,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { }; ed.onPreProcess.add(convert); + ed.onSetContent.add(convert); ed.onInit.add(function() { ed.selection.onSetContent.add(convert); @@ -14196,3 +17004,393 @@ tinymce.onAddEditor.add(function(tinymce, ed) { } }); +(function(tinymce) { + var TreeWalker = tinymce.dom.TreeWalker; + + tinymce.EnterKey = function(editor) { + var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager; + + function handleEnterKey(evt) { + var rng = selection.getRng(true), tmpRng, container, offset, parentBlock, newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName; + + // Returns true if the block can be split into two blocks or not + function canSplitBlock(node) { + return node && dom.isBlock(node) && !/^(TD|TH|CAPTION)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position); + }; + + // Moves the caret to a suitable position within the root for example in the first non pure whitespace text node or before an image + function moveToCaretPosition(root) { + var walker, node, rng, y, viewPort, lastNode = root; + + rng = dom.createRng(); + + if (root.hasChildNodes()) { + walker = new TreeWalker(root, root); + + while (node = walker.current()) { + if (node.nodeType == 3) { + rng.setStart(node, 0); + rng.setEnd(node, 0); + break; + } + + if (/^(BR|IMG)$/.test(node.nodeName)) { + rng.setStartBefore(node); + rng.setEndBefore(node); + break; + } + + lastNode = node; + node = walker.next(); + } + + if (!node) { + rng.setStart(lastNode, 0); + rng.setEnd(lastNode, 0); + } + } else { + if (root.nodeName == 'BR') { + rng.setStartAfter(root); + rng.setEndAfter(root); + } else { + rng.setStart(root, 0); + rng.setEnd(root, 0); + } + } + + selection.setRng(rng); + + viewPort = dom.getViewPort(editor.getWin()); + + // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs + y = dom.getPos(root).y; + if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) { + editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks + } + }; + + // Creates a new block element by cloning the current one or creating a new one if the name is specified + // This function will also copy any text formatting from the parent block and add it to the new one + function createNewBlock(name) { + var node = container, block, clonedNode, caretNode; + + block = name ? dom.create(name) : parentBlock.cloneNode(false); + caretNode = block; + + // Clone any parent styles + do { + if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) { + clonedNode = node.cloneNode(false); + dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique + + if (block.hasChildNodes()) { + clonedNode.appendChild(block.firstChild); + block.appendChild(clonedNode); + } else { + caretNode = clonedNode; + block.appendChild(clonedNode); + } + } + } while (node = node.parentNode); + + // BR is needed in empty blocks on non IE browsers + if (!tinymce.isIE) { + caretNode.innerHTML = '
                '; + } + + return block; + }; + + // Returns true/false if the caret is at the start/end of the parent block element + function isCaretAtStartOrEndOfBlock(start) { + var walker, node; + + // Caret is in the middle of a text node like "a|b" + if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) { + return false; + } + + // Walk the DOM and look for text nodes or non empty elements + walker = new TreeWalker(container, parentBlock); + while (node = (start ? walker.prev() : walker.next())) { + if (node.nodeType === 1) { + // Ignore bogus elements + if (node.getAttribute('data-mce-bogus')) { + continue; + } + + // Keep empty elements like + name = node.nodeName.toLowerCase(); + if (name === 'IMG') { + return false; + } + } else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) { + return false; + } + } + + return true; + }; + + // Wraps any text nodes or inline elements in the specified forced root block name + function wrapSelfAndSiblingsInDefaultBlock(container, offset) { + var newBlock, parentBlock, startNode, node, next; + + // Not in a block element or in a table cell or caption + parentBlock = dom.getParent(container, dom.isBlock); + if (newBlockName && !evt.shiftKey && (!parentBlock || !canSplitBlock(parentBlock))) { + parentBlock = parentBlock || dom.getRoot(); + + if (!parentBlock.hasChildNodes()) { + newBlock = dom.create(newBlockName); + parentBlock.appendChild(newBlock); + rng.setStart(newBlock, 0); + rng.setEnd(newBlock, 0); + return newBlock; + } + + // Find parent that is the first child of parentBlock + node = container; + while (node.parentNode != parentBlock) { + node = node.parentNode; + } + + // Loop left to find start node start wrapping at + while (node && !dom.isBlock(node)) { + startNode = node; + node = node.previousSibling; + } + + if (startNode) { + newBlock = dom.create(newBlockName); + startNode.parentNode.insertBefore(newBlock, startNode); + + // Start wrapping until we hit a block + node = startNode; + while (node && !dom.isBlock(node)) { + next = node.nextSibling; + newBlock.appendChild(node); + node = next; + } + + // Restore range to it's past location + rng.setStart(container, offset); + rng.setEnd(container, offset); + } + } + + return container; + }; + + // Inserts a block or br before/after or in the middle of a split list of the LI is empty + function handleEmptyListItem() { + function isFirstOrLastLi(first) { + var node = containerBlock[first ? 'firstChild' : 'lastChild']; + + // Find first/last element since there might be whitespace there + while (node) { + if (node.nodeType == 1) { + break; + } + + node = node[first ? 'nextSibling' : 'previousSibling']; + } + + return node === parentBlock; + }; + + newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR'); + + if (isFirstOrLastLi(true) && isFirstOrLastLi()) { + // Is first and last list item then replace the OL/UL with a text block + dom.replace(newBlock, containerBlock); + } else if (isFirstOrLastLi(true)) { + // First LI in list then remove LI and add text block before list + containerBlock.parentNode.insertBefore(newBlock, containerBlock); + } else if (isFirstOrLastLi()) { + // Last LI in list then temove LI and add text block after list + dom.insertAfter(newBlock, containerBlock); + } else { + // Middle LI in list the split the list and insert a text block in the middle + // Extract after fragment and insert it after the current block + tmpRng = rng.cloneRange(); + tmpRng.setStartAfter(parentBlock); + tmpRng.setEndAfter(containerBlock); + fragment = tmpRng.extractContents(); + dom.insertAfter(fragment, containerBlock); + dom.insertAfter(newBlock, containerBlock); + } + + dom.remove(parentBlock); + moveToCaretPosition(newBlock); + undoManager.add(); + }; + + // Walks the parent block to the right and look for BR elements + function hasRightSideBr() { + var walker = new TreeWalker(container, parentBlock), node; + + while (node = walker.current()) { + if (node.nodeName == 'BR') { + return true; + } + + node = walker.next(); + } + } + + // Inserts a BR element if the forced_root_block option is set to false or empty string + function insertBr() { + var brElm, extraBr, documentMode; + + if (container && container.nodeType == 3 && offset >= container.nodeValue.length) { + // Insert extra BR element at the end block elements + if (!tinymce.isIE && !hasRightSideBr()) { + brElm = dom.create('br') + rng.insertNode(brElm); + rng.setStartAfter(brElm); + rng.setEndAfter(brElm); + extraBr = true; + } + } + + brElm = dom.create('br'); + rng.insertNode(brElm); + + // Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it + documentMode = dom.doc.documentMode; + if (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) { + brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm); + } + + if (!extraBr) { + rng.setStartAfter(brElm); + rng.setEndAfter(brElm); + } else { + rng.setStartBefore(brElm); + rng.setEndBefore(brElm); + } + + selection.setRng(rng); + undoManager.add(); + }; + + // Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element + function trimLeadingLineBreaks(node) { + do { + if (node.nodeType === 3) { + node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, ''); + } + + node = node.firstChild; + } while (node); + }; + + // Delete any selected contents + if (!rng.collapsed) { + editor.execCommand('Delete'); + return; + } + + // Event is blocked by some other handler for example the lists plugin + if (evt.isDefaultPrevented()) { + return; + } + + // Setup range items and newBlockName + container = rng.startContainer; + offset = rng.startOffset; + newBlockName = settings.forced_root_block; + newBlockName = newBlockName ? newBlockName.toUpperCase() : ''; + + // Resolve node index + if (container.nodeType == 1 && container.hasChildNodes()) { + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + offset = 0; + } + + undoManager.beforeChange(); + + // Wrap the current node and it's sibling in a default block if it's needed. + // for example this
                will become this + container = wrapSelfAndSiblingsInDefaultBlock(container, offset); + + // Find parent block and setup empty block paddings + parentBlock = dom.getParent(container, dom.isBlock); + containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; + + // Setup block names + parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5 + containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5 + + // Handle enter inside an empty list item + if (parentBlockName == 'LI' && dom.isEmpty(parentBlock)) { + // Let the list plugin or browser handle nested lists for now + if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) { + return false; + } + + handleEmptyListItem(); + return; + } + + // Don't split PRE tags but insert a BR instead easier when writing code samples etc + if (parentBlockName == 'PRE' && settings.br_in_pre !== false) { + if (!evt.shiftKey) { + insertBr(); + return; + } + } else { + // If no root block is configured then insert a BR by default or if the shiftKey is pressed + if ((!newBlockName && !evt.shiftKey && parentBlockName != 'LI') || (newBlockName && evt.shiftKey)) { + insertBr(); + return; + } + } + + // Default block name if it's not configured + newBlockName = newBlockName || 'P'; + + // Insert new block before/after the parent block depending on caret location + if (isCaretAtStartOrEndOfBlock()) { + // If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup + if (/^(H[1-6]|PRE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') { + newBlock = createNewBlock(newBlockName); + } else { + newBlock = createNewBlock(); + } + + // Split the current container block element if enter is pressed inside an empty inner block element + if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) { + // Split container block for example a BLOCKQUOTE at the current blockParent location for example a P + newBlock = dom.split(containerBlock, parentBlock); + } else { + dom.insertAfter(newBlock, parentBlock); + } + } else if (isCaretAtStartOrEndOfBlock(true)) { + // Insert new block before + newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock); + } else { + // Extract after fragment and insert it after the current block + tmpRng = rng.cloneRange(); + tmpRng.setEndAfter(parentBlock); + fragment = tmpRng.extractContents(); + trimLeadingLineBreaks(fragment); + newBlock = fragment.firstChild; + dom.insertAfter(fragment, parentBlock); + } + + dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique + moveToCaretPosition(newBlock); + undoManager.add(); + } + + editor.onKeyDown.add(function(ed, evt) { + if (evt.keyCode == 13) { + if (handleEnterKey(evt) !== false) { + evt.preventDefault(); + } + } + }); + }; +})(tinymce); diff --git a/library/tinymce/jscripts/tiny_mce/utils/editable_selects.js b/library/tinymce/jscripts/tiny_mce/utils/editable_selects.js old mode 100755 new mode 100644 index fd943c0f87..4b920f3d1a --- a/library/tinymce/jscripts/tiny_mce/utils/editable_selects.js +++ b/library/tinymce/jscripts/tiny_mce/utils/editable_selects.js @@ -16,7 +16,7 @@ var TinyMCE_EditableSelects = { for (i=0; i'; - h += ' '; + if (label = dom.select('label[for=' + target_form_element + ']')[0]) { + label.id = label.id || dom.uniqueId(); + } + + h += ''; + h += ' '; return h; } @@ -67,6 +71,9 @@ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { if (!form_obj || !form_obj.elements[field_name]) return; + if (!value) + value = ""; + var sel = form_obj.elements[field_name]; var found = false; @@ -171,7 +178,7 @@ function convertHexToRGB(col) { } function trimSize(size) { - return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2'); + return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2'); } function getCSSSize(size) { @@ -183,6 +190,9 @@ function getCSSSize(size) { // Add px if (/^[0-9]+$/.test(size)) size += 'px'; + // Sanity check, IE doesn't like broken values + else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size))) + return ""; return size; } diff --git a/library/tinymce/jscripts/tiny_mce/utils/mctabs.js b/library/tinymce/jscripts/tiny_mce/utils/mctabs.js old mode 100755 new mode 100644 index 825d4c1433..458ec86da6 --- a/library/tinymce/jscripts/tiny_mce/utils/mctabs.js +++ b/library/tinymce/jscripts/tiny_mce/utils/mctabs.js @@ -10,6 +10,7 @@ function MCTabs() { this.settings = []; + this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher'); }; MCTabs.prototype.init = function(settings) { @@ -28,26 +29,62 @@ MCTabs.prototype.getParam = function(name, default_value) { return value; }; -MCTabs.prototype.displayTab = function(tab_id, panel_id) { - var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i; +MCTabs.prototype.showTab =function(tab){ + tab.className = 'current'; + tab.setAttribute("aria-selected", true); + tab.setAttribute("aria-expanded", true); + tab.tabIndex = 0; +}; + +MCTabs.prototype.hideTab =function(tab){ + var t=this; + + tab.className = ''; + tab.setAttribute("aria-selected", false); + tab.setAttribute("aria-expanded", false); + tab.tabIndex = -1; +}; + +MCTabs.prototype.showPanel = function(panel) { + panel.className = 'current'; + panel.setAttribute("aria-hidden", false); +}; + +MCTabs.prototype.hidePanel = function(panel) { + panel.className = 'panel'; + panel.setAttribute("aria-hidden", true); +}; + +MCTabs.prototype.getPanelForTab = function(tabElm) { + return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls"); +}; + +MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) { + var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this; + + tabElm = document.getElementById(tab_id); + + if (panel_id === undefined) { + panel_id = t.getPanelForTab(tabElm); + } panelElm= document.getElementById(panel_id); panelContainerElm = panelElm ? panelElm.parentNode : null; - tabElm = document.getElementById(tab_id); tabContainerElm = tabElm ? tabElm.parentNode : null; - selectionClass = this.getParam('selection_class', 'current'); + selectionClass = t.getParam('selection_class', 'current'); if (tabElm && tabContainerElm) { nodes = tabContainerElm.childNodes; // Hide all other tabs for (i = 0; i < nodes.length; i++) { - if (nodes[i].nodeName == "LI") - nodes[i].className = ''; + if (nodes[i].nodeName == "LI") { + t.hideTab(nodes[i]); + } } // Show selected tab - tabElm.className = 'current'; + t.showTab(tabElm); } if (panelElm && panelContainerElm) { @@ -56,11 +93,15 @@ MCTabs.prototype.displayTab = function(tab_id, panel_id) { // Hide all other panels for (i = 0; i < nodes.length; i++) { if (nodes[i].nodeName == "DIV") - nodes[i].className = 'panel'; + t.hidePanel(nodes[i]); + } + + if (!avoid_focus) { + tabElm.focus(); } // Show selected panel - panelElm.className = 'current'; + t.showPanel(panelElm); } }; @@ -73,5 +114,49 @@ MCTabs.prototype.getAnchor = function() { return ""; }; -// Global instance + +//Global instance var mcTabs = new MCTabs(); + +tinyMCEPopup.onInit.add(function() { + var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each; + + each(dom.select('div.tabs'), function(tabContainerElm) { + var keyNav; + + dom.setAttrib(tabContainerElm, "role", "tablist"); + + var items = tinyMCEPopup.dom.select('li', tabContainerElm); + var action = function(id) { + mcTabs.displayTab(id, mcTabs.getPanelForTab(id)); + mcTabs.onChange.dispatch(id); + }; + + each(items, function(item) { + dom.setAttrib(item, 'role', 'tab'); + dom.bind(item, 'click', function(evt) { + action(item.id); + }); + }); + + dom.bind(dom.getRoot(), 'keydown', function(evt) { + if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab + keyNav.moveFocus(evt.shiftKey ? -1 : 1); + tinymce.dom.Event.cancel(evt); + } + }); + + each(dom.select('a', tabContainerElm), function(a) { + dom.setAttrib(a, 'tabindex', '-1'); + }); + + keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: tabContainerElm, + items: items, + onAction: action, + actOnFocus: true, + enableLeftRight: true, + enableUpDown: true + }, tinyMCEPopup.dom); + }); +}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/utils/validate.js b/library/tinymce/jscripts/tiny_mce/utils/validate.js old mode 100755 new mode 100644 index a6fcf97015..27cbfab811 --- a/library/tinymce/jscripts/tiny_mce/utils/validate.js +++ b/library/tinymce/jscripts/tiny_mce/utils/validate.js @@ -32,7 +32,7 @@ var Validator = { }, isSize : function(s) { - return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); + return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); }, isId : function(s) { @@ -96,8 +96,10 @@ var AutoValidator = { var i, nl, s = this.settings, c = 0; nl = this.tags(f, 'label'); - for (i=0; i
                 
                - +
                @@ -162,10 +163,10 @@ - - + + <\/tr>/g, ''); return html; } diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js old mode 100755 new mode 100644 index fd9700f222..cc891c1711 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js @@ -1,253 +1,345 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', - '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', - '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', - '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', - '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', - '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', - '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', - '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', - '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', - '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', - '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', - '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', - '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', - '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' -}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - tinyMCEPopup.restoreSelection(); - - if (f) - f(color); - - tinyMCEPopup.close(); -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toLowerCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
                '; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - h += '
                 
                - +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/blank.htm b/library/tinymce/jscripts/tiny_mce/plugins/template/blank.htm old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/css/template.css b/library/tinymce/jscripts/tiny_mce/plugins/template/css/template.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/js/template.js b/library/tinymce/jscripts/tiny_mce/plugins/template/js/template.js old mode 100755 new mode 100644 index 24045d7311..bc3045d244 --- a/library/tinymce/jscripts/tiny_mce/plugins/template/js/template.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/template/js/template.js @@ -42,7 +42,7 @@ var TemplateDialog = { if (e) { e.style.height = Math.abs(h) + 'px'; - e.style.width = Math.abs(w - 5) + 'px'; + e.style.width = Math.abs(w - 5) + 'px'; } }, diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js old mode 100755 new mode 100644 index 2471c3fa04..83e599d68f --- a/library/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js @@ -1,15 +1 @@ -tinyMCE.addI18n('en.template_dlg',{ -title:"Templates", -label:"Template", -desc_label:"Description", -desc:"Insert predefined template content", -select:"Select a template", -preview:"Preview", -warning:"Warning: Updating a template with a different one may cause data loss.", -mdate_format:"%Y-%m-%d %H:%M:%S", -cdate_format:"%Y-%m-%d %H:%M:%S", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}); \ No newline at end of file +tinyMCE.addI18n('en.template_dlg',{title:"Templates",label:"Template","desc_label":"Description",desc:"Insert Predefined Template Content",select:"Select a Template",preview:"Preview",warning:"Warning: Updating a template with a different one may cause data loss.","mdate_format":"%Y-%m-%d %H:%M:%S","cdate_format":"%Y-%m-%d %H:%M:%S","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/template/template.htm b/library/tinymce/jscripts/tiny_mce/plugins/template/template.htm old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css b/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css new file mode 100644 index 0000000000..17b9aeff16 --- /dev/null +++ b/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/css/visualblocks.css @@ -0,0 +1,19 @@ +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat} +p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre {margin-left: 3px} +section, article, address, hgroup, aside {margin: 1em 0 0 3px} + +p {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)} +h1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)} +h2 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)} +h3 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)} +h4 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)} +h5 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)} +h6 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)} +div {background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)} +section {background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)} +article {background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)} +blockquote {background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)} +address {background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)} +pre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)} +hgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)} +aside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)} diff --git a/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js new file mode 100644 index 0000000000..62cc2e4ced --- /dev/null +++ b/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks")}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js new file mode 100644 index 0000000000..e74c0bdc0d --- /dev/null +++ b/library/tinymce/jscripts/tiny_mce/plugins/visualblocks/editor_plugin_src.js @@ -0,0 +1,63 @@ +/** + * editor_plugin_src.js + * + * Copyright 2012, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualBlocks', { + init : function(ed, url) { + var cssId; + + // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects + if (!window.NodeList) { + return; + } + + ed.addCommand('mceVisualBlocks', function() { + var dom = ed.dom, linkElm; + + if (!cssId) { + cssId = dom.uniqueId(); + linkElm = dom.create('link', { + id: cssId, + rel : 'stylesheet', + href : url + '/css/visualblocks.css' + }); + + ed.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); + } else { + linkElm = dom.get(cssId); + linkElm.disabled = !linkElm.disabled; + } + + ed.controlManager.setActive('visualblocks', !linkElm.disabled); + }); + + ed.addButton('visualblocks', {title : 'visualblocks.desc', cmd : 'mceVisualBlocks'}); + + ed.onInit.add(function() { + if (ed.settings.visualblocks_default_state) { + ed.execCommand('mceVisualBlocks'); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual blocks', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('visualblocks', tinymce.plugins.VisualBlocks); +})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js old mode 100755 new mode 100644 index 53d31c44fa..1a148e8b4f --- a/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state){c.state=true;c._toggleVisualChars()}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(){var m=this,g=m.editor,a,e,f,k=g.getDoc(),l=g.getBody(),j,n=g.selection,c;m.state=!m.state;g.controlManager.setActive("visualchars",m.state);if(m.state){a=[];tinymce.walk(l,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(e=0;e$1');j=j.replace(/\u00a0/g,"\u00b7");g.dom.setOuterHTML(a[e],j,k)}}else{a=tinymce.grep(g.dom.select("span",l),function(b){return g.dom.hasClass(b,"mceVisualNbsp")});for(e=0;e$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js old mode 100755 new mode 100644 index 0a5275fe28..df985905b6 --- a/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js @@ -22,9 +22,9 @@ ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); ed.onBeforeGetContent.add(function(ed, o) { - if (t.state) { + if (t.state && o.format != 'raw' && !o.draft) { t.state = true; - t._toggleVisualChars(); + t._toggleVisualChars(false); } }); }, @@ -41,12 +41,15 @@ // Private methods - _toggleVisualChars : function() { - var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo; + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; t.state = !t.state; ed.controlManager.setActive('visualchars', t.state); + if (bookmark) + bm = s.getBookmark(); + if (t.state) { nl = []; tinymce.walk(b, function(n) { @@ -54,20 +57,24 @@ nl.push(n); }, 'childNodes'); - for (i=0; i$1'); - nv = nv.replace(/\u00a0/g, '\u00b7'); - ed.dom.setOuterHTML(nl[i], nv, d); + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); } } else { - nl = tinymce.grep(ed.dom.select('span', b), function(n) { - return ed.dom.hasClass(n, 'mceVisualNbsp'); - }); + nl = ed.dom.select('span.mceItemNbsp', b); - for (i=0; i= 0; i--) + ed.dom.remove(nl[i], 1); } + + s.moveToBookmark(bm); } }); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js old mode 100755 new mode 100644 index a099e6a8c5..42ece2092f --- a/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(h,"span",{},'0')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(k,"span",{},'0')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js old mode 100755 new mode 100644 index 5cb92fa0f0..34b265553f --- a/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin_src.js @@ -9,17 +9,19 @@ */ (function() { - tinymce.create('tinymce.plugins.WordCount', { + tinymce.create('tinymce.plugins.WordCount', { block : 0, id : null, countre : null, cleanre : null, init : function(ed, url) { - var t = this, last = 0; + var t = this, last = 0, VK = tinymce.VK; - t.countre = ed.getParam('wordcount_countregex', /\S\s+/g); - t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g); + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); + t.update_rate = ed.getParam('wordcount_update_rate', 2000); + t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); t.id = ed.id + '-word-count'; ed.onPostRender.add(function(ed, cm) { @@ -32,11 +34,12 @@ if (row) tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); - } else + } else { tinymce.DOM.add(id, 'span', {}, '0'); + } }); - ed.onInit.add(function(ed) { + ed.onInit.add(function(ed) { ed.selection.onSetContent.add(function() { t._count(ed); }); @@ -48,19 +51,46 @@ t._count(ed); }); - ed.onKeyUp.add(function(ed, e) { - if (e.keyCode == last) - return; + function checkKeys(key) { + return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); + } - if (13 == e.keyCode || 8 == last || 46 == last) + function checkDelOrBksp(key) { + return key === VK.DELETE || key === VK.BACKSPACE; + } + + ed.onKeyUp.add(function(ed, e) { + if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { t._count(ed); + } last = e.keyCode; }); }, + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + _count : function(ed) { - var t = this, tc = 0; + var t = this; // Keep multiple calls from happening at the same time if (t.block) @@ -69,21 +99,15 @@ t.block = 1; setTimeout(function() { - var tx = ed.getContent({format : 'raw'}); - - if (tx) { - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation - tx.replace(t.countre, function() {tc++;}); // count the words + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, t.update_rate); } - - tinymce.DOM.setHTML(t.id, tc.toString()); - - setTimeout(function() {t.block = 0;}, 2000); }, 1); }, - getInfo: function() { + getInfo: function() { return { longname : 'Word Count plugin', author : 'Moxiecode Systems AB', @@ -91,8 +115,8 @@ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', version : tinymce.majorVersion + "." + tinymce.minorVersion }; - } - }); + } + }); - tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); })(); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm old mode 100755 new mode 100644 index 3aeac0deba..30a894f7c3 --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm @@ -10,11 +10,12 @@ - + + @@ -23,7 +24,7 @@
                {#xhtmlxtras_dlg.fieldset_attrib_tab} -
                 
                +
                @@ -41,7 +42,7 @@ - + @@ -67,7 +68,7 @@
                {#xhtmlxtras_dlg.fieldset_events_tab} -
                :
                ::
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm old mode 100755 new mode 100644 index 31ee7b70f3..c109345928 --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm @@ -10,11 +10,12 @@ - + + @@ -23,7 +24,7 @@
                {#xhtmlxtras_dlg.fieldset_attrib_tab} -
                :
                +
                @@ -41,7 +42,7 @@ - + @@ -67,7 +68,7 @@
                {#xhtmlxtras_dlg.fieldset_events_tab} -
                :
                ::
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm old mode 100755 new mode 100644 index 17054da3ed..e8d606a340 --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm @@ -9,12 +9,13 @@ - + + @@ -22,7 +23,7 @@
                {#xhtmlxtras_dlg.attribute_attrib_tab} -
                :
                +
                @@ -75,7 +76,7 @@
                {#xhtmlxtras_dlg.attribute_events_tab} -
                :
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm old mode 100755 new mode 100644 index d0a3e3a8e5..0ac6bdb667 --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm @@ -10,11 +10,12 @@ - + + @@ -23,7 +24,7 @@
                {#xhtmlxtras_dlg.fieldset_attrib_tab} -
                :
                +
                @@ -67,7 +68,7 @@
                {#xhtmlxtras_dlg.fieldset_events_tab} -
                :
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm old mode 100755 new mode 100644 index 8b07fa8429..5f667510f5 --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm @@ -10,11 +10,12 @@ - + + @@ -23,14 +24,14 @@
                {#xhtmlxtras_dlg.fieldset_general_tab} -
                :
                +
                @@ -43,7 +44,7 @@
                {#xhtmlxtras_dlg.fieldset_attrib_tab} -
                : - +
                - +
                +
                @@ -61,7 +62,7 @@ - + @@ -87,7 +88,7 @@
                {#xhtmlxtras_dlg.fieldset_events_tab} -
                :
                ::
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js old mode 100755 new mode 100644 index e5195265e0..9b98a5154b --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(b,c){b.addCommand("mceCite",function(){b.windowManager.open({file:c+"/cite.htm",width:350+parseInt(b.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:c})});b.addCommand("mceAcronym",function(){b.windowManager.open({file:c+"/acronym.htm",width:350+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAbbr",function(){b.windowManager.open({file:c+"/abbr.htm",width:350+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceDel",function(){b.windowManager.open({file:c+"/del.htm",width:340+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceIns",function(){b.windowManager.open({file:c+"/ins.htm",width:340+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAttributes",function(){b.windowManager.open({file:c+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:c})});b.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});b.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});b.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});b.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});b.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});b.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});if(tinymce.isIE){function a(d,e){if(e.set){e.content=e.content.replace(/]+)>/gi,"");e.content=e.content.replace(/<\/abbr>/gi,"")}}b.onBeforeSetContent.add(a);b.onPostProcess.add(a)}b.onNodeChange.add(function(e,d,g,f){g=e.dom.getParent(g,"CITE,ACRONYM,ABBR,DEL,INS");d.setDisabled("cite",f);d.setDisabled("acronym",f);d.setDisabled("abbr",f);d.setDisabled("del",f);d.setDisabled("ins",f);d.setDisabled("attribs",g&&g.nodeName=="BODY");d.setActive("cite",0);d.setActive("acronym",0);d.setActive("abbr",0);d.setActive("del",0);d.setActive("ins",0);if(g){do{d.setDisabled(g.nodeName.toLowerCase(),0);d.setActive(g.nodeName.toLowerCase(),1)}while(g=g.parentNode)}});b.onPreInit.add(function(){b.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js old mode 100755 new mode 100644 index 9b51b8368d..f24057211c --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js @@ -27,7 +27,7 @@ ed.windowManager.open({ file : url + '/acronym.htm', width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -38,7 +38,7 @@ ed.windowManager.open({ file : url + '/abbr.htm', width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -49,7 +49,7 @@ ed.windowManager.open({ file : url + '/del.htm', width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -60,7 +60,7 @@ ed.windowManager.open({ file : url + '/ins.htm', width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -70,8 +70,8 @@ ed.addCommand('mceAttributes', function() { ed.windowManager.open({ file : url + '/attributes.htm', - width : 380, - height : 370, + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), inline : 1 }, { plugin_url : url @@ -86,18 +86,6 @@ ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); - if (tinymce.isIE) { - function fix(ed, o) { - if (o.set) { - o.content = o.content.replace(/]+)>/gi, ''); - o.content = o.content.replace(/<\/abbr>/gi, ''); - } - }; - - ed.onBeforeSetContent.add(fix); - ed.onPostProcess.add(fix); - } - ed.onNodeChange.add(function(ed, cm, n, co) { n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm old mode 100755 new mode 100644 index 6c5470cfcc..d001ac7c4d --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm @@ -10,11 +10,12 @@ - + + @@ -23,19 +24,19 @@
                {#xhtmlxtras_dlg.fieldset_general_tab} -
                :
                +
                - + @@ -43,9 +44,9 @@
                {#xhtmlxtras_dlg.fieldset_attrib_tab} -
                : - +
                - +
                :
                +
                - + @@ -61,7 +62,7 @@ - + @@ -87,7 +88,7 @@
                {#xhtmlxtras_dlg.fieldset_events_tab} -
                ::
                ::
                +
                diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js old mode 100755 new mode 100644 index d62a219e6b..9c99995adb --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js @@ -53,7 +53,6 @@ function insertAction() { var inst = tinyMCEPopup.editor; var elm = inst.selection.getNode(); - tinyMCEPopup.execCommand("mceBeginUndoLevel"); setAllAttribs(elm); tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); @@ -72,21 +71,7 @@ function setAttrib(elm, attrib, value) { value = valueElm.value; } - if (value != "") { - dom.setAttrib(elm, attrib.toLowerCase(), value); - - if (attrib == "style") - attrib = "style.cssText"; - - if (attrib.substring(0, 2) == 'on') - value = 'return true;' + value; - - if (attrib == "class") - attrib = "className"; - - elm[attrib]=value; - } else - elm.removeAttribute(attrib); + dom.setAttrib(elm, attrib.toLowerCase(), value); } function setAllAttribs(elm) { diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js old mode 100755 new mode 100644 index 9e5d8c5717..1f957dc786 --- a/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js +++ b/library/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js @@ -21,17 +21,17 @@ function setElementAttribs(elm) { setAllCommonAttribs(elm); setAttrib(elm, 'datetime'); setAttrib(elm, 'cite'); + elm.removeAttribute('data-mce-new'); } function insertDel() { var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - tinyMCEPopup.execCommand('mceBeginUndoLevel'); if (elm == null) { var s = SXE.inst.selection.getContent(); if(s.length > 0) { insertInlineElement('del'); - var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); for (var i=0; i 0) { @@ -165,11 +164,11 @@ SXE.insertElement = function(element_name) { for (var i=0; i 0) { - insertInlineElement('INS'); - var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); for (var i=0; i
                :
                +
                - + - - + +
                {#advanced_dlg.anchor_title}{#advanced_dlg.anchor_title}
                {#advanced_dlg.anchor_name}:
                diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm b/library/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm old mode 100755 new mode 100644 index 3991b8141b..d4b6bdfb7b --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm @@ -5,48 +5,51 @@ - - - - - - -
                {#advanced_dlg.charmap_title}
                + + + + + + + - - - - - + + + + + + + + + +
                - - - - - - - - -
                 
                 
                -
                - - - - - - - - - - - - - - - - -
                HTML-Code
                 
                 
                NUM-Code
                 
                -
                + + + + + + + +
                 
                 
                +
                + + + + + + + + + + + + + + + + +
                 
                 
                 
                +
                {#advanced_dlg.charmap_usage}
                - diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm b/library/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm old mode 100755 new mode 100644 index 096e7550c3..ad1bb0f6cc --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm @@ -6,13 +6,14 @@ - + + @@ -34,7 +35,7 @@
                - {#advanced_dlg.colorpicker_palette_title} + {#advanced_dlg.colorpicker_palette_title}
                @@ -44,9 +45,9 @@
                -
                - {#advanced_dlg.colorpicker_named_title} -
                +
                + {#advanced_dlg.colorpicker_named_title} +
                @@ -65,7 +66,7 @@
                - +
                diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js old mode 100755 new mode 100644 index dc61977461..a887018125 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js @@ -1 +1 @@ -(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(p[0]==o){i.formatter.remove(o)}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){i.execCommand("FontName",false,l);k.select(function(m){return l==m});return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(o){return i==o});return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},""),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=this.settings,m=d.get(j.id+"_tbl"),n=d.get(j.id+"_ifr");i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);d.setStyle(m,"height","");d.setStyle(n,"height",l);if(k.theme_advanced_resize_horizontal){d.setStyle(m,"width","");d.setStyle(n,"width",i);if(i"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},""));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},""));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:n,ch:E})}}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(r,z,l,x,j){var C=this,i,y=0,B,u,D=C.settings,A,k,w,m,q;e.each(C.stateControls,function(n){z.setActive(n,r.queryCommandState(C.controls[n][1]))});function o(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,q.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true)}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(i.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(i.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js old mode 100755 new mode 100644 index 279ca359ce..d94c8e4992 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js @@ -11,6 +11,85 @@ (function(tinymce) { var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + // Generates a preview for a format + function getPreviewCss(ed, fmt) { + var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName; + + previewStyles = ed.settings.preview_styles; + + // No preview forced + if (previewStyles === false) + return ''; + + // Default preview + if (!previewStyles) + previewStyles = 'font-family font-size font-weight text-decoration text-transform color background-color'; + + // Removes any variables since these can't be previewed + function removeVars(val) { + return val.replace(/%(\w+)/g, ''); + }; + + // Create block/inline element to use for preview + name = fmt.block || fmt.inline || 'span'; + previewElm = dom.create(name); + + // Add format styles to preview element + each(fmt.styles, function(value, name) { + value = removeVars(value); + + if (value) + dom.setStyle(previewElm, name, value); + }); + + // Add attributes to preview element + each(fmt.attributes, function(value, name) { + value = removeVars(value); + + if (value) + dom.setAttrib(previewElm, name, value); + }); + + // Add classes to preview element + each(fmt.classes, function(value) { + value = removeVars(value); + + if (!dom.hasClass(previewElm, value)) + dom.addClass(previewElm, value); + }); + + // Add the previewElm outside the visual area + dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); + ed.getBody().appendChild(previewElm); + + // Get parent container font size so we can compute px values out of em/% for older IE:s + parentFontSize = dom.getStyle(ed.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + + each(previewStyles.split(' '), function(name) { + var value = dom.getStyle(previewElm, name, true); + + // Old IE won't calculate the font size so we need to do that manually + if (name == 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; + } + + // Convert font size from em/% to px + value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); + value = (value * parentFontSize) + 'px'; + } + } + + previewCss += name + ':' + value + ';'; + }); + + dom.remove(previewElm); + + return previewCss; + }; + // Tell it to load theme specific language pack(s) tinymce.ThemeManager.requireLangPack('advanced'); @@ -66,6 +145,9 @@ t.url = url; t.onResolveName = new tinymce.util.Dispatcher(this); + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + // Default settings t.settings = s = extend({ theme_advanced_path : true, @@ -81,6 +163,8 @@ theme_advanced_resize_horizontal : 1, theme_advanced_resizing_use_cookie : 1, theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, readonly : ed.settings.readonly }, ed.settings); @@ -119,13 +203,19 @@ if (s.theme_advanced_statusbar_location == 'none') s.theme_advanced_statusbar_location = 0; + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + // Init editor ed.onInit.add(function() { - if (!ed.settings.readonly) + if (!ed.settings.readonly) { ed.onNodeChange.add(t._nodeChanged, t); - - if (ed.settings.content_css !== false) - ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } }); ed.onSetProgressState.add(function(ed, b, ti) { @@ -153,6 +243,15 @@ DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); }, + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + createControl : function(n, cf) { var cd, c; @@ -199,15 +298,21 @@ if (ctrl.getLength() == 0) { each(ed.dom.getClasses(), function(o, idx) { - var name = 'style_' + idx; + var name = 'style_' + idx, fmt; - ed.formatter.register(name, { + fmt = { inline : 'span', attributes : {'class' : o['class']}, selector : '*' - }); + }; + + ed.formatter.register(name, fmt); - ctrl.add(o['class'], name); + ctrl.add(o['class'], name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); }); } }, @@ -219,7 +324,7 @@ ctrl = ctrlMan.createListBox('styleselect', { title : 'advanced.style_select', onselect : function(name) { - var matches, formatNames = []; + var matches, formatNames = [], removedFormat; each(ctrl.items, function(item) { formatNames.push(item.value); @@ -228,11 +333,18 @@ ed.focus(); ed.undoManager.add(); - // Toggle off the current format + // Toggle off the current format(s) matches = ed.formatter.matchAll(formatNames); - if (matches[0] == name) - ed.formatter.remove(name); - else + tinymce.each(matches, function(match) { + if (!name || match == name) { + if (match) + ed.formatter.remove(match); + + removedFormat = true; + } + }); + + if (!removedFormat) ed.formatter.apply(name); ed.undoManager.add(); @@ -243,7 +355,7 @@ }); // Handle specified format - ed.onInit.add(function() { + ed.onPreInit.add(function() { var counter = 0, formats = ed.getParam('style_formats'); if (formats) { @@ -255,24 +367,32 @@ if (keys > 1) { name = fmt.name = fmt.name || 'style_' + (counter++); ed.formatter.register(name, fmt); - ctrl.add(fmt.title, name); + ctrl.add(fmt.title, name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); } else ctrl.add(fmt.title); }); } else { each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { - var name; + var name, fmt; if (val) { name = 'style_' + (counter++); - - ed.formatter.register(name, { + fmt = { inline : 'span', classes : val, selector : '*' - }); + }; - ctrl.add(t.editor.translate(key), name); + ed.formatter.register(name, fmt); + ctrl.add(t.editor.translate(key), name, { + style: function() { + return getPreviewCss(ed, fmt); + } + }); } }); } @@ -300,6 +420,13 @@ c = ed.controlManager.createListBox('fontselect', { title : 'advanced.fontdefault', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + ed.execCommand('FontName', false, v); // Fake selection, execCommand will fire a nodeChange and update the selection @@ -307,6 +434,10 @@ return v == sv; }); + if (cur && cur.value == v) { + c.select(null); + } + return false; // No auto select } }); @@ -324,6 +455,22 @@ var t = this, ed = t.editor, c, i = 0, cl = []; c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + if (v['class']) { ed.focus(); ed.undoManager.add(); @@ -338,6 +485,10 @@ return v == sv; }); + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { + c.select(null); + } + return false; // No auto select }}); @@ -374,10 +525,16 @@ samp : 'advanced.samp' }, t = this; - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + if (c) { each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { - c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v, style: function() { + return getPreviewCss(t.editor, {block: v}); + }}); }); } @@ -445,12 +602,19 @@ renderUI : function(o) { var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); if (!DOM.boxModel) n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); n = tb = DOM.add(n, 'tbody'); switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { @@ -469,7 +633,7 @@ n = o.targetNode; // Add classes to first and last TRs - nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 + nl = sc.rows; DOM.addClass(nl[0], 'mceFirst'); DOM.addClass(nl[nl.length - 1], 'mceLast'); @@ -489,8 +653,7 @@ if (e.nodeName == 'A') { t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); - - return Event.cancel(e); + return false; } }); /* @@ -525,6 +688,28 @@ t.deltaHeight = o.deltaHeight; o.targetNode = null; + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + return { iframeContainer : ic, editorContainer : ed.id + '_parent', @@ -543,12 +728,12 @@ }, resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_tbl'); + var e = DOM.get(this.editor.id + '_ifr'); this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); }, - resizeTo : function(w, h) { + resizeTo : function(w, h, store) { var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); // Boundery fix box @@ -566,8 +751,18 @@ DOM.setStyle(ifr, 'width', w); // Make sure that the size is never smaller than the over all ui - if (w < e.clientWidth) + if (w < e.clientWidth) { + w = e.clientWidth; DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); } }, @@ -662,7 +857,7 @@ each(explode(s.theme_advanced_containers || ''), function(c, i) { var v = s['theme_advanced_container_' + c] || ''; - switch (v.toLowerCase()) { + switch (c.toLowerCase()) { case 'mceeditor': n = DOM.add(tb, 'tr'); n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); @@ -730,17 +925,19 @@ }, _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); - n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); + t.toolbarGroup = toolbarGroup; - if (!ed.getParam('accessibility_focus')) - h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); - h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); // Create toolbar and add the controls for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { @@ -753,13 +950,11 @@ v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; t._addControls(v, tb); - - //n.appendChild(n = tb.render()); - h.push(tb.renderHTML()); + toolbarGroup.add(tb); o.deltaHeight -= s.theme_advanced_row_height; } - + h.push(toolbarGroup.renderHTML()); h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); DOM.setHTML(n, h.join('')); }, @@ -768,12 +963,18 @@ var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); - DOM.add(n, 'a', {href : '#', accesskey : 'x'}); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); if (s.theme_advanced_resizing_use_cookie) { ed.onPostRender.add(function() { @@ -787,12 +988,18 @@ } ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + Event.add(ed.id + '_resize', 'mousedown', function(e) { var mouseMoveHandler1, mouseMoveHandler2, mouseUpHandler1, mouseUpHandler2, startX, startY, startWidth, startHeight, width, height, ifrElm; function resizeOnMove(e) { + e.preventDefault(); + width = startWidth + (e.screenX - startX); height = startHeight + (e.screenY - startY); @@ -806,13 +1013,9 @@ Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); - // Store away the size - if (s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : width, - ch : height - }); - } + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); }; e.preventDefault(); @@ -837,8 +1040,15 @@ n = tb = null; }, + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + _nodeChanged : function(ed, cm, n, co, ob) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches; + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; tinymce.each(t.stateControls, function(c) { cm.setActive(c, ed.queryCommandState(t.controls[c][1])); @@ -860,8 +1070,7 @@ }; cm.setActive('visualaid', ed.hasVisual); - cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); - cm.setDisabled('redo', !ed.undoManager.hasRedo()); + t._updateUndoStatus(ed); cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); p = getParent('A'); @@ -878,12 +1087,12 @@ } if (c = cm.get('anchor')) { - c.setActive(!!p && p.name); + c.setActive(!co && !!p && p.name); } p = getParent('IMG'); if (c = cm.get('image')) - c.setActive(!!p && n.className.indexOf('mceItem') == -1); + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); if (c = cm.get('styleselect')) { t._importClasses(); @@ -895,6 +1104,11 @@ matches = ed.formatter.matchAll(formatNames); c.select(matches[0]); + tinymce.each(matches, function(match, index) { + if (index > 0) { + c.mark(match); + } + }); } if (c = cm.get('formatselect')) { @@ -909,12 +1123,20 @@ if (n.nodeName === 'SPAN') { if (!cl && n.className) cl = n.className; + } + if (ed.dom.is(n, s.theme_advanced_font_selector)) { if (!fz && n.style.fontSize) fz = n.style.fontSize; if (!fn && n.style.fontFamily) fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; } return false; @@ -940,25 +1162,53 @@ return true; }); } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + DOM.setHTML(p, ''); getParent(function(n) { var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - /*if (n.getAttribute('_mce_bogus')) - return; -*/ - // Ignore non element and hidden elements - if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) return; - // Fake name - if (v = DOM.getAttrib(n, 'mce_name')) - na = v; - // Handle prefix if (tinymce.isIE && n.scopeName !== 'HTML') na = n.scopeName + ':' + na; @@ -1033,14 +1283,25 @@ na = na.name; //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); if (p.hasChildNodes()) { - p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); p.insertBefore(pi, p.firstChild); } else p.appendChild(pi); }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } } }, @@ -1054,7 +1315,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/anchor.htm', + url : this.url + '/anchor.htm', width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), inline : true @@ -1067,9 +1328,9 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/charmap.htm', + url : this.url + '/charmap.htm', width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), inline : true }, { theme_url : this.url @@ -1080,7 +1341,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/about.htm', + url : this.url + '/about.htm', width : 480, height : 380, inline : true @@ -1089,13 +1350,25 @@ }); }, + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + _mceColorPicker : function(u, v) { var ed = this.editor; v = v || {}; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/color_picker.htm', + url : this.url + '/color_picker.htm', width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), close_previous : false, @@ -1111,7 +1384,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/source_editor.htm', + url : this.url + '/source_editor.htm', width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), inline : true, @@ -1126,11 +1399,11 @@ var ed = this.editor; // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) return; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/image.htm', + url : this.url + '/image.htm', width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), inline : true @@ -1143,7 +1416,7 @@ var ed = this.editor; ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/link.htm', + url : this.url + '/link.htm', width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), inline : true @@ -1191,4 +1464,4 @@ }); tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}(tinymce)); \ No newline at end of file +}(tinymce)); diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/image.htm b/library/tinymce/jscripts/tiny_mce/themes/advanced/image.htm old mode 100755 new mode 100644 index f30d670641..b8ba729f6f --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/image.htm +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/image.htm @@ -17,57 +17,57 @@
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                - - - - -
                 
                - x -
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                + + + + +
                 
                + x +
                diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/colorpicker.jpg old mode 100755 new mode 100644 index b4c542d107b25f68a9d4f9d7a109d0565d1f1437..b1a377aba7784d3a0a0fabb4d22b8114cde25ace GIT binary patch delta 2365 zcmYjO3pmqzAD>I9aMlowjp#C>)aEu~#cYyDxlQJt%Q?biYTo#tN~-`!P7ZFtr#nbAadE%ze9HDSzJMmFK4-1(Z9?%`+We=EjEv|W8 z!>fdSp#4VT&;i*tOEuLrFX!SvV5H)yQ$M{NTKU}Rsefh3dVL?o0U74_i)ZpjwWnX6 z6^GWUCyvDw8vI51WW6>*;PC!a;G{L3-)U)nS4+Mz!|^Nm96;x!$DzG3Jg0jb`V-hT z!RX58Qg_~Hsn)#>vYGK5Cq(JfK-%aRXp7MeN&Rl53iw{+L-+)W-WD?_Gv)rlC}&nC zch!w<-^aJ@-bXR16@ZXoZ~3np zHkJWU^yj*MC@S4CIAgtc)vERJ4#=w=c+x!dem~k9`*nt*JjoffY`OboyxPRP%Mp{o z3Is?qbu6n_(|p={5t(PxygI_$Ki%gJ3y86r22ZDXMbgbic+$jl@tct8aDGX^P8!5py0G(Y*e#hDL&adl}yF;&k=#MEQU?%wx7lj zg^D@iej=|$udQ;j$Y1u^zY&>rQP;i^ny}sb(MkyS^{Avxui{9St*d5QRuoe&vw$RE zP`P<}Ncy#QG=nPKM&5dVQ)wId<$bVOT??<&g0+x8xGtRC`12NY#>OFV_7*T09&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7aaQ~#J+Ae@Vb#6Xz!tXUW*GLZDfkf66tq!{&32#Rm+|vJii{`y-7cV5enl_GL(c= z{?V^}q$&*ST0{H+~kYM|3uYAs#ozCy(?T>GWX{31NhEwAXaj z$-4<~)zvKkig3>%>7H#88haoT&KLQ(p^}5wZDdLx6KuYt)#=5@obg1ET z!{g_qB0WaNtYWyPG+?L#;E<_|jLW|K#~bMh0c5F+bE?jc+QiEu*c*>0hl)mt&v;q9 zPKAu!+3dJ`Y)zlylp^0O;m9NO(KQNpN*rDyx3ok0O5&`hV>Gm_4_)o#6CnbVu%_YL zkA_EL0QME}wev(ESKLmxMjDBc)Yb-aJM+rU(|mZh4tM?0}d<^7HhJa22mwL*EptRLFpXUAn5J_@V diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/flash.gif new file mode 100644 index 0000000000000000000000000000000000000000..dec3f7c7028df98657860529461af29b8793601c GIT binary patch literal 239 zcmVM~p;I&fgwbZVtlRJPxC7uw?yFxEX;uVr4IeWCJ^(5m4hjYVM>G^+2V)FnXE$mS p86yHh03AmHCKD}bWutOkFce4&0zF5CG_Myp4hRT+ig>^g06S0cRV@Gj literal 0 HcmV?d00001 diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/icons.gif old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/iframe.gif new file mode 100644 index 0000000000000000000000000000000000000000..410c7ad084db698e9f35e3230233aa4040682566 GIT binary patch literal 600 zcmZ?wbhEHb6krfwcoxm@|NsB$<##6SeDUYszh8g<{{H*-%a7k_-3KZc-T3+YPwBiX zzyAIE^Y`z!U%$Wp{QdX;|FQ*Fw;jIy{pasbUw?o3{yVB>Q_sRgx-G9iegFLZcfrha#d9w;%sU=Zx~6K$tw~$%z4`#O^Y@3Z zKV#~)MpSKh@#b63l#}6=>yq2|{`&JLqwny)|NnC)o%r$l&-Y)yKYjo8?#quSuRaGB zt_&<%`RV)bl#YEr{`~p)?RU|v^Y1_Z`u*?Ux8J`*N>>+5JlMAOZr+qr@y$D{mfVhO z+zt#7208-8pDc_F4ABfaAUi>E!oa?@A-bu#r8Qd6oKeb*Lx9UTz)0QBL@+vxY38ii zvqGa87c5+~h&?)zVa3W-D;=U$88}^qMBJ^ERU|z17!;#97+4%Rd1XcXJq#>t8KR;E z7zr5i6BgH5y=gAD)sAQlGB zh8au?j!n~E(Pks?@!j1fR&j*RWY8GF(-=x H6d0@lT&58X literal 0 HcmV?d00001 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif old mode 100755 new mode 100644 similarity index 100% rename from library/tinymce/jscripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif rename to library/tinymce/jscripts/tiny_mce/themes/advanced/img/pagebreak.gif diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/quicktime.gif new file mode 100644 index 0000000000000000000000000000000000000000..8f10e7aa6b6ab40ee69a1a41a961c092168d6fda GIT binary patch literal 301 zcmV+|0n+|QNk%w1VGsZi0Q4UK+~)L6v+~s9^fsC5ZpZP=*zu3F=Jxpf8k_5u%JNv6 z=md-84VLU4w)kSE=yI&-yw>b=v+SqE?+kq47pC+YrR?bJ^yu>Zyvpn;hTp*6^mM!O zu+8!}sO$`q%8%`=C5EEn#1d#z95FHtK5(^#(cp^e+Y!d=4FCrFbY9A3U z4-O0-4kHJPJ2(jk13n5879s!!3Q`V>8VwW`9my3H#|R8ZD+fdx0E-+693cQZ;!k;* literal 0 HcmV?d00001 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/img/realmedia.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif old mode 100755 new mode 100644 similarity index 100% rename from library/tinymce/jscripts/tiny_mce/plugins/media/img/realmedia.gif rename to library/tinymce/jscripts/tiny_mce/themes/advanced/img/realmedia.gif diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/shockwave.gif new file mode 100644 index 0000000000000000000000000000000000000000..9314d044709c9845876e08003cf94526fd69177f GIT binary patch literal 384 zcmZ?wbhEHb6lD-#_^Qe9?Af#b->&}n`s(k;lb>H+`#+Q6|3c{>OLTv23;utm>DSfy zuOD3adm!iUuGar)4FAhzel5=UwZ7*6(K(+k@BP_g{o}}@k7u_2k7W2iGwlom!+#Z( z|Hj5w_4MwTo8QaHxm#EFYX1DUOO|}vvgQBb!_ST${rmj+`+Fep|C$j4HGtwz7FGrZ zO$Hs1VIV&_u+2R%#bJV$RKJIcL*N7vss0Y-EsB{gGlSJaTr>sRLKbLj5HMTpyK;)l zJcfpaMYltBZdEK6Kht6+BPy*VtthFMtIoqFC=#Tu$e^eaDXCC7U0vOYOJjNk(;P!VagC#fQ*?7otVO)-#9rK#nB%ry4`E_DHQ Wm01j~^6E13^D1O7+^=wCum%9s<%z=p literal 0 HcmV?d00001 diff --git a/library/tinymce/jscripts/tiny_mce/plugins/media/img/trans.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif old mode 100755 new mode 100644 similarity index 100% rename from library/tinymce/jscripts/tiny_mce/plugins/media/img/trans.gif rename to library/tinymce/jscripts/tiny_mce/themes/advanced/img/trans.gif diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif b/library/tinymce/jscripts/tiny_mce/themes/advanced/img/video.gif new file mode 100644 index 0000000000000000000000000000000000000000..3570104077a3b3585f11403c8d4c3fc9351f35d2 GIT binary patch literal 597 zcmZ?wbhEHb6krfwc$UTx9v<%P?Ok48Ze?YanwpxCkzrwBk(ZYzB_&l;Qw!gmM(Ep^QBwbzIoSdAh>*2n> zz9l6k0Xw#(?);y5^ls9w|LObxXI*si^YfcEYu3*P8J(S-PEJlaNB-yTd}C^Ax@_69 zzP`Ryt5)S5`=P3;TDk9SbaeFk_3NiTjGA~aFd-pf@}tlxQ>GLb7jM|Gp`oFHlaq7F zk|nvhxjsHV=g+oST3Rl6T(N1>rn0iK*Ed>3MMVn>3vF#}**q!otE>Sy|^jDoRUBoBANRc=wyaJged$+}u3x zK}ld>puWET{||NozXdO-0f3nK$V8iNkVNKl+Guy1NeYie$3 zZB}=&Zex!RYq8YfVwgNdMpdFkN|rU!Fha}0m66q>CDxczOhH^pM9qvxw1p`;Rftzu zQJ&9}g>iErlc2ORw;aC_=l*6UJ=st%r*ISVV2jgDT<)w>rXHGL<21Kdo z#'; document.getElementById('iframecontainer').innerHTML = html; document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); } } diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js old mode 100755 new mode 100644 index 7fe7810558..2940db3591 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js @@ -19,16 +19,23 @@ var AnchorDialog = { update : function() { var ed = this.editor, elm, name = document.forms[0].anchorName.value; + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + tinyMCEPopup.restoreSelection(); if (this.action != 'update') ed.selection.collapse(1); elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) + if (elm) { + elm.setAttribute('name', name); elm.name = name; - else - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); + } else + // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF')); tinyMCEPopup.close(); } diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js old mode 100755 new mode 100644 index 8c5aea1721..bb1869558c --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js @@ -173,7 +173,7 @@ var charmap = [ ['ý', 'ý', true, 'y - acute'], ['þ', 'þ', true, 'thorn'], ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], + ['Α', 'Α', true, 'Alpha'], ['Β', 'Β', true, 'Beta'], ['Γ', 'Γ', true, 'Gamma'], ['Δ', 'Δ', true, 'Delta'], @@ -258,8 +258,8 @@ var charmap = [ ['⌋', '⌋', false,'right floor'], ['⟨', '〈', false,'left-pointing angle bracket'], ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true,'lozenge'], - ['♠', '♠', false,'black spade suit'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], ['♣', '♣', true, 'black club suit'], ['♥', '♥', true, 'black heart suit'], ['♦', '♦', true, 'black diamond suit'], @@ -275,19 +275,46 @@ var charmap = [ tinyMCEPopup.onInit.add(function() { tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); }); +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + function renderCharMapHTML() { var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = ''; + var html = '
                '+ + '
                '; var cols=-1; for (i=0; i' - + '' + + '' + charmap[i][1] + ''; if ((cols+1) % charsPerRow == 0) @@ -301,7 +328,8 @@ function renderCharMapHTML() { html += ''; } - html += '
                 
                '; + html += '
                '; + html = html.replace(/
                ' - + ''; - - for (i=0; i' - + '' - + ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
                '; - - el.innerHTML = h; - el.className = 'generated'; -} - -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += '' - } - - el.innerHTML = h; - el.className = 'generated'; -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i 1 ? value : '0' + value; // Padd with leading zero + }; + + color = tinymce.trim(color); + color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#' + color = namedLookup[color] || color; + + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color); + + if (matches) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else { + matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color); + + if (matches) { + red = toInt(matches[1], 16); + green = toInt(matches[2], 16); + blue = toInt(matches[3], 16); + } else { + matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color); + + if (matches) { + red = toInt(matches[1] + matches[1], 16); + green = toInt(matches[2] + matches[2], 16); + blue = toInt(matches[3] + matches[3], 16); + } else { + return ''; + } + } + } + + return '#' + hex(red) + hex(green) + hex(blue); +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + var hexColor = toHexColor(color); + + if (hexColor === '') { + var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value'); + tinyMCEPopup.alert(text + ': ' + color); + } + else { + tinyMCEPopup.restoreSelection(); + + if (f) + f(hexColor); + + tinyMCEPopup.close(); + } +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
                '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
                ' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
                '; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i 0) { lst.options[lst.options.length] = new Option('', ''); @@ -77,7 +77,7 @@ var ImageDialog = { args.style = this.styleVal; tinymce.extend(args, { - src : f.src.value, + src : f.src.value.replace(/ /g, '%20'), alt : f.alt.value, width : f.width.value, height : f.height.value @@ -87,10 +87,16 @@ var ImageDialog = { if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); ed.undoManager.add(); } diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js old mode 100755 new mode 100644 index f67a5bc828..53ff409e79 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js @@ -31,7 +31,7 @@ var LinkDialog = { }, update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); tinyMCEPopup.restoreSelection(); e = ed.dom.getParent(ed.selection.getNode(), 'A'); @@ -39,7 +39,6 @@ var LinkDialog = { // Remove element if there is no href if (!f.href.value) { if (e) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); b = ed.selection.getBookmark(); ed.dom.remove(e, 1); ed.selection.moveToBookmark(b); @@ -49,19 +48,17 @@ var LinkDialog = { } } - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - // Create new anchor elements if (e == null) { ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); tinymce.each(ed.dom.select("a"), function(n) { if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { e = n; ed.dom.setAttribs(e, { - href : f.href.value, + href : href, title : f.linktitle.value, target : f.target_list ? getSelectValue(f, "target_list") : null, 'class' : f.class_list ? getSelectValue(f, "class_list") : null @@ -70,7 +67,7 @@ var LinkDialog = { }); } else { ed.dom.setAttribs(e, { - href : f.href.value, + href : href, title : f.linktitle.value, target : f.target_list ? getSelectValue(f, "target_list") : null, 'class' : f.class_list ? getSelectValue(f, "class_list") : null diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js old mode 100755 new mode 100644 index 279328614c..dd5e366fa9 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js @@ -16,7 +16,7 @@ function onLoadInit() { document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - setWrap('soft'); + turnWrapOn(); document.getElementById('wraped').checked = true; } @@ -37,26 +37,42 @@ function setWrap(val) { } } -function toggleWordWrap(elm) { - if (elm.checked) - setWrap('soft'); - else - setWrap('off'); +function setWhiteSpaceCss(value) { + var el = document.getElementById('htmlSource'); + tinymce.DOM.setStyle(el, 'white-space', value); } -var wHeight=0, wWidth=0, owHeight=0, owWidth=0; +function turnWrapOff() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre'); + } else { + setWrap('off'); + } +} -function resizeInputs() { - var el = document.getElementById('htmlSource'); +function turnWrapOn() { + if (tinymce.isWebKit) { + setWhiteSpaceCss('pre-wrap'); + } else { + setWrap('soft'); + } +} - if (!tinymce.isIE) { - wHeight = self.innerHeight - 65; - wWidth = self.innerWidth - 16; +function toggleWordWrap(elm) { + if (elm.checked) { + turnWrapOn(); } else { - wHeight = document.body.clientHeight - 70; - wWidth = document.body.clientWidth - 16; + turnWrapOff(); } +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; - el.style.height = Math.abs(wHeight) + 'px'; - el.style.width = Math.abs(wWidth) + 'px'; + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } } diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js old mode 100755 new mode 100644 index 502b008176..6e58481874 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js @@ -1,62 +1 @@ -tinyMCE.addI18n('en.advanced',{ -style_select:"Styles", -font_size:"Font size", -fontdefault:"Font family", -block:"Format", -paragraph:"Paragraph", -div:"Div", -address:"Address", -pre:"Preformatted", -h1:"Heading 1", -h2:"Heading 2", -h3:"Heading 3", -h4:"Heading 4", -h5:"Heading 5", -h6:"Heading 6", -blockquote:"Blockquote", -code:"Code", -samp:"Code sample", -dt:"Definition term ", -dd:"Definition description", -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -justifyleft_desc:"Align left", -justifycenter_desc:"Align center", -justifyright_desc:"Align right", -justifyfull_desc:"Align full", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -outdent_desc:"Outdent", -indent_desc:"Indent", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -link_desc:"Insert/edit link", -unlink_desc:"Unlink", -image_desc:"Insert/edit image", -cleanup_desc:"Cleanup messy code", -code_desc:"Edit BBcode Source", -sub_desc:"Subscript", -sup_desc:"Superscript", -hr_desc:"Insert horizontal ruler", -removeformat_desc:"Remove formatting", -custom1_desc:"Your custom description here", -forecolor_desc:"Select text color", -backcolor_desc:"Select background color", -charmap_desc:"Insert custom character", -visualaid_desc:"Toggle guidelines/invisible elements", -anchor_desc:"Insert/edit anchor", -cut_desc:"Cut", -copy_desc:"Copy", -paste_desc:"Paste", -image_props_desc:"Image properties", -newdocument_desc:"New document", -help_desc:"Help", -blockquote_desc:"Blockquote", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", -path:"Path", -newdocument:"Are you sure you want clear all contents?", -toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", -more_colors:"More colors" -}); \ No newline at end of file +tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"}); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js old mode 100755 new mode 100644 index ea5a6dae28..50cd87e3d0 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js @@ -1,51 +1 @@ -tinyMCE.addI18n('en.advanced_dlg',{ -about_title:"About TinyMCE", -about_general:"About", -about_help:"Help", -about_license:"License", -about_plugins:"Plugins", -about_plugin:"Plugin", -about_author:"Author", -about_version:"Version", -about_loaded:"Loaded plugins", -anchor_title:"Insert/edit anchor", -anchor_name:"Anchor name", -code_title:"BBcode Source Editor", -code_wordwrap:"Word wrap", -colorpicker_title:"Select a color", -colorpicker_picker_tab:"Picker", -colorpicker_picker_title:"Color picker", -colorpicker_palette_tab:"Palette", -colorpicker_palette_title:"Palette colors", -colorpicker_named_tab:"Named", -colorpicker_named_title:"Named colors", -colorpicker_color:"Color:", -colorpicker_name:"Name:", -charmap_title:"Select custom character", -image_title:"Insert/edit image", -image_src:"Image URL", -image_alt:"Image description", -image_list:"Image list", -image_border:"Border", -image_dimensions:"Dimensions", -image_vspace:"Vertical space", -image_hspace:"Horizontal space", -image_align:"Alignment", -image_align_baseline:"Baseline", -image_align_top:"Top", -image_align_middle:"Middle", -image_align_bottom:"Bottom", -image_align_texttop:"Text top", -image_align_textbottom:"Text bottom", -image_align_left:"Left", -image_align_right:"Right", -link_title:"Insert/edit link", -link_url:"Link URL", -link_target:"Target", -link_target_same:"Open link in the same window", -link_target_blank:"Open link in a new window", -link_titlefield:"Title", -link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -link_list:"Link list" -}); \ No newline at end of file +tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""}); diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/link.htm b/library/tinymce/jscripts/tiny_mce/themes/advanced/link.htm old mode 100755 new mode 100644 index 7565b9ae8b..5d9dea9b8c --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/link.htm +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/link.htm @@ -18,34 +18,33 @@
                - - - - - - - - - - - - - - - - - - - - - - -
                - - - - -
                 
                + + + + + + + + + + + + + + + + + + + + + +
                + + + + +
                 
                diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm b/library/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm new file mode 100644 index 0000000000..20ec2f5a34 --- /dev/null +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/shortcuts.htm @@ -0,0 +1,47 @@ + + + + {#advanced_dlg.accessibility_help} + + + + +

                {#advanced_dlg.accessibility_usage_title}

                +

                Toolbars

                +

                Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

                + +

                Status Bar

                +

                To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

                + +

                Context Menu

                +

                Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

                + +

                Keyboard Shortcuts

                + + + + + + + + + + + + + + + + + + + + + +
                KeystrokeFunction
                Control-BBold
                Control-IItalic
                Control-ZUndo
                Control-YRedo
                + + diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css old mode 100755 new mode 100644 index 444063a828..52a1d67e26 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css @@ -1,6 +1,7 @@ body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} h1 {font-size: 2em} h2 {font-size: 1.5em} h3 {font-size: 1.17em} @@ -8,28 +9,17 @@ h4 {font-size: 1em} h5 {font-size: .83em} h6 {font-size: .75em} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} td.mceSelected, th.mceSelected {background-color:#3399ff !important} img {border:0;} -table {cursor:default} +table, img, hr, .mceItemAnchor {cursor:default} table td, table th {cursor:text} ins {border-bottom:1px solid green; text-decoration: none; color:green} del {color:red; text-decoration:line-through} cite {border-bottom:1px dashed blue} acronym {border-bottom:1px dotted #CCC; cursor:help} abbr {border-bottom:1px dashed #CCC; cursor:help} -code { - font-family: Courier, monospace; - white-space: pre; - display: block; - overflow: auto; - border: 1px solid #444; - background: #EEE; - color: #444; - padding: 10px; - margin-top: 20px; -} - /* IE */ * html body { @@ -45,3 +35,17 @@ scrollbar-track-color:#F5F5F5; img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +.mceHideBrInPre pre br {display: none} diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css old mode 100755 new mode 100644 diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/img/buttons.png old mode 100755 new mode 100644 index 7dd58418ba7cfe58ae7efdf174e0b223fe3aa6a0..1e53560e0aa7bb1b9a0373fc2f330acab7d1d51f GIT binary patch delta 2525 zcmV<32_p8&8NC>gBe7Up0)GjqNklW6KNnY z5Dmy?f+RtfI3miXgUZ$l3N2OYxbJnZTdVCj)}{MCZD&hL34hpp-*fJkN9^6-rttRd_kS0lKeglM98q|x zSXg)|clwtWRQ;MY1qEx?toa>1R4`M3mjVKlOJfdD-oUKKN?soPS!gqP#L^XT4aOn{ z<|RX4N|~K3sI#VE=T7#D$4&spi{!Bt^$m?o{QUC{rr%gvO7{Aqylm?0S+zX;7S)5x zYH`$|q9m`!4|np5D1R_fYSKe+^>SWz0Y7FK1ysuqN>D&2@AB2F{;N0@haxPiQCh0& zhw4lG5r0WZQ4t;*Lqq;NdgWD1{6j!LBHsQN0n-H)T^-WjVH5Nl`Db5R>T*R~PM05_ zz&}62x_GwK&EQ;@DGPWTGSzxvULAk)dDV>VGDjevLnadS|zjKJgNr z`bf8#+LA20zq{MdV;qyd)>%W;u2b1cxN5qol8KVq;TnzZb$VIutgWfp%2Ix?b*q1c zp^rpdy`U!2+}vDCtV5;l-Wsivb|!ywlycE%FI3t1UC}6o*QwN+^e&e(+6tmh&IV$* zwKr1BS*PP_Wq6=`xrq%|~+T_C5$Ej&(aBhffVASe$q7B6G zIup%|XhSd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Dv zKfB?{e>G9txEWwYLjaCL+?mou?GtiyGHt0}2WCuNn3mhD(X*$Jt6R}T1srM-s)${_ za(_gckjT}y9l_OSwlNWoYbF36-^jIhRBu!dXSgwZ`?amH3bh@M#|o&e)3aMz#P>h7 zN2K)I*JWfZ=nA9i=}iA@8&FYEO^0!^vtPLMn&a*g=xvR#+6lY`ARvA62(r!>rz2ANhRI*qH;b7AwQ7nN8@TH#Ws&GcSz85IM7W=p+9@ zRI74y*H;0$iA=)}@wHcH>)3TL_cxy(uBoX>Tjg*4KU!L#8?ha{ezmgtG#WajIMLFG m$9hVqYNgZs*94epU`y6#e2-qmp8{7)K diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png old mode 100755 new mode 100644 index 8996c7493e8a58c9c40845cbe8abdc3e6730716d..7fc57f2bc2d63a3ad6fbf98b663f336539f011ec GIT binary patch delta 618 zcmV-w0+s!k9g78!83+Ra0086$;ro#x7k>cEP)t-s0002HySo4Y08>*_a&~-=k(7~{ zq?n(no1(0rrmv!@vZk!Hsjs-Lv%9dizO=c)x4gu=z{b14$GpMFzQf7C#LL0P%)`gc z#L3Ub%FxKn(aFuz%g@yRt3Us-P5-h`|Fl&9wO9YQTmQIT|GHxTyJi2qY5%`%|9`=9 z|HF3w#e4t9fd9#a|I3O0&5r-ub^qLY|J{H8--Q3*iT~k_|KpSYd|L3Cr z=%)YbtN-h;|LwH@@45f*zW?&W|MbWI_00eO|F&Wq@&Et;0(4SNQveU|I_8w5<1)+Sxjy>khxmTZ^UMAPuDhl=nJ%xacLVXE zN31WKSh0P^hawhnw)jf}#5_+GPu2e^5c51aiV00%6xVrr#$!*$V|i{OPJb2GYE{RI zUk${E_f%7X#d{l5O*06LqA`1W{A{z-KcE#qKx)lR6a_=R{wHo}S^x<1c*Pfemr)l5 zdENxVv+rLvA{OzVh(9zy{H9446TMvi`r@7X*kw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KN`;!@ylm7$*nDhK&GcDTy000DMK}|sb z0I`mI`%#ks0Dk}=V@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000BCNkl%`Zo(Y1Aj?R|BwL*lGFS%byy z6<_PB?8gMKt#y$3n#Pv>Rr3?i;C|+)$6!Au23uMOnXhSV*-V3Q@xhOu1K)$MU%g`FFW0215ys%%osV6|Va)Tq5mdhUN6U~J-AM~#pUO%r%hKW> zB7eusX0zWr)GVVYyceilo$(Yz}V4nP`(d_C!HvOqs3Ng zayGsi@d6C|wnfB2sVXyr<6toNU~muS7Jp%5!G7Wx>|A`%&Y)*EBQp3H z2j^7#-9YRw^5q6F@uMxC7i4t%>0n!!hpD9ts>D$Uth zU#de?8&_dbEojxLRFxCA$%)qMsCas#?K7L3ocQuk8=uZsWj;k%IYs!L-$f*s!GD8v zieLt#8SD=Oz(@w;URN@MZQ$V7nZbQx@b0(d0Q~o0U;$RD%K5zvB-b1urssJhJBPP$ z>+c;#%1@;#JE-3(oBmc<*HFJzMwzRv(wbTrRaXZ%Z590fKye~-XQQ}NT^<@TI z+2lmEK+fpwvFbapEke{2MBvsQY@+%ygNODMkt7E5DS{b1R6Up(%q@Z$j0YI0)Y`Tr tDd0rp<~3DXQ_F!8)>XlC0|M~B0RV7?*50eEtCs)(002ovPDHLkV1i_X4a@)l diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png old mode 100755 new mode 100644 index bd5d2550c06d83c1141b78c5af7217e89559fc32..c0dcc6cac2003f7405fff3ea5df7bcf276243596 GIT binary patch delta 2072 zcmV+z2bL86o&f`_+2dMjNDlznH&TyHd_URN{##*Ml(GE~%a^)cgqM3rM6 zy{bondNjd$e}A~n3(q}gq4ulxA1GMAU&Onw&G(G!`w1>rDpD?2qyj2sDOZq}vmEsd z@}xM$9V2sUnzinX>{lh^hXjQ<)2Nkx*%9e)zk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jz&aqHWHjHo#FZ)M=#a_bw+j+mn}px!qeOTe}Q zY!hrb(x+I|44{$-^&C&VxQs>Iq8|c?*8SU-N@Z4=h=ATktzooG$I%jf zM^9NqP`kBL{y`K^Q5aM2ED-e}OpJ=ndH@$KuK0e+hz~1_tWL#>s0WxKT0l$@h4C8d{u@yJ}>WAE3Fd(@KviX7h9|z;NfuiI1EEH+t=KPgTM3Aw^tS8%B9EP z^FIQ3GY}A4!0e!2MEv!BH|*f^eOPO4vn>O8GOk!rNj0Vl^C`K{oB$@Vy3__9;QQZu zsT%p6nI|0@Px#?8vwI>zRXr6&qMS=T9077Cn~IJ)5MpqpvI zv*Y?!y^a9vbgF8avwNRNI6?R_xcWD=lsNK`)oC{XE_1H47NP>Y@&~8_J8U8J9{vFU zaP8Kjt$p*SAL^5fKL#$m)&YR~8wE(E1t_M@-d$N4PclpTv(-N;ISMKwaxkx7!L@h) z?Ofv@=u{EZUkCL!fwc{Yb$ys~>ThPh>-m8-eczl@e;u@L&NuaSNK0aRs52VW1Ma=! zW`6IzQ`|$`4H1F0bD)atgv*kf_TDsm_bxeM`GEfvi4`EMXxeA*;pX*U0iV6+){Bk+ z%x6ReTe}PSOr2szl;!Ry`!)GE+Z)6|z#gj^AWExl?*DF~j;SAfiH08s_s-@COXCse zt1K&4O)3x&A>UQ0%;Mqbl!n9UBEXfN+*(&e#D=3fmi?ZrZcfuxmO$jOUxm5?aMX7! zfjl>t#TnF+1%XC-2r6=Uu4xg9gQtKvc9uisyY6kqWefa}R)j}lGU^Bi!vc^> z9-S($V$V6bv=SaqzQ4o2%)s%DcQ3_4T)pHJ_8n&Rr~9ROG-5#LxX)wLf6NO|fq`uOj7mdgJI0H2v4wf~~Kng9R* M07*qoM6N<$f@g#ZbN~PV diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css old mode 100755 new mode 100644 index a6253976af..7b5103be29 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -4,8 +4,8 @@ .o2k7Skin table td {vertical-align:middle} /* Containers */ -.o2k7Skin table {background:#E5EFFD} -.o2k7Skin iframe {display:block; background:#FFF} +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} .o2k7Skin .mceToolbar {height:26px} /* External */ @@ -19,7 +19,8 @@ .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} .o2k7Skin .mceStatusbar div {float:left; padding:2px} .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} .o2k7Skin .mceStatusbar a:hover {text-decoration:underline} @@ -50,19 +51,19 @@ .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} /* ListBox */ -.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox {padding-left: 3px} .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} .o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} /* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} .o2k7Skin .mceSplitButton a.mceAction {width:22px} .o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} @@ -105,6 +106,7 @@ .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} .o2k7Skin .mceMenu span.mceMenuLine {display:none} .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} /* Progress,Resize */ .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} @@ -213,3 +215,4 @@ .o2k7Skin span.mce_pagebreak {background-position:0 -40px} .o2k7Skin span.mce_restoredraft {background-position:-20px -40px} .o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +.o2k7Skin span.mce_visualblocks {background-position: -40px -40px} diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css old mode 100755 new mode 100644 index 153f0c38a6..50c9b76a2d --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -1,6 +1,6 @@ /* Black */ .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css old mode 100755 new mode 100644 index 7fe3b45e12..960a8e4755 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -1,5 +1,5 @@ /* Silver */ .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} .o2k7SkinSilver .mceListBox .mceText {background:#FFF} .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm b/library/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm old mode 100755 new mode 100644 index 5957bbd178..3c6d65808a --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm +++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm @@ -6,7 +6,7 @@
                -
                {#advanced_dlg.code_title}
                +
                @@ -17,8 +17,8 @@
                - - + +
                diff --git a/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js b/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js old mode 100755 new mode 100644 index ed89abc067..4b3209cc92 --- a/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js +++ b/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js @@ -1 +1 @@ -(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})});c.dom.loadCSS(d+"/skins/"+f.skin+"/content.css")});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file +(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js b/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js old mode 100755 new mode 100644 index 4b862d49d6..01ce87c58a --- a/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js +++ b/library/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js @@ -19,6 +19,7 @@ var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); ed.onInit.add(function() { ed.onNodeChange.add(function(ed, cm) { @@ -26,8 +27,6 @@ cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); }); }); - - ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); }); DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); diff --git a/library/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif b/library/tinymce/jscripts/tiny_mce/themes/simple/img/icons.gif old mode 100755 new mode 100644 index 16af141ff0eea376a889b1e8d28e9c1cacaaab16..6fcbcb5dedf16a5fa1d15c2aa127bceb612f1e71 GIT binary patch literal 806 zcmZ?wbhEHbJi#Es@KuxH{{08bHy>kQU|4+kcV*u?6Yu2z|Nk2X_I-c9E~4fBsnb_x z&7Ngzq1inB@Woqi-rnfiGF7yw9zM z^p;~=3MY4TT)2AY!iC=7fBwej_wPS(UDm1P!}|}9?`#au+qhx#R?Fl=KuakHia%Lc z85lGfbU;Rd{N%v)|G<<24;`ug6HAIt=2*?Yu%d)ZG@><(acbwmDSj%f4MMZ#%vkt3 z%+g~)i8kP^LLB_(WJHBo z)4eilyozQ8a&qqSt%<6xpa0;xA7k;M?mchbzI*>+`RnL~M?L!{MDwZt;o_B2F2$0=pQSpQ!u@RcUGT{(44KaY91N#ws_nDH9G%Qf=ZF z5o_THWH`G~`GwyilS^z$ZvV~I`dh4Lx_8c>?R@8gr-07UIgFjp0y#A&c{B)cE>2kS zL5I1;i$zoEA)6qV`HGJvVWE!{8MZ6ST|PC}d%Kid7{KiD{l18xziSGKuWtj9AkWy-*`}#c~0`Lrjq> z-;O-o=3A#@&dst%_SasuJq0xZW;OwR3vM!diY%Es?;J~Pp}LYununP(i|XxU>#u=* zSvNC^0?cJ=S?=UK4&2DdcCO^BsHxjWc4vR-Z64x&8r#>V9!JMd4O!Z*d@mNrgX=jUy;0|T>ZntHjDU$=-I8y`|tN~Y9 literal 1440 zcmV;R1z-9{Nk%w1VaNa!0QUd@Ib*`7v&H}b0P*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L9rfP;Fp}T4iu?af8AOXd@5C0(U&fK3z8Av u{UxbK=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+""}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;A.top+=p.win.self!=p.win.top?2:0;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="
                "+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="
                "+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/

                <\/p>|]+)><\/p>|/gi,' 

                ')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/

                ]+)>|

                /ig,'

                ');p=p.replace(/<\/p>/gi,"
                ");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r]+)\/>|/gi,"");if(q.keep_values){if(/)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return""})}r=r.replace(//g,"");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(l){var t,A,z=g.dom.doc,r=z.body,u,n,y,o,s,k,p,q,x,m;this.destroy();y=l.startContainer;o=l.startOffset;s=l.endContainer;k=l.endOffset;t=r.createTextRange();if(y==z||s==z){t=r.createTextRange();t.collapse();t.select();return}if(y.nodeType==1&&y.hasChildNodes()){q=y.childNodes.length-1;if(o>q){x=1;y=y.childNodes[q]}else{y=y.childNodes[o]}if(y.nodeType==3){o=0}}if(s.nodeType==1&&s.hasChildNodes()){q=s.childNodes.length-1;if(k==0){m=1;s=s.childNodes[0]}else{s=s.childNodes[Math.min(q,k-1)];if(s.nodeType==3){k=s.nodeValue.length}}}if(y==s&&y.nodeType==1){if(/^(IMG|TABLE)$/.test(y.nodeName)&&o!=k){t=r.createControlRange();t.addElement(y)}else{t=r.createTextRange();if(!y.hasChildNodes()&&y.canHaveHTML){y.innerHTML=j}t.moveToElementText(y);if(y.innerHTML==j){t.collapse(c);y.removeChild(y.firstChild)}}if(o==k){t.collapse(k<=l.endContainer.childNodes.length-1)}t.select();t.scrollIntoView();return}t=r.createTextRange();p=z.createElement("span");p.innerHTML=" ";if(y.nodeType==3){if(x){d.insertAfter(p,y)}else{y.parentNode.insertBefore(p,y)}t.moveToElementText(p);p.parentNode.removeChild(p);if(o>0){t.move("character",o)}}else{t.moveToElementText(y);if(x){t.collapse(f)}}if(y==s&&y.nodeType==3){try{t.moveEnd("character",k-o);t.select();t.scrollIntoView()}catch(v){}return}A=r.createTextRange();if(s.nodeType==3){s.parentNode.insertBefore(p,s);A.moveToElementText(p);p.parentNode.removeChild(p);A.move("character",k);t.setEndPoint("EndToStart",A)}else{A.moveToElementText(s);A.collapse(!!m);t.setEndPoint("EndToEnd",A)}t.select();t.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null};if(g.dom.boxModel){(function(){var q=d.doc,l=q.body,n,o;q.documentElement.unselectable=c;function p(r,u){var s=l.createTextRange();try{s.moveToPoint(r,u)}catch(t){s=null}return s}function m(s){var r;if(s.button){r=p(s.x,s.y);if(r){if(r.compareEndPoints("StartToStart",o)>0){r.setEndPoint("StartToStart",o)}else{r.setEndPoint("EndToEnd",o)}r.select()}}else{k()}}function k(){d.unbind(q,"mouseup",k);d.unbind(q,"mousemove",m);n=0}d.bind(q,"mousedown",function(r){if(r.target.nodeName==="HTML"){if(n){k()}n=1;o=p(r.x,r.y);if(o){d.bind(q,"mouseup",k);d.bind(q,"mousemove",m);o.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

                ";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="
                ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j_';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=i}else{j.insertNode(j.createContextualFragment(i))}}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);j.pasteHTML(''+l+"")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='
                '}return t}k("start");k("end");f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=g.win.document.createRange?g.win.document.createRange():g.win.document.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>||<\/html>||]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(
                \s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^
                \s*<\//.test(n)){return""}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(]*>)(.*?)(<\/script>)/g},{pattern:/(]*>)(.*?)(<\/noscript>)/g},{pattern:/(]*>)(.*?)(<\/style>)/g},{pattern:/(]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/()/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/

                \s+<\/p>|]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?" 

                ":" 

                ");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(//g,"");if(k.entity_encoding=="raw"){j=j.replace(/

                 <\/p>|]+)> <\/p>/g,"\u00a0

                ")}j=j.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return""+i.dom.decode(o.replace(//g,""))+""})}n.content=j},_serializeNode:function(D,I){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,H,B,h,y,k,r,C,p,m,G,o;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("_mce_bogus"):D.getAttribute("_mce_bogus")){return}p=G=false;q=D.hasChildNodes();k=D.getAttribute("_mce_name")||D.nodeName.toLowerCase();o=D.getAttribute("_mce_type");if(o){if(!z._info.cleanup){p=true;return}else{G=1}}if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!G){if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||I){p=true;break}}if(d){if(A.fix_content_duplication){if(D._mce_serialized==z.key){return}D._mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(A.validate_children){if(z.elementName&&!z.schema.isValid(z.elementName,k)){p=true;break}z.elementName=k}r=z.findRule(k);if(!r){p=true;break}k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){H=r.requiredAttribs;for(F=H.length-1;F>=0;F--){if(this.dom.getAttrib(D,H[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F-1;F--){h=B[F];if(h.specified){H=h.nodeName.toLowerCase();if(A.invalid_attrs.test(H)||!r.validAttribsRE.test(H)){continue}C=z.findAttribRule(r,H);y=z._getAttrib(D,C,H);if(y!==null){x.writeAttribute(H,y)}}}}if(o&&G){x.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(A.validate_children&&z.elementName&&!z.schema.isValid(z.elementName,"#text")){return}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+""+p}))});return j},_unprotect:function(i,j){i=i.replace(/\"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,""))}}if(b.stdMode){e+='
                '+j.renderHTML()+""+j.renderHTML()+"
                text|text2

                text|text2